diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ee945a11..e4323297 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -68,6 +68,18 @@ jobs: conductor-sdk-test:latest \ /bin/sh -c "cd /package && COVERAGE_FILE=/package/${{ env.COVERAGE_DIR }}/.coverage.serdeser coverage run -m pytest tests/serdesertest -v" + - name: Run integration tests + id: integration_tests + continue-on-error: true + run: | + docker run --rm \ + -e CONDUCTOR_AUTH_KEY=${{ env.CONDUCTOR_AUTH_KEY }} \ + -e CONDUCTOR_AUTH_SECRET=${{ env.CONDUCTOR_AUTH_SECRET }} \ + -e CONDUCTOR_SERVER_URL=${{ env.CONDUCTOR_SERVER_URL }} \ + -v ${{ github.workspace }}/${{ env.COVERAGE_DIR }}:/package/${{ env.COVERAGE_DIR }}:rw \ + conductor-sdk-test:latest \ + /bin/sh -c "cd /package && COVERAGE_FILE=/package/${{ env.COVERAGE_DIR }}/.coverage.integration coverage run -m pytest -m v4 tests/integration -v" + - name: Generate coverage report id: coverage_report continue-on-error: true diff --git a/.gitignore b/.gitignore index f60b9c74..47ee4404 100644 --- a/.gitignore +++ b/.gitignore @@ -161,8 +161,6 @@ latest.txt *.so -codegen/ - .vscode/ tests/unit/automator/_trial_temp/_trial_marker tests/unit/automator/_trial_temp/_trial_marker diff --git a/README.md b/README.md index 8120b202..309ec357 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,10 @@ Show support for the Conductor OSS. Please help spread the awareness by starrin - [Example Unit Testing Application](#example-unit-testing-application) - [Workflow Deployments Using CI/CD](#workflow-deployments-using-cicd) - [Versioning Workflows](#versioning-workflows) +- [Development](#development) + - [Client Regeneration](#client-regeneration) + - [Sync Client Regeneration](#sync-client-regeneration) + - [Async Client Regeneration](#async-client-regeneration) @@ -929,3 +933,32 @@ A powerful feature of Conductor is the ability to version workflows. You should * Versioning allows safely testing changes by doing canary testing in production or A/B testing across multiple versions before rolling out. * A version can also be deleted, effectively allowing for "rollback" if required. + + +## Development + +### Client Regeneration + +When updating to a new Orkes version, you may need to regenerate the client code to support new APIs and features. The SDK provides comprehensive guides for regenerating both sync and async clients: + +#### Sync Client Regeneration + +For the synchronous client (`conductor.client`), see the [Client Regeneration Guide](src/conductor/client/CLIENT_REGENERATION_GUIDE.md) which covers: + +- Creating swagger.json files for new Orkes versions +- Generating client code using Swagger Codegen +- Replacing models and API clients in the codegen folder +- Creating adapters and updating the proxy package +- Running backward compatibility, serialization, and integration tests + +#### Async Client Regeneration + +For the asynchronous client (`conductor.asyncio_client`), see the [Async Client Regeneration Guide](src/conductor/asyncio_client/ASYNC_CLIENT_REGENERATION_GUIDE.md) which covers: + +- Creating swagger.json files for new Orkes versions +- Generating async client code using OpenAPI Generator +- Replacing models and API clients in the http folder +- Creating adapters for backward compatibility +- Running async-specific tests and handling breaking changes + +Both guides include detailed troubleshooting sections, best practices, and step-by-step instructions to ensure a smooth regeneration process while maintaining backward compatibility. diff --git a/docs/authorization/README.md b/docs/authorization/README.md index 3a9ef097..e72e5ca9 100644 --- a/docs/authorization/README.md +++ b/docs/authorization/README.md @@ -18,7 +18,7 @@ authorization_client = OrkesAuthorizationClient(configuration) Creates an application and returns a ConductorApplication object. ```python -from conductor.client.http.models.create_or_update_application_request import CreateOrUpdateApplicationRequest +from conductor.client.http.models import CreateOrUpdateApplicationRequest from conductor.client.orkes.orkes_authorization_client import OrkesAuthorizationClient from conductor.client.configuration.configuration import Configuration @@ -138,7 +138,7 @@ Creates or updates a user and returns a ConductorUser object. ```python from conductor.client.http.models.upsert_user_request import UpsertUserRequest -from conductor.client.http.models.conductor_user import ConductorUser +from conductor.client.http.models import ConductorUser user_id = 'test.user@company.com' user_name = "Test User" @@ -171,8 +171,7 @@ authorization_client.delete_user(user_id) Creates or updates a user group and returns a Group object. ```python -from conductor.client.http.models.upsert_group_request import UpsertGroupRequest -from conductor.client.http.models.group import Group +from conductor.client.http.models import UpsertGroupRequest, Group group_id = 'test_group' group_name = "Test Group" @@ -225,9 +224,8 @@ authorization_client.remove_user_from_group(group_id, user_id) Grants a set of accesses to the specified Subject for a given Target. ```python -from conductor.client.http.models.target_ref import TargetRef +from conductor.client.http.models import TargetRef, SubjectRef from conductor.shared.http.enums.target_type import TargetType -from conductor.client.http.models.subject_ref import SubjectRef from conductor.shared.http.enums.subject_type import SubjectType from conductor.client.orkes.models.access_type import AccessType @@ -247,7 +245,7 @@ Given the target, returns all permissions associated with it as a Dict[str, List In the returned dictionary, key is AccessType and value is a list of subjects. ```python -from conductor.client.http.models.target_ref import TargetRef +from conductor.client.http.models import TargetRef from conductor.shared.http.enums.target_type import TargetType target = TargetRef(TargetType.WORKFLOW_DEF, WORKFLOW_NAME) @@ -276,9 +274,8 @@ user_permissions = authorization_client.get_granted_permissions_for_user(user_id Removes a set of accesses from a specified Subject for a given Target. ```python -from conductor.client.http.models.target_ref import TargetRef +from conductor.client.http.models import TargetRef, SubjectRef from conductor.shared.http.enums.target_type import TargetType -from conductor.client.http.models.subject_ref import SubjectRef from conductor.shared.http.enums.subject_type import SubjectType from conductor.client.orkes.models.access_type import AccessType diff --git a/docs/metadata/README.md b/docs/metadata/README.md index 861cd65c..c84057d1 100644 --- a/docs/metadata/README.md +++ b/docs/metadata/README.md @@ -57,7 +57,7 @@ workflow.input_parameters(["a", "b"]) You should be able to register your workflow at the Conductor Server: ```python -from conductor.client.http.models.workflow_def import WorkflowDef +from conductor.client.http.models import WorkflowDef workflowDef = workflow.to_workflow_def() metadata_client.register_workflow_def(workflowDef, True) @@ -98,7 +98,7 @@ metadata_client.unregister_workflow_def('python_workflow_example_from_code', 1) You should be able to register your task at the Conductor Server: ```python -from conductor.client.http.models.task_def import TaskDef +from conductor.client.http.models import TaskDef taskDef = TaskDef( name="PYTHON_TASK", diff --git a/docs/schedule/README.md b/docs/schedule/README.md index c7187e97..e7fe579c 100644 --- a/docs/schedule/README.md +++ b/docs/schedule/README.md @@ -21,8 +21,7 @@ scheduler_client = OrkesSchedulerClient(configuration) ### Saving Schedule ```python -from conductor.client.http.models.save_schedule_request import SaveScheduleRequest -from conductor.client.http.models.start_workflow_request import StartWorkflowRequest +from conductor.client.http.models import SaveScheduleRequest, StartWorkflowRequest startWorkflowRequest = StartWorkflowRequest( name="WORKFLOW_NAME", workflow_def=workflowDef diff --git a/docs/testing/README.md b/docs/testing/README.md index 5df19d58..7283de97 100644 --- a/docs/testing/README.md +++ b/docs/testing/README.md @@ -16,7 +16,7 @@ A sample unit test code snippet is provided below. import json from conductor.shared.configuration.settings.authentication_settings import AuthenticationSettings from conductor.client.configuration.configuration import Configuration -from conductor.client.http.models.workflow_test_request import WorkflowTestRequest +from conductor.client.http.models import WorkflowTestRequest from conductor.client.orkes.orkes_workflow_client import OrkesWorkflowClient TEST_WF_JSON_PATH = 'tests/integration/resources/test_data/calculate_loan_workflow.json' diff --git a/docs/worker/README.md b/docs/worker/README.md index 733ba640..b8ce84c5 100644 --- a/docs/worker/README.md +++ b/docs/worker/README.md @@ -347,8 +347,7 @@ See [simple_cpp_lib.cpp](src/example/worker/cpp/simple_cpp_lib.cpp) and [simple_cpp_worker.py](src/example/worker/cpp/simple_cpp_worker.py) for complete working example. ```python -from conductor.client.http.models.task import Task -from conductor.client.http.models.task_result import TaskResult +from conductor.client.http.models import Task, TaskResult from conductor.shared.http.enums import TaskResultStatus from conductor.client.worker.worker_interface import WorkerInterface from ctypes import cdll diff --git a/examples/async/dynamic_workflow.py b/examples/async/dynamic_workflow.py index 3f00cf44..79c735a9 100644 --- a/examples/async/dynamic_workflow.py +++ b/examples/async/dynamic_workflow.py @@ -7,9 +7,9 @@ import asyncio +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.worker.worker_task import worker_task from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow @@ -31,6 +31,7 @@ async def main(): # CONDUCTOR_AUTH_KEY : API Authentication Key # CONDUCTOR_AUTH_SECRET: API Auth Secret api_config = Configuration() + api_config.apply_logging_config() task_handler = TaskHandler(configuration=api_config) task_handler.start_processes() diff --git a/examples/async/helloworld/helloworld.py b/examples/async/helloworld/helloworld.py index b3ee61c8..2a34c829 100644 --- a/examples/async/helloworld/helloworld.py +++ b/examples/async/helloworld/helloworld.py @@ -2,9 +2,9 @@ from greetings_workflow import greetings_workflow +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow from conductor.asyncio_client.workflow.executor.workflow_executor import ( AsyncWorkflowExecutor, @@ -22,6 +22,7 @@ async def register_workflow( async def main(): # points to http://localhost:8080/api by default api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: workflow_executor = AsyncWorkflowExecutor( configuration=api_config, api_client=api_client diff --git a/examples/async/kitchensink.py b/examples/async/kitchensink.py index 30b8fbb4..77c24d13 100644 --- a/examples/async/kitchensink.py +++ b/examples/async/kitchensink.py @@ -1,8 +1,8 @@ import asyncio +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.worker.worker_task import worker_task from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow @@ -33,6 +33,7 @@ def start_workers(api_config): async def main(): api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: clients = OrkesClients(api_client=api_client, configuration=api_config) diff --git a/examples/async/orkes/copilot/open_ai_copilot.py b/examples/async/orkes/copilot/open_ai_copilot.py index f9592a50..29931cd1 100644 --- a/examples/async/orkes/copilot/open_ai_copilot.py +++ b/examples/async/orkes/copilot/open_ai_copilot.py @@ -5,11 +5,11 @@ from dataclasses import dataclass from typing import Dict, List +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.adapters.models import ExtendedTaskDef, TaskResult from conductor.asyncio_client.ai.orchestrator import AsyncAIOrchestrator from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.http.models.workflow_state_update import ( WorkflowStateUpdate, ) @@ -115,6 +115,7 @@ async def main(): llm_provider = "openai" chat_complete_model = "gpt-5" api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: clients = OrkesClients(api_client=api_client, configuration=api_config) diff --git a/examples/async/orkes/fork_join_script.py b/examples/async/orkes/fork_join_script.py index 8015306d..8e59d850 100644 --- a/examples/async/orkes/fork_join_script.py +++ b/examples/async/orkes/fork_join_script.py @@ -1,7 +1,7 @@ import asyncio -from conductor.asyncio_client.configuration import Configuration from conductor.asyncio_client.adapters import ApiClient +from conductor.asyncio_client.configuration import Configuration from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow from conductor.asyncio_client.workflow.task.fork_task import ForkTask @@ -13,6 +13,7 @@ async def main(): api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: clients = OrkesClients(configuration=api_config, api_client=api_client) executor = clients.get_workflow_executor() diff --git a/examples/async/orkes/http_poll.py b/examples/async/orkes/http_poll.py index dbae713c..f71d597b 100644 --- a/examples/async/orkes/http_poll.py +++ b/examples/async/orkes/http_poll.py @@ -1,8 +1,8 @@ import asyncio import uuid -from conductor.asyncio_client.configuration import Configuration from conductor.asyncio_client.adapters import ApiClient +from conductor.asyncio_client.configuration import Configuration from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow from conductor.asyncio_client.workflow.task.http_poll_task import HttpPollTask @@ -11,6 +11,7 @@ async def main(): configuration = Configuration() + configuration.apply_logging_config() async with ApiClient(configuration) as api_client: workflow_executor = OrkesClients(api_client).get_workflow_executor() workflow = AsyncConductorWorkflow( diff --git a/examples/async/orkes/multiagent_chat.py b/examples/async/orkes/multiagent_chat.py index 194fc639..e2854c20 100644 --- a/examples/async/orkes/multiagent_chat.py +++ b/examples/async/orkes/multiagent_chat.py @@ -1,8 +1,8 @@ import asyncio +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.ai.orchestrator import AsyncAIOrchestrator from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow from conductor.asyncio_client.workflow.task.do_while_task import LoopTask @@ -27,6 +27,7 @@ async def main(): moderator_model = "command-r" api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: clients = OrkesClients(configuration=api_config, api_client=api_client) workflow_executor = clients.get_workflow_executor() diff --git a/examples/async/orkes/open_ai_chat_gpt.py b/examples/async/orkes/open_ai_chat_gpt.py index dbd8cec9..04f793ac 100644 --- a/examples/async/orkes/open_ai_chat_gpt.py +++ b/examples/async/orkes/open_ai_chat_gpt.py @@ -3,10 +3,10 @@ from workers.chat_workers import collect_history +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.ai.orchestrator import AsyncAIOrchestrator from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow from conductor.asyncio_client.workflow.task.do_while_task import LoopTask @@ -54,6 +54,7 @@ async def main(): chat_complete_model = "gpt-5" api_config = Configuration() + api_config.apply_logging_config() task_handler = start_workers(api_config=api_config) async with ApiClient(api_config) as api_client: clients = OrkesClients(configuration=api_config, api_client=api_client) diff --git a/examples/async/orkes/open_ai_function_example.py b/examples/async/orkes/open_ai_function_example.py index 9b282af8..5b86fce8 100644 --- a/examples/async/orkes/open_ai_function_example.py +++ b/examples/async/orkes/open_ai_function_example.py @@ -2,11 +2,11 @@ from workers.chat_workers import collect_history +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.adapters.models import ExtendedTaskDef from conductor.asyncio_client.ai.orchestrator import AsyncAIOrchestrator from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.worker.worker_task import worker_task from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow @@ -45,6 +45,7 @@ async def main(): chat_complete_model = "gpt-5" api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: clients = OrkesClients(configuration=api_config, api_client=api_client) workflow_executor = clients.get_workflow_executor() diff --git a/examples/async/orkes/open_ai_helloworld.py b/examples/async/orkes/open_ai_helloworld.py index c13df705..01a21ecf 100644 --- a/examples/async/orkes/open_ai_helloworld.py +++ b/examples/async/orkes/open_ai_helloworld.py @@ -1,9 +1,9 @@ import asyncio +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.ai.orchestrator import AsyncAIOrchestrator from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.worker.worker_task import worker_task from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow from conductor.asyncio_client.workflow.task.llm_tasks.llm_text_complete import ( @@ -34,6 +34,7 @@ async def main(): embedding_complete_model = "text-embedding-ada-002" api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: task_workers = start_workers(api_config) diff --git a/examples/async/orkes/sync_updates.py b/examples/async/orkes/sync_updates.py index 6ea04250..b54eba5d 100644 --- a/examples/async/orkes/sync_updates.py +++ b/examples/async/orkes/sync_updates.py @@ -1,8 +1,8 @@ import asyncio +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.adapters.models import TaskResult, WorkflowStateUpdate from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow from conductor.asyncio_client.workflow.task.http_task import HttpInput, HttpTask @@ -38,6 +38,7 @@ def create_workflow(clients: OrkesClients) -> AsyncConductorWorkflow: async def main(): api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: clients = OrkesClients(configuration=api_config, api_client=api_client) workflow_client = clients.get_workflow_client() diff --git a/examples/async/orkes/task_status_change_audit.py b/examples/async/orkes/task_status_change_audit.py index cafca1cc..0f10b81c 100644 --- a/examples/async/orkes/task_status_change_audit.py +++ b/examples/async/orkes/task_status_change_audit.py @@ -1,5 +1,6 @@ import asyncio +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.adapters.models import ( ExtendedWorkflowDef, StartWorkflowRequest, @@ -11,7 +12,6 @@ ) from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.worker.worker_task import worker_task from conductor.shared.http.enums import TaskResultStatus @@ -39,7 +39,7 @@ def simple_task_2(task: Task) -> TaskResult: async def main(): api_config = Configuration() - + api_config.apply_logging_config() task_handler = TaskHandler( workers=[], configuration=api_config, diff --git a/examples/async/orkes/vector_db_helloworld.py b/examples/async/orkes/vector_db_helloworld.py index cb18ed66..7559430c 100644 --- a/examples/async/orkes/vector_db_helloworld.py +++ b/examples/async/orkes/vector_db_helloworld.py @@ -1,9 +1,9 @@ import asyncio +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.ai.orchestrator import AsyncAIOrchestrator from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.worker.worker_task import worker_task from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow @@ -44,6 +44,7 @@ async def main(): chat_complete_model = "gpt-5" api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: clients = OrkesClients(configuration=api_config, api_client=api_client) workflow_executor = clients.get_workflow_executor() diff --git a/examples/async/orkes/wait_for_webhook.py b/examples/async/orkes/wait_for_webhook.py index 623a7d71..2eb518b8 100644 --- a/examples/async/orkes/wait_for_webhook.py +++ b/examples/async/orkes/wait_for_webhook.py @@ -1,10 +1,10 @@ import asyncio import uuid +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.adapters.models import StartWorkflowRequest from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.worker.worker_task import worker_task from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow @@ -25,7 +25,7 @@ def send_email(email: str, subject: str, body: str): async def main(): api_config = Configuration() - + api_config.apply_logging_config() task_handler = TaskHandler( workers=[], configuration=api_config, diff --git a/examples/async/orkes/workflow_rerun.py b/examples/async/orkes/workflow_rerun.py index 0d775d88..b5f05193 100644 --- a/examples/async/orkes/workflow_rerun.py +++ b/examples/async/orkes/workflow_rerun.py @@ -2,6 +2,7 @@ import json import uuid +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.adapters.models import ( ExtendedWorkflowDef, RerunWorkflowRequest, @@ -11,7 +12,6 @@ WorkflowStateUpdate, ) from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.orkes.orkes_workflow_client import OrkesWorkflowClient from conductor.shared.http.enums import TaskResultStatus @@ -38,7 +38,7 @@ async def start_workflow(workflow_client: OrkesWorkflowClient) -> WorkflowRun: async def main(): api_config = Configuration() - + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: clients = OrkesClients(configuration=api_config, api_client=api_client) workflow_client = clients.get_workflow_client() diff --git a/examples/async/shell_worker.py b/examples/async/shell_worker.py index b202ceb3..ec31b66a 100644 --- a/examples/async/shell_worker.py +++ b/examples/async/shell_worker.py @@ -1,9 +1,9 @@ import asyncio from typing import Dict +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.worker.worker_task import worker_task from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow @@ -87,6 +87,7 @@ async def main(): # CONDUCTOR_AUTH_KEY : API Authentication Key # CONDUCTOR_AUTH_SECRET: API Auth Secret api_config = Configuration() + api_config.apply_logging_config() print("Starting async shell worker...") task_handler = TaskHandler( diff --git a/examples/async/task_configure.py b/examples/async/task_configure.py index 99247de5..048d7141 100644 --- a/examples/async/task_configure.py +++ b/examples/async/task_configure.py @@ -1,13 +1,14 @@ import asyncio +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.adapters.models import ExtendedTaskDef from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients async def main(): api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: clients = OrkesClients(api_client=api_client, configuration=api_config) diff --git a/examples/async/task_worker.py b/examples/async/task_worker.py index df678186..c2654117 100644 --- a/examples/async/task_worker.py +++ b/examples/async/task_worker.py @@ -3,10 +3,10 @@ from dataclasses import dataclass from random import randint +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.adapters.models import Task, TaskResult from conductor.asyncio_client.automator.task_handler import TaskHandler from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.worker.worker_task import worker_task from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow @@ -144,6 +144,7 @@ async def main(): # CONDUCTOR_AUTH_KEY : API Authentication Key # CONDUCTOR_AUTH_SECRET: API Auth Secret api_config = Configuration() + api_config.apply_logging_config() task_handler = TaskHandler(configuration=api_config) task_handler.start_processes() diff --git a/examples/async/workflow_ops.py b/examples/async/workflow_ops.py index ea38e590..265124d5 100644 --- a/examples/async/workflow_ops.py +++ b/examples/async/workflow_ops.py @@ -1,6 +1,7 @@ import asyncio import uuid +from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.adapters.models import ( ExtendedTaskDef, RerunWorkflowRequest, @@ -8,7 +9,6 @@ TaskResult, ) from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.orkes.orkes_metadata_client import OrkesMetadataClient from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow @@ -66,6 +66,7 @@ async def start_workflow(workflow_executor: AsyncWorkflowExecutor) -> str: async def main(): api_config = Configuration() + api_config.apply_logging_config() async with ApiClient(api_config) as api_client: clients = OrkesClients(api_client=api_client, configuration=api_config) diff --git a/examples/async/workflow_status_listner.py b/examples/async/workflow_status_listner.py index 7b0641e8..031db5e8 100644 --- a/examples/async/workflow_status_listner.py +++ b/examples/async/workflow_status_listner.py @@ -1,7 +1,7 @@ import asyncio -from conductor.asyncio_client.configuration.configuration import Configuration from conductor.asyncio_client.adapters import ApiClient +from conductor.asyncio_client.configuration.configuration import Configuration from conductor.asyncio_client.orkes.orkes_clients import OrkesClients from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow from conductor.asyncio_client.workflow.task.http_task import HttpTask @@ -9,6 +9,8 @@ async def main(): api_config = Configuration() + api_config.apply_logging_config() + async with ApiClient(api_config) as api_client: clients = OrkesClients(api_client=api_client, configuration=api_config) diff --git a/examples/dynamic_workflow.py b/examples/dynamic_workflow.py index 15cb9b44..ccc43c80 100644 --- a/examples/dynamic_workflow.py +++ b/examples/dynamic_workflow.py @@ -6,7 +6,7 @@ """ from conductor.client.automator.task_handler import TaskHandler from conductor.client.configuration.configuration import Configuration -from conductor.client.http.models.start_workflow_request import IdempotencyStrategy +from conductor.shared.http.enums import IdempotencyStrategy from conductor.client.orkes_clients import OrkesClients from conductor.client.worker.worker_task import worker_task from conductor.client.workflow.conductor_workflow import ConductorWorkflow @@ -28,6 +28,7 @@ def main(): # CONDUCTOR_AUTH_KEY : API Authentication Key # CONDUCTOR_AUTH_SECRET: API Auth Secret api_config = Configuration() + api_config.apply_logging_config() task_handler = TaskHandler(configuration=api_config) task_handler.start_processes() diff --git a/examples/helloworld/helloworld.py b/examples/helloworld/helloworld.py index 423dd249..080191f7 100644 --- a/examples/helloworld/helloworld.py +++ b/examples/helloworld/helloworld.py @@ -14,6 +14,7 @@ def register_workflow(workflow_executor: WorkflowExecutor) -> ConductorWorkflow: def main(): # points to http://localhost:8080/api by default api_config = Configuration() + api_config.apply_logging_config() workflow_executor = WorkflowExecutor(configuration=api_config) diff --git a/examples/kitchensink.py b/examples/kitchensink.py index c2d959ee..2fe7a636 100644 --- a/examples/kitchensink.py +++ b/examples/kitchensink.py @@ -29,6 +29,7 @@ def start_workers(api_config): def main(): api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) workflow_executor = clients.get_workflow_executor() diff --git a/examples/orkes/copilot/open_ai_copilot.py b/examples/orkes/copilot/open_ai_copilot.py index fcc67a28..746896c0 100644 --- a/examples/orkes/copilot/open_ai_copilot.py +++ b/examples/orkes/copilot/open_ai_copilot.py @@ -15,7 +15,10 @@ from conductor.client.workflow.conductor_workflow import ConductorWorkflow from conductor.client.workflow.task.dynamic_task import DynamicTask from conductor.client.workflow.task.human_task import HumanTask -from conductor.client.workflow.task.llm_tasks.llm_chat_complete import LlmChatComplete, ChatMessage +from conductor.client.workflow.task.llm_tasks.llm_chat_complete import ( + LlmChatComplete, + ChatMessage, +) from conductor.client.workflow.task.simple_task import SimpleTask from conductor.client.workflow.task.sub_workflow_task import SubWorkflowTask from conductor.client.workflow.task.switch_task import SwitchTask @@ -34,48 +37,53 @@ def start_workers(api_config): return task_handler -@worker_task(task_definition_name='get_customer_list') +@worker_task(task_definition_name="get_customer_list") def get_customer_list() -> List[Customer]: customers = [] for i in range(100): - customer_name = ''.join(random.choices(string.ascii_uppercase + - string.digits, k=5)) + customer_name = "".join( + random.choices(string.ascii_uppercase + string.digits, k=5) + ) spend = random.randint(a=100000, b=9000000) customers.append( - Customer(id=i, name='Customer ' + customer_name, - annual_spend=spend, - country='US') + Customer( + id=i, name="Customer " + customer_name, annual_spend=spend, country="US" + ) ) return customers -@worker_task(task_definition_name='get_top_n') +@worker_task(task_definition_name="get_top_n") def get_top_n_customers(n: int, customers: List[Customer]) -> List[Customer]: customers.sort(key=lambda x: x.annual_spend, reverse=True) end = min(n + 1, len(customers)) - return customers[1: end] + return customers[1:end] -@worker_task(task_definition_name='generate_promo_code') +@worker_task(task_definition_name="generate_promo_code") def get_top_n_customers() -> str: - res = ''.join(random.choices(string.ascii_uppercase + - string.digits, k=5)) + res = "".join(random.choices(string.ascii_uppercase + string.digits, k=5)) return res -@worker_task(task_definition_name='send_email') +@worker_task(task_definition_name="send_email") def send_email(customer: list[Customer], promo_code: str) -> str: - return f'Sent {promo_code} to {len(customer)} customers' + return f"Sent {promo_code} to {len(customer)} customers" -@worker_task(task_definition_name='create_workflow') +@worker_task(task_definition_name="create_workflow") def create_workflow(steps: list[str], inputs: Dict[str, object]) -> dict: executor = OrkesClients().get_workflow_executor() - workflow = ConductorWorkflow(executor=executor, name='copilot_execution', version=1) + workflow = ConductorWorkflow(executor=executor, name="copilot_execution", version=1) for step in steps: - if step == 'review': - task = HumanTask(task_ref_name='review', display_name='review email', form_version=0, form_template='email_review') + if step == "review": + task = HumanTask( + task_ref_name="review", + display_name="review email", + form_version=0, + form_template="email_review", + ) task.input_parameters.update(inputs[step]) workflow >> task else: @@ -84,14 +92,15 @@ def create_workflow(steps: list[str], inputs: Dict[str, object]) -> dict: workflow >> task workflow.register(overwrite=True) - print(f'\n\n\nRegistered workflow by name {workflow.name}\n') + print(f"\n\n\nRegistered workflow by name {workflow.name}\n") return workflow.to_workflow_def().toJSON() def main(): - llm_provider = 'openai_saas' - chat_complete_model = 'gpt-4' + llm_provider = "openai_saas" + chat_complete_model = "gpt-4" api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) workflow_executor = clients.get_workflow_executor() metadata_client = clients.get_metadata_client() @@ -99,11 +108,11 @@ def main(): task_handler = start_workers(api_config=api_config) # register our two tasks - metadata_client.register_task_def(task_def=TaskDef(name='get_weather')) - metadata_client.register_task_def(task_def=TaskDef(name='get_price_from_amazon')) + metadata_client.register_task_def(task_def=TaskDef(name="get_weather")) + metadata_client.register_task_def(task_def=TaskDef(name="get_price_from_amazon")) # Define and associate prompt with the AI integration - prompt_name = 'chat_function_instructions' + prompt_name = "chat_function_instructions" prompt_text = """ You are a helpful assistant that can answer questions using tools provided. You have the following tools specified as functions in python: @@ -150,47 +159,72 @@ def main(): # description='openai config', # config=open_ai_config) - orchestrator.add_prompt_template(prompt_name, prompt_text, 'chat instructions') + orchestrator.add_prompt_template(prompt_name, prompt_text, "chat instructions") # associate the prompts - orchestrator.associate_prompt_template(prompt_name, llm_provider, [chat_complete_model]) + orchestrator.associate_prompt_template( + prompt_name, llm_provider, [chat_complete_model] + ) - wf = ConductorWorkflow(name='my_function_chatbot', version=1, executor=workflow_executor) + wf = ConductorWorkflow( + name="my_function_chatbot", version=1, executor=workflow_executor + ) - user_input = WaitTask(task_ref_name='get_user_input') + user_input = WaitTask(task_ref_name="get_user_input") - chat_complete = LlmChatComplete(task_ref_name='chat_complete_ref', - llm_provider=llm_provider, model=chat_complete_model, - instructions_template=prompt_name, - messages=[ - ChatMessage(role='user', - message=user_input.output('query')) - ], - max_tokens=2048) + chat_complete = LlmChatComplete( + task_ref_name="chat_complete_ref", + llm_provider=llm_provider, + model=chat_complete_model, + instructions_template=prompt_name, + messages=[ChatMessage(role="user", message=user_input.output("query"))], + max_tokens=2048, + ) - function_call = DynamicTask(task_reference_name='fn_call_ref', dynamic_task='SUB_WORKFLOW') - function_call.input_parameters['steps'] = chat_complete.output('function_parameters.steps') - function_call.input_parameters['inputs'] = chat_complete.output('function_parameters.inputs') - function_call.input_parameters['subWorkflowName'] = 'copilot_execution' - function_call.input_parameters['subWorkflowVersion'] = 1 + function_call = DynamicTask( + task_reference_name="fn_call_ref", dynamic_task="SUB_WORKFLOW" + ) + function_call.input_parameters["steps"] = chat_complete.output( + "function_parameters.steps" + ) + function_call.input_parameters["inputs"] = chat_complete.output( + "function_parameters.inputs" + ) + function_call.input_parameters["subWorkflowName"] = "copilot_execution" + function_call.input_parameters["subWorkflowVersion"] = 1 - sub_workflow = SubWorkflowTask(task_ref_name='execute_workflow', workflow_name='copilot_execution', version=1) + sub_workflow = SubWorkflowTask( + task_ref_name="execute_workflow", workflow_name="copilot_execution", version=1 + ) - create = create_workflow(task_ref_name='create_workflow', steps=chat_complete.output('result.function_parameters.steps'), - inputs=chat_complete.output('result.function_parameters.inputs')) - call_function = SwitchTask(task_ref_name='to_call_or_not', case_expression=chat_complete.output('result.function')) - call_function.switch_case('create_workflow', [create, sub_workflow]) + create = create_workflow( + task_ref_name="create_workflow", + steps=chat_complete.output("result.function_parameters.steps"), + inputs=chat_complete.output("result.function_parameters.inputs"), + ) + call_function = SwitchTask( + task_ref_name="to_call_or_not", + case_expression=chat_complete.output("result.function"), + ) + call_function.switch_case("create_workflow", [create, sub_workflow]) - call_one_fun = DynamicTask(task_reference_name='call_one_fun_ref', dynamic_task=chat_complete.output('result.function')) - call_one_fun.input_parameters['inputs'] = chat_complete.output('result.function_parameters') - call_one_fun.input_parameters['dynamicTaskInputParam'] = 'inputs' + call_one_fun = DynamicTask( + task_reference_name="call_one_fun_ref", + dynamic_task=chat_complete.output("result.function"), + ) + call_one_fun.input_parameters["inputs"] = chat_complete.output( + "result.function_parameters" + ) + call_one_fun.input_parameters["dynamicTaskInputParam"] = "inputs" call_function.default_case([call_one_fun]) wf >> user_input >> chat_complete >> call_function # let's make sure we don't run it for more than 2 minutes -- avoid runaway loops - wf.timeout_seconds(120).timeout_policy(timeout_policy=TimeoutPolicy.TIME_OUT_WORKFLOW) + wf.timeout_seconds(120).timeout_policy( + timeout_policy=TimeoutPolicy.TIME_OUT_WORKFLOW + ) message = """ I am a helpful bot that can help with your customer management. @@ -201,34 +235,46 @@ def main(): 3. Get the list of top N customers and send them a promo code """ print(message) - workflow_run = wf.execute(wait_until_task_ref=user_input.task_reference_name, wait_for_seconds=120) + workflow_run = wf.execute( + wait_until_task_ref=user_input.task_reference_name, wait_for_seconds=120 + ) workflow_id = workflow_run.workflow_id - query = input('>> ') - input_task = workflow_run.get_task(task_reference_name=user_input.task_reference_name) - workflow_run = workflow_client.update_state(workflow_id=workflow_id, - update_requesst=WorkflowStateUpdate( - task_reference_name=user_input.task_reference_name, - task_result=TaskResult(task_id=input_task.task_id, output_data={ - 'query': query - }, status=TaskResultStatus.COMPLETED) - ), - wait_for_seconds=30) + query = input(">> ") + input_task = workflow_run.get_task( + task_reference_name=user_input.task_reference_name + ) + workflow_run = workflow_client.update_state( + workflow_id=workflow_id, + update_requesst=WorkflowStateUpdate( + task_reference_name=user_input.task_reference_name, + task_result=TaskResult( + task_id=input_task.task_id, + output_data={"query": query}, + status=TaskResultStatus.COMPLETED, + ), + ), + wait_for_seconds=30, + ) task_handler.stop_processes() - output = json.dumps(workflow_run.output['result'], indent=3) - print(f""" + output = json.dumps(workflow_run.output["result"], indent=3) + print( + f""" {output} - """) + """ + ) - print(f""" + print( + f""" See the complete execution graph here: http://localhost:5001/execution/{workflow_id} - """) + """ + ) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/examples/orkes/fork_join_script.py b/examples/orkes/fork_join_script.py index a12b8af5..56fa97ad 100644 --- a/examples/orkes/fork_join_script.py +++ b/examples/orkes/fork_join_script.py @@ -8,6 +8,7 @@ def main(): api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) workflow_client = clients.get_workflow_client() executor = clients.get_workflow_executor() diff --git a/examples/orkes/http_poll.py b/examples/orkes/http_poll.py index 83dfd921..c55cc18c 100644 --- a/examples/orkes/http_poll.py +++ b/examples/orkes/http_poll.py @@ -1,11 +1,15 @@ import uuid +from conductor.client.configuration.configuration import Configuration from conductor.client.orkes_clients import OrkesClients from conductor.client.workflow.conductor_workflow import ConductorWorkflow from conductor.client.workflow.task.http_poll_task import HttpPollTask, HttpPollInput def main(): + api_config = Configuration() + api_config.apply_logging_config() + workflow_executor = OrkesClients().get_workflow_executor() workflow = ConductorWorkflow(executor=workflow_executor, name='http_poll_example_' + str(uuid.uuid4())) http_poll = HttpPollTask(task_ref_name='http_poll_ref', diff --git a/examples/orkes/multiagent_chat.py b/examples/orkes/multiagent_chat.py index 41714a1a..46806207 100644 --- a/examples/orkes/multiagent_chat.py +++ b/examples/orkes/multiagent_chat.py @@ -34,6 +34,7 @@ def main(): mistral_model = 'mistral-large-latest' api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) workflow_executor = clients.get_workflow_executor() diff --git a/examples/orkes/open_ai_chat_gpt.py b/examples/orkes/open_ai_chat_gpt.py index 0de755ba..590db49f 100644 --- a/examples/orkes/open_ai_chat_gpt.py +++ b/examples/orkes/open_ai_chat_gpt.py @@ -2,12 +2,12 @@ import os import time -from conductor.client.ai.configuration import LLMProvider -from conductor.client.ai.integrations import OpenAIConfig +from conductor.shared.ai.enums import LLMProvider +from conductor.shared.ai.configuration import OpenAIConfig from conductor.client.ai.orchestrator import AIOrchestrator from conductor.client.automator.task_handler import TaskHandler from conductor.client.configuration.configuration import Configuration -from conductor.client.http.models.workflow_run import terminal_status +from conductor.client.adapters.models.workflow_run_adapter import terminal_status from conductor.client.orkes_clients import OrkesClients from conductor.client.workflow.conductor_workflow import ConductorWorkflow from conductor.client.workflow.task.do_while_task import LoopTask diff --git a/examples/orkes/open_ai_chat_user_input.py b/examples/orkes/open_ai_chat_user_input.py index 29119bb1..9fe4bf0f 100644 --- a/examples/orkes/open_ai_chat_user_input.py +++ b/examples/orkes/open_ai_chat_user_input.py @@ -33,6 +33,7 @@ def main(): text_complete_model = 'text-davinci-003' api_config = Configuration() + api_config.apply_logging_config() api_config.apply_logging_config(level=logging.INFO) clients = OrkesClients(configuration=api_config) workflow_executor = clients.get_workflow_executor() diff --git a/examples/orkes/open_ai_function_example.py b/examples/orkes/open_ai_function_example.py index f318ba61..c2324313 100644 --- a/examples/orkes/open_ai_function_example.py +++ b/examples/orkes/open_ai_function_example.py @@ -42,6 +42,7 @@ def main(): chat_complete_model = 'gpt-4' api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) workflow_executor = clients.get_workflow_executor() workflow_client = clients.get_workflow_client() diff --git a/examples/orkes/open_ai_helloworld.py b/examples/orkes/open_ai_helloworld.py index 43bd0ac6..35334c45 100644 --- a/examples/orkes/open_ai_helloworld.py +++ b/examples/orkes/open_ai_helloworld.py @@ -35,6 +35,7 @@ def main(): embedding_complete_model = 'text-embedding-ada-002' api_config = Configuration() + api_config.apply_logging_config() task_workers = start_workers(api_config) open_ai_config = OpenAIConfig() diff --git a/examples/orkes/sync_updates.py b/examples/orkes/sync_updates.py index 4e74bc59..fa929c92 100644 --- a/examples/orkes/sync_updates.py +++ b/examples/orkes/sync_updates.py @@ -27,6 +27,7 @@ def create_workflow(clients: OrkesClients) -> ConductorWorkflow: def main(): api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) workflow_client = clients.get_workflow_client() diff --git a/examples/orkes/task_status_change_audit.py b/examples/orkes/task_status_change_audit.py index 6bf2c8f3..c552fb8b 100644 --- a/examples/orkes/task_status_change_audit.py +++ b/examples/orkes/task_status_change_audit.py @@ -1,7 +1,7 @@ from conductor.client.automator.task_handler import TaskHandler from conductor.client.configuration.configuration import Configuration from conductor.client.http.models import WorkflowDef, WorkflowTask, Task, StartWorkflowRequest, TaskDef, TaskResult -from conductor.client.http.models.state_change_event import StateChangeConfig, StateChangeEventType, StateChangeEvent +from conductor.client.http.models.state_change_event import StateChangeEventAdapter as StateChangeEvent, StateChangeEventType, StateChangeConfig from conductor.shared.http.enums import TaskResultStatus from conductor.client.orkes_clients import OrkesClients from conductor.client.worker.worker_task import worker_task @@ -24,6 +24,7 @@ def simple_task_2(task: Task) -> TaskResult: def main(): api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients() metadata_client = clients.get_metadata_client() workflow_client = clients.get_workflow_client() diff --git a/examples/orkes/vector_db_helloworld.py b/examples/orkes/vector_db_helloworld.py index 3555cfff..22f43401 100644 --- a/examples/orkes/vector_db_helloworld.py +++ b/examples/orkes/vector_db_helloworld.py @@ -1,7 +1,7 @@ import os -from conductor.client.ai.configuration import VectorDB -from conductor.client.ai.integrations import OpenAIConfig, PineconeConfig +from conductor.shared.ai.enums import VectorDB +from conductor.shared.ai.configuration import OpenAIConfig, PineconeConfig from conductor.client.ai.orchestrator import AIOrchestrator from conductor.client.automator.task_handler import TaskHandler from conductor.client.configuration.configuration import Configuration @@ -45,6 +45,7 @@ def main(): chat_complete_model = 'gpt-4' api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) workflow_executor = clients.get_workflow_executor() workflow_client = clients.get_workflow_client() diff --git a/examples/orkes/wait_for_webhook.py b/examples/orkes/wait_for_webhook.py index 3604af92..fcdd1ecf 100644 --- a/examples/orkes/wait_for_webhook.py +++ b/examples/orkes/wait_for_webhook.py @@ -19,6 +19,7 @@ def send_email(email: str, subject: str, body: str): def main(): api_config = Configuration() + api_config.apply_logging_config() task_handler = TaskHandler( workers=[], diff --git a/examples/orkes/workflow_rerun.py b/examples/orkes/workflow_rerun.py index bce50a19..db03d204 100644 --- a/examples/orkes/workflow_rerun.py +++ b/examples/orkes/workflow_rerun.py @@ -30,6 +30,7 @@ def start_workflow(workflow_client: WorkflowClient) -> WorkflowRun: def main(): api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) workflow_client = clients.get_workflow_client() diff --git a/examples/shell_worker.py b/examples/shell_worker.py index 24b122f7..828b61f1 100644 --- a/examples/shell_worker.py +++ b/examples/shell_worker.py @@ -24,6 +24,7 @@ def main(): # CONDUCTOR_AUTH_KEY : API Authentication Key # CONDUCTOR_AUTH_SECRET: API Auth Secret api_config = Configuration() + api_config.apply_logging_config() task_handler = TaskHandler(configuration=api_config) diff --git a/examples/task_configure.py b/examples/task_configure.py index 76cd9f0b..63804b74 100644 --- a/examples/task_configure.py +++ b/examples/task_configure.py @@ -5,6 +5,7 @@ def main(): api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) metadata_client = clients.get_metadata_client() diff --git a/examples/workflow_ops.py b/examples/workflow_ops.py index 9cb2935c..ccc96942 100644 --- a/examples/workflow_ops.py +++ b/examples/workflow_ops.py @@ -24,6 +24,7 @@ def start_workflow(workflow_executor: WorkflowExecutor) -> str: def main(): api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) workflow_client = clients.get_workflow_client() task_client = clients.get_task_client() diff --git a/examples/workflow_status_listner.py b/examples/workflow_status_listner.py index 9c95c9f7..68b0207d 100644 --- a/examples/workflow_status_listner.py +++ b/examples/workflow_status_listner.py @@ -12,6 +12,7 @@ def main(): api_config = Configuration() + api_config.apply_logging_config() clients = OrkesClients(configuration=api_config) workflow = ConductorWorkflow(name='workflow_status_listener_demo', version=1, diff --git a/poetry.lock b/poetry.lock index 3cea2012..45da22e1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -164,6 +164,27 @@ files = [ {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, ] +[[package]] +name = "anyio" +version = "4.10.0" +description = "High-level concurrency and networking framework on top of asyncio or Trio" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "anyio-4.10.0-py3-none-any.whl", hash = "sha256:60e474ac86736bbfd6f210f7a61218939c318f43f9972497381f1c5e930ed3d1"}, + {file = "anyio-4.10.0.tar.gz", hash = "sha256:3f3fae35c96039744587aa5b8371e7e8e603c0702999535961dd336026973ba6"}, +] + +[package.dependencies] +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +idna = ">=2.8" +sniffio = ">=1.1" +typing_extensions = {version = ">=4.5", markers = "python_version < \"3.13\""} + +[package.extras] +trio = ["trio (>=0.26.1)"] + [[package]] name = "astor" version = "0.8.1" @@ -526,7 +547,7 @@ version = "1.3.0" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" -groups = ["dev"] +groups = ["main", "dev"] markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"}, @@ -670,6 +691,65 @@ files = [ {file = "frozenlist-1.7.0.tar.gz", hash = "sha256:2e310d81923c2437ea8670467121cc3e9b0f76d3043cc1d2331d56c7fb7a3a8f"}, ] +[[package]] +name = "h11" +version = "0.16.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, + {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, + {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.16" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<1.0)"] + +[[package]] +name = "httpx" +version = "0.28.1" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, + {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" + +[package.extras] +brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + [[package]] name = "identify" version = "2.6.12" @@ -1498,6 +1578,18 @@ files = [ {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, ] +[[package]] +name = "sniffio" +version = "1.3.1" +description = "Sniff out which async library your code is running under" +optional = false +python-versions = ">=3.7" +groups = ["main"] +files = [ + {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, + {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, +] + [[package]] name = "tomli" version = "2.2.1" @@ -1831,4 +1923,4 @@ propcache = ">=0.2.1" [metadata] lock-version = "2.1" python-versions = ">=3.9,<3.13" -content-hash = "77db242eb52b96b64d37a99dbebd4daede119ec3a4f8547d0c6ab3c55861dcda" +content-hash = "411e7974ef54ceafa183f231175bd4c8df9d4a1f6d2b274731017c614a5f9bca" diff --git a/pyproject.toml b/pyproject.toml index d6f55ddb..d1e75993 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,7 @@ python-dateutil = "^2.8.2" pydantic = "2.11.7" aiohttp = "3.12.15" aiohttp-retry = "2.9.1" +httpx = "^0.28.1" [tool.poetry.group.dev.dependencies] pylint = ">=2.17.5" @@ -152,6 +153,7 @@ line-ending = "auto" [tool.ruff.lint.per-file-ignores] "src/conductor/client/http/**/*.py" = ["ALL"] +"src/conductor/client/codegen/**/*.py" = ["ALL"] "src/conductor/client/orkes/api/*.py" = ["ALL"] "tests/**/*.py" = ["B", "C4", "SIM", "PLR2004"] "examples/**/*.py" = ["B", "C4", "SIM"] @@ -163,9 +165,10 @@ omit = [ "tests/*", "examples/*", "*/__init__.py", - "src/conductor/asyncio_client/http/", - "src/conductor/client/http/", - "src/conductor/client/orkes/api/" + "src/conductor/asyncio_client/http/*", + "src/conductor/client/http/*", + "src/conductor/client/orkes/api/*", + "src/conductor/client/codegen/*" ] [tool.coverage.report] @@ -179,3 +182,10 @@ exclude_lines = [ "except ImportError:", "if TYPE_CHECKING:" ] + +[tool.pytest.ini_options] +markers = [ + "v4_1_73: mark test to run for version 4.1.73", + "v5_2_6: mark test to run for version 5.2.6", + "v3_21_16: mark test to run for version 3.21.16" +] \ No newline at end of file diff --git a/src/conductor/asyncio_client/ASYNC_CLIENT_REGENERATION_GUIDE.md b/src/conductor/asyncio_client/ASYNC_CLIENT_REGENERATION_GUIDE.md new file mode 100644 index 00000000..0c26df6c --- /dev/null +++ b/src/conductor/asyncio_client/ASYNC_CLIENT_REGENERATION_GUIDE.md @@ -0,0 +1,434 @@ +# Async Client Regeneration Guide + +This guide provides step-by-step instructions for regenerating the Conductor Python SDK async client code when updating to a new Orkes version. + +## Overview + +The async client regeneration process involves: +1. Creating a new `swagger.json` file with API specifications for the new Orkes version +2. Generating async client code using OpenAPI Generator +3. Replacing old models and API clients in the `/asyncio_client/http` folder +4. Creating adapters in the `/asyncio_client/adapters` folder +5. Running async tests to verify backward compatibility and handle any breaking changes + +## Prerequisites + +- Access to the new Orkes version's API documentation or OpenAPI specification +- OpenAPI Generator installed and configured +- Python development environment with async support +- Access to the Conductor Python SDK repository + +## Step 1: Create swagger.json File + +### 1.1 Obtain API Specification + +1. **From Orkes Documentation**: Download the OpenAPI/Swagger specification for the new Orkes version +2. **From API Endpoint**: If available, fetch the specification from `{orkes_url}/api-docs` or similar endpoint +3. **Manual Creation**: If needed, create the specification manually based on API documentation + +### 1.2 Validate swagger.json + +Ensure the `swagger.json` file: +- Is valid JSON format +- Contains all required API endpoints +- Includes proper model definitions +- Has correct version information + +```bash +# Validate JSON syntax +python -m json.tool swagger.json > /dev/null + +# Check for required fields +jq '.info.version' swagger.json +jq '.paths | keys | length' swagger.json +``` + +## Step 2: Generate Async Client Using OpenAPI Generator + +### 2.1 Install OpenAPI Generator + +```bash +# Using npm +npm install -g @openapitools/openapi-generator-cli + +# Or using Docker +docker pull openapitools/openapi-generator-cli +``` + +### 2.2 Generate Async Client Code + +```bash +# Using openapi-generator-cli with async support +openapi-generator-cli generate \ + -i swagger.json \ + -g python \ + -o ./generated_async_client \ + --package-name conductor.asyncio_client.http \ + --additional-properties=packageName=conductor.asyncio_client.http,projectName=conductor-python-async-sdk,library=asyncio + +# Or using Docker with async configuration +docker run --rm \ + -v ${PWD}:/local openapitools/openapi-generator-cli generate \ + -i /local/swagger.json \ + -g python \ + -o /local/generated_async_client \ + --package-name conductor.asyncio_client.http \ + --additional-properties=packageName=conductor.asyncio_client.http,library=asyncio +``` + +### 2.3 Verify Generated Code + +Check that the generated code includes: +- Async API client classes in `generated_async_client/conductor/asyncio_client/http/api/` +- Model classes in `generated_async_client/conductor/asyncio_client/http/models/` +- Proper async/await patterns +- All required dependencies +- Pydantic model validation + +## Step 3: Replace Old Models and API Clients + +### 3.1 Backup Current HTTP Code + +```bash +# Create backup of current http folder +cp -r src/conductor/asyncio_client/http src/conductor/asyncio_client/http.backup +``` + +### 3.2 Replace Generated Code + +```bash +# Remove old http content +rm -rf src/conductor/asyncio_client/http/* + +# Copy new generated code +cp -r generated_async_client/conductor/asyncio_client/http/* src/conductor/asyncio_client/http/ + +# Clean up generated client directory +rm -rf generated_async_client +``` + +### 3.3 Update Package Imports + +Ensure all generated files have correct import statements: +- Update relative imports if needed +- Verify package structure matches expected layout +- Check for any missing async dependencies +- Ensure Pydantic imports are correct + +## Step 4: Create Adapters + +### 4.1 Create API Adapters + +For each new or modified API client, create an adapter in `src/conductor/asyncio_client/adapters/api/`: + +```python +# Example: src/conductor/asyncio_client/adapters/api/workflow_resource_api.py +from __future__ import annotations + +from typing import Dict, Any, Union, Optional, Annotated, Tuple +from pydantic import validate_call, Field, StrictStr, StrictFloat, StrictInt +from conductor.asyncio_client.adapters.models.workflow_adapter import Workflow + +from conductor.asyncio_client.http.api import WorkflowResourceApi + +class WorkflowResourceApiAdapter(WorkflowResourceApi): + @validate_call + async def update_workflow_state( + self, + workflow_id: StrictStr, + request_body: Dict[str, Any], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Workflow: + """Update workflow variables with backward compatibility""" + # Add any custom logic or backward compatibility methods here + return await super().update_workflow_state( + workflow_id=workflow_id, + request_body=request_body, + _request_timeout=_request_timeout, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) +``` + +### 4.2 Create Model Adapters (if needed) + +For new or modified models, create adapters in `src/conductor/asyncio_client/adapters/models/`: + +```python +# Example: src/conductor/asyncio_client/adapters/models/workflow_adapter.py +from __future__ import annotations +from typing import Optional, Dict, Any +from pydantic import Field, validator +from conductor.asyncio_client.http.models.workflow import Workflow + +class WorkflowAdapter(Workflow): + """Workflow model with backward compatibility support""" + + # Add backward compatibility fields if needed + legacy_field: Optional[str] = Field(None, alias="oldFieldName") + + @validator('legacy_field', pre=True) + def handle_legacy_field(cls, v, values): + """Handle legacy field mapping""" + if v is not None: + # Map legacy field to new field structure + return v + return v + + def to_legacy_dict(self) -> Dict[str, Any]: + """Convert to legacy dictionary format for backward compatibility""" + data = self.dict() + # Add any legacy field mappings + if hasattr(self, 'legacy_field') and self.legacy_field: + data['oldFieldName'] = self.legacy_field + return data +``` + +### 4.3 Update Adapter Imports + +Update the main adapters `__init__.py` file to include new adapters: + +```python +# src/conductor/asyncio_client/adapters/__init__.py +from conductor.asyncio_client.adapters.api_client_adapter import ApiClientAdapter as ApiClient + +# Import all API adapters +from conductor.asyncio_client.adapters.api.workflow_resource_api import WorkflowResourceApiAdapter +from conductor.asyncio_client.adapters.api.task_resource_api import TaskResourceApiAdapter +# ... add other adapters as needed + +__all__ = [ + "ApiClient", + "WorkflowResourceApiAdapter", + "TaskResourceApiAdapter", + # ... add other adapters +] +``` + +### 4.4 Update Orkes Base Client + +Update the `OrkesBaseClient` to use new adapters: + +```python +# src/conductor/asyncio_client/orkes/orkes_base_client.py +from conductor.asyncio_client.adapters.api.workflow_resource_api import WorkflowResourceApiAdapter +from conductor.asyncio_client.adapters.api.task_resource_api import TaskResourceApiAdapter +# ... import other adapters + +class OrkesBaseClient: + def __init__(self, configuration: Configuration, api_client: ApiClient): + # ... existing code ... + + # Initialize all API clients with adapters + self.metadata_api = MetadataResourceApiAdapter(self.api_client) + self.task_api = TaskResourceApiAdapter(self.api_client) + self.workflow_api = WorkflowResourceApiAdapter(self.api_client) + # ... update other API initializations +``` + +## Step 5: Run Tests and Handle Breaking Changes + +### 5.1 Run Async Unit Tests + +```bash +# Run all async unit tests +python -m pytest tests/unit/orkes/test_async_* -v + +# Run specific async client tests +python -m pytest tests/unit/orkes/test_async_workflow_client.py -v +python -m pytest tests/unit/orkes/test_async_task_client.py -v +python -m pytest tests/unit/orkes/test_async_authorization_client.py -v +``` + +### 5.2 Run Async Integration Tests + +```bash +# Run async integration tests +python -m pytest tests/integration/client/test_async.py -v + +# Run async workflow tests +python -m pytest tests/unit/workflow/test_async_workflow_executor.py -v +python -m pytest tests/unit/workflow/test_async_conductor_workflow.py -v +``` + +### 5.3 Run Serialization/Deserialization Tests + +```bash +# Run all serdeser tests (includes async models) +python -m pytest tests/serdesertest/ -v + +# Run pydantic-specific tests +python -m pytest tests/serdesertest/pydantic/ -v +``` + +### 5.4 Run AI and Telemetry Tests + +```bash +# Run async AI orchestrator tests +python -m pytest tests/unit/ai/test_async_ai_orchestrator.py -v + +# Run async metrics collector tests +python -m pytest tests/unit/telemetry/test_async_metrics_collector.py -v + +# Run async event client tests +python -m pytest tests/unit/event/test_async_event_client.py -v +``` + +### 5.5 Handle Breaking Changes + +If tests fail due to breaking changes: + +1. **Identify Breaking Changes**: + - Review async test failures + - Check for removed async methods or changed signatures + - Identify modified model structures + - Verify Pydantic validation changes + +2. **Update Async Adapters**: + - Add backward compatibility methods to adapters + - Implement deprecated method aliases + - Handle parameter changes with default values + - Ensure async/await patterns are maintained + +3. **Example Async Adapter Update**: + ```python + class WorkflowResourceApiAdapter(WorkflowResourceApi): + async def start_workflow_legacy( + self, + workflow_id: str, + input_data: Optional[Dict] = None, + **kwargs + ) -> str: + """Backward compatibility method for old start_workflow signature""" + # Convert old parameters to new format + start_request = StartWorkflowRequest( + name=workflow_id, + input=input_data, + **kwargs + ) + result = await self.start_workflow(start_request) + return result.workflow_id + + # Alias for backward compatibility + start_workflow_v1 = start_workflow_legacy + ``` + +4. **Update Async Tests**: + - Add tests for new async functionality + - Update existing async tests if needed + - Ensure backward compatibility tests pass + - Verify async context managers work correctly + +### 5.6 Final Verification + +```bash +# Run all async-related tests +python -m pytest tests/unit/orkes/test_async_* tests/unit/workflow/test_async_* tests/unit/ai/test_async_* tests/unit/telemetry/test_async_* tests/unit/event/test_async_* -v + +# Run integration tests +python -m pytest tests/integration/client/test_async.py -v + +# Check for any linting issues +python -m flake8 src/conductor/asyncio_client/ +python -m mypy src/conductor/asyncio_client/ +``` + +## Troubleshooting + +### Common Issues + +1. **Async Import Errors**: Check that all generated files have correct async imports +2. **Pydantic Validation Errors**: Ensure model adapters handle validation correctly +3. **Missing Async Dependencies**: Verify all required async packages are installed +4. **Test Failures**: Review adapter implementations for missing backward compatibility +5. **Model Changes**: Update adapters to handle structural changes in async models + +### Recovery Steps + +If the regeneration process fails: + +1. **Restore Backup**: + ```bash + rm -rf src/conductor/asyncio_client/http + mv src/conductor/asyncio_client/http.backup src/conductor/asyncio_client/http + ``` + +2. **Incremental Updates**: Instead of full replacement, update specific async APIs one at a time + +3. **Manual Fixes**: Apply targeted fixes to specific async adapters or models + +## Best Practices + +1. **Version Control**: Always commit changes before starting regeneration +2. **Async Patterns**: Maintain proper async/await patterns throughout +3. **Pydantic Validation**: Ensure all models use proper Pydantic validation +4. **Incremental Updates**: Test each async API client individually when possible +5. **Documentation**: Update API documentation for any new async features +6. **Backward Compatibility**: Prioritize maintaining existing async API contracts +7. **Testing**: Run async tests frequently during the regeneration process + +## File Structure Reference + +``` +src/conductor/asyncio_client/ +├── http/ # Generated async client code (replaced in step 3) +│ ├── api/ # Generated async API clients +│ ├── models/ # Generated async model classes +│ ├── api_client.py # Generated async API client base +│ └── rest.py # Generated async REST client +├── adapters/ # Adapter layer (created in step 4) +│ ├── api/ # Async API client adapters +│ ├── models/ # Async model adapters +│ └── api_client_adapter.py # Async API client adapter +├── orkes/ # Orkes-specific async implementations +│ ├── orkes_*_client.py # Orkes async client implementations +│ └── orkes_base_client.py # Base async client +├── configuration/ # Async configuration +└── workflow/ # Async workflow components + └── executor/ # Async workflow executor +``` + +## Testing Structure Reference + +``` +tests/ +├── unit/ +│ ├── orkes/ +│ │ └── test_async_*_client.py # Async client unit tests +│ ├── workflow/ +│ │ └── test_async_* # Async workflow tests +│ ├── ai/ +│ │ └── test_async_ai_orchestrator.py +│ ├── telemetry/ +│ │ └── test_async_metrics_collector.py +│ └── event/ +│ └── test_async_event_client.py +├── integration/ +│ └── client/ +│ └── test_async.py # Async integration tests +└── serdesertest/ + └── pydantic/ # Pydantic model tests +``` + +## Key Differences from Sync Client + +1. **No Proxy Package**: The async client uses direct imports from adapters +2. **OpenAPI Generator**: Uses OpenAPI Generator instead of Swagger Codegen +3. **Pydantic Models**: All models use Pydantic for validation +4. **Async/Await**: All methods are async and use proper async patterns +5. **Direct Adapter Usage**: Orkes clients directly use adapters without proxy layer + +This guide ensures a systematic approach to async client regeneration while maintaining backward compatibility and proper async patterns. diff --git a/src/conductor/asyncio_client/adapters/api_client_adapter.py b/src/conductor/asyncio_client/adapters/api_client_adapter.py index 4fe809cb..2c82a5ee 100644 --- a/src/conductor/asyncio_client/adapters/api_client_adapter.py +++ b/src/conductor/asyncio_client/adapters/api_client_adapter.py @@ -1,12 +1,17 @@ import json import logging +import re +from typing import Dict, Optional from conductor.asyncio_client.adapters.models import GenerateTokenRequest +from conductor.asyncio_client.configuration import Configuration from conductor.asyncio_client.http import rest from conductor.asyncio_client.http.api_client import ApiClient +from conductor.asyncio_client.http.api_response import ApiResponse +from conductor.asyncio_client.http.api_response import T as ApiResponseT from conductor.asyncio_client.http.exceptions import ApiException -logger = logging.getLogger(__name__) +logger = logging.getLogger(Configuration.get_logging_formatted_name(__name__)) class ApiClientAdapter(ApiClient): @@ -32,6 +37,7 @@ async def call_api( """ try: + logger.debug("HTTP request method: %s; url: %s; header_params: %s", method, url, header_params) response_data = await self.rest_client.request( method, url, @@ -40,26 +46,88 @@ async def call_api( post_params=post_params, _request_timeout=_request_timeout, ) - if response_data.status == 401: # noqa: PLR2004 (Unauthorized status code) - token = await self.refresh_authorization_token() - header_params["X-Authorization"] = token - response_data = await self.rest_client.request( - method, - url, - headers=header_params, - body=body, - post_params=post_params, - _request_timeout=_request_timeout, - ) + if response_data.status == 401 and url != self.configuration.host + "/token": # noqa: PLR2004 (Unauthorized status code) + logger.warning("HTTP response from: %s; status code: 401 - obtaining new token", url) + token = await self.refresh_authorization_token() + header_params["X-Authorization"] = token + response_data = await self.rest_client.request( + method, + url, + headers=header_params, + body=body, + post_params=post_params, + _request_timeout=_request_timeout, + ) except ApiException as e: + logger.error("HTTP request failed url: %s status: %s; reason: %s", url, e.status, e.reason) raise e return response_data + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]] = None, + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get( + str(response_data.status)[0] + "XX", None + ) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader("content-type") + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize( + response_text, response_type, content_type + ) + finally: + if not 200 <= response_data.status <= 299: + logger.error(f"Unexpected response status code: {response_data.status}") + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code=response_data.status, + data=return_data, + headers=response_data.getheaders(), + raw_data=response_data.data, + ) + async def refresh_authorization_token(self): obtain_new_token_response = await self.obtain_new_token() token = obtain_new_token_response.get("token") self.configuration.api_key["api_key"] = token + logger.debug(f"New auth token been set") return token async def obtain_new_token(self): diff --git a/src/conductor/asyncio_client/automator/task_handler.py b/src/conductor/asyncio_client/automator/task_handler.py index 8b693abc..6bbfa13e 100644 --- a/src/conductor/asyncio_client/automator/task_handler.py +++ b/src/conductor/asyncio_client/automator/task_handler.py @@ -10,12 +10,10 @@ from conductor.asyncio_client.automator.task_runner import AsyncTaskRunner from conductor.asyncio_client.configuration.configuration import Configuration -from conductor.asyncio_client.telemetry.metrics_collector import \ - AsyncMetricsCollector +from conductor.asyncio_client.telemetry.metrics_collector import AsyncMetricsCollector from conductor.asyncio_client.worker.worker import Worker from conductor.asyncio_client.worker.worker_interface import WorkerInterface -from conductor.shared.configuration.settings.metrics_settings import \ - MetricsSettings +from conductor.shared.configuration.settings.metrics_settings import MetricsSettings logger = logging.getLogger(Configuration.get_logging_formatted_name(__name__)) @@ -29,9 +27,10 @@ set_start_method("fork") _mp_fork_set = True except Exception as e: - logger.info( - "error when setting multiprocessing.set_start_method - maybe the context is set %s", + logger.error( + "Error when setting multiprocessing.set_start_method - maybe the context is set %s", e.args, + ) if platform == "darwin": os.environ["no_proxy"] = "*" @@ -40,7 +39,7 @@ def register_decorated_fn( name: str, poll_interval: int, domain: str, worker_id: str, func ): - logger.info("decorated %s", name) + logger.info("Registering decorated function: %s", name) _decorated_functions[(name, domain)] = { "func": func, "poll_interval": poll_interval, @@ -66,7 +65,7 @@ def __init__( importlib.import_module("conductor.asyncio_client.worker.worker_task") if import_modules is not None: for module in import_modules: - logger.info("loading module %s", module) + logger.debug("Loading module %s", module) importlib.import_module(module) elif not isinstance(workers, list): @@ -85,7 +84,7 @@ def __init__( poll_interval=poll_interval, ) logger.info( - "created worker with name=%s and domain=%s", task_def_name, domain + "Created worker with name: %s; domain: %s", task_def_name, domain ) workers.append(worker) @@ -107,22 +106,22 @@ def coroutine_as_process_target(awaitable_func, *args, **kwargs): def stop_processes(self) -> None: self.__stop_task_runner_processes() self.__stop_metrics_provider_process() - logger.info("Stopped worker processes...") + logger.info("Stopped worker processes") self.queue.put(None) self.logger_process.terminate() def start_processes(self) -> None: - logger.info("Starting worker processes...") + logger.info("Starting worker processes") freeze_support() self.__start_task_runner_processes() self.__start_metrics_provider_process() - logger.info("Started all processes") + logger.info("Started task_runner and metrics_provider processes") def join_processes(self) -> None: try: self.__join_task_runner_processes() self.__join_metrics_provider_process() - logger.info("Joined all processes") + logger.info("Joined task_runner and metrics_provider processes") except KeyboardInterrupt: logger.info("KeyboardInterrupt: Stopping all processes") self.stop_processes() @@ -137,7 +136,9 @@ def __create_metrics_provider_process( target=self.coroutine_as_process_target, args=(AsyncMetricsCollector.provide_metrics, metrics_settings), ) - logger.info("Created MetricsProvider process") + logger.info( + "Created MetricsProvider process pid: %s", self.metrics_provider_process.pid + ) def __create_task_runner_processes( self, @@ -165,32 +166,43 @@ def __start_metrics_provider_process(self): if self.metrics_provider_process is None: return self.metrics_provider_process.start() - logger.info("Started MetricsProvider process") + logger.info( + "Started MetricsProvider process with pid: %s", + self.metrics_provider_process.pid, + ) def __start_task_runner_processes(self): - n = 0 for task_runner_process in self.task_runner_processes: task_runner_process.start() - n = n + 1 - logger.info("Started %s TaskRunner process", n) + logger.debug( + "Started TaskRunner process with pid: %s", task_runner_process.pid + ) + logger.info("Started %s TaskRunner processes", len(self.task_runner_processes)) def __join_metrics_provider_process(self): if self.metrics_provider_process is None: return self.metrics_provider_process.join() - logger.info("Joined MetricsProvider processes") + logger.info( + "Joined MetricsProvider process with pid: %s", + self.metrics_provider_process.pid, + ) def __join_task_runner_processes(self): for task_runner_process in self.task_runner_processes: task_runner_process.join() - logger.info("Joined TaskRunner processes") + logger.info("Joined %s TaskRunner processes", len(self.task_runner_processes)) def __stop_metrics_provider_process(self): self.__stop_process(self.metrics_provider_process) + logger.info( + "Stopped MetricsProvider process", + ) def __stop_task_runner_processes(self): for task_runner_process in self.task_runner_processes: self.__stop_process(task_runner_process) + logger.info("Stopped %s TaskRunner processes", len(self.task_runner_processes)) def __stop_process(self, process: Process): if process is None: @@ -199,7 +211,7 @@ def __stop_process(self, process: Process): logger.debug("Terminating process: %s", process.pid) process.terminate() except Exception as e: - logger.debug("Failed to terminate process: %s, reason: %s", process.pid, e) + logger.error("Failed to terminate process: %s, reason: %s", process.pid, e) process.kill() logger.debug("Killed process: %s", process.pid) diff --git a/src/conductor/asyncio_client/automator/task_runner.py b/src/conductor/asyncio_client/automator/task_runner.py index 3da44e1b..e711787f 100644 --- a/src/conductor/asyncio_client/automator/task_runner.py +++ b/src/conductor/asyncio_client/automator/task_runner.py @@ -8,20 +8,22 @@ import traceback from typing import Optional +from conductor.asyncio_client.adapters import ApiClient +from conductor.asyncio_client.adapters.api.task_resource_api import ( + TaskResourceApiAdapter, +) from conductor.asyncio_client.adapters.models.task_adapter import TaskAdapter -from conductor.asyncio_client.adapters.models.task_exec_log_adapter import \ - TaskExecLogAdapter -from conductor.asyncio_client.adapters.models.task_result_adapter import \ - TaskResultAdapter +from conductor.asyncio_client.adapters.models.task_exec_log_adapter import ( + TaskExecLogAdapter, +) +from conductor.asyncio_client.adapters.models.task_result_adapter import ( + TaskResultAdapter, +) from conductor.asyncio_client.configuration import Configuration -from conductor.asyncio_client.adapters.api.task_resource_api import TaskResourceApiAdapter -from conductor.asyncio_client.adapters import ApiClient from conductor.asyncio_client.http.exceptions import UnauthorizedException -from conductor.asyncio_client.telemetry.metrics_collector import \ - AsyncMetricsCollector +from conductor.asyncio_client.telemetry.metrics_collector import AsyncMetricsCollector from conductor.asyncio_client.worker.worker_interface import WorkerInterface -from conductor.shared.configuration.settings.metrics_settings import \ - MetricsSettings +from conductor.shared.configuration.settings.metrics_settings import MetricsSettings logger = logging.getLogger(Configuration.get_logging_formatted_name(__name__)) @@ -43,7 +45,9 @@ def __init__( self.metrics_collector = None if metrics_settings is not None: self.metrics_collector = AsyncMetricsCollector(metrics_settings) - self.task_client = TaskResourceApiAdapter(ApiClient(configuration=self.configuration)) + self.task_client = TaskResourceApiAdapter( + ApiClient(configuration=self.configuration) + ) async def run(self) -> None: if self.configuration is not None: @@ -53,7 +57,7 @@ async def run(self) -> None: task_names = ",".join(self.worker.task_definition_names) logger.info( - "Polling task %s with domain %s with polling interval %s", + "Polling tasks task_names: %s; domain: %s; polling_interval: %s", task_names, self.worker.get_domain(), self.worker.get_polling_interval_in_seconds(), @@ -76,7 +80,7 @@ async def run_once(self) -> None: async def __poll_task(self) -> Optional[TaskAdapter]: task_definition_name = self.worker.get_task_definition_name() if self.worker.paused(): - logger.debug("Stop polling task for: %s", task_definition_name) + logger.debug("Stop polling task: %s", task_definition_name) return None if self.metrics_collector is not None: await self.metrics_collector.increment_task_poll(task_definition_name) @@ -99,8 +103,11 @@ async def __poll_task(self) -> Optional[TaskAdapter]: await self.metrics_collector.increment_task_poll_error( task_definition_name, auth_exception ) - logger.fatal( - f"failed to poll task {task_definition_name} error: {auth_exception.reason} - {auth_exception.status}" + logger.error( + "Failed to poll task: %s; reason: %s; status: %s", + task_definition_name, + auth_exception.reason, + auth_exception.status, ) return None except Exception as e: @@ -109,14 +116,14 @@ async def __poll_task(self) -> Optional[TaskAdapter]: task_definition_name, e ) logger.error( - "Failed to poll task for: %s, reason: %s", + "Failed to poll task: %s, reason: %s", task_definition_name, traceback.format_exc(), ) return None if task is not None: logger.debug( - "Polled task: %s, worker_id: %s, domain: %s", + "Polled task: %s; worker_id: %s; domain: %s", task_definition_name, self.worker.get_identity(), self.worker.get_domain(), @@ -128,7 +135,7 @@ async def __execute_task(self, task: TaskAdapter) -> Optional[TaskResultAdapter] return None task_definition_name = self.worker.get_task_definition_name() logger.debug( - "Executing task, id: %s, workflow_instance_id: %s, task_definition_name: %s", + "Executing task task_id: %s; workflow_instance_id: %s; task_definition_name: %s", task.task_id, task.workflow_instance_id, task_definition_name, @@ -146,7 +153,7 @@ async def __execute_task(self, task: TaskAdapter) -> Optional[TaskResultAdapter] task_definition_name, sys.getsizeof(task_result) ) logger.debug( - "Executed task, id: %s, workflow_instance_id: %s, task_definition_name: %s", + "Executed task task_id: %s; workflow_instance_id: %s; task_definition_name: %s", task.task_id, task.workflow_instance_id, task_definition_name, @@ -171,8 +178,8 @@ async def __execute_task(self, task: TaskAdapter) -> Optional[TaskResultAdapter] ) ] logger.error( - "Failed to execute task, id: %s, workflow_instance_id: %s, " - "task_definition_name: %s, reason: %s", + "Failed to execute task task_id: %s; workflow_instance_id: %s; " + "task_definition_name: %s; reason: %s", task.task_id, task.workflow_instance_id, task_definition_name, @@ -185,7 +192,7 @@ async def __update_task(self, task_result: TaskResultAdapter): return None task_definition_name = self.worker.get_task_definition_name() logger.debug( - "Updating task, id: %s, workflow_instance_id: %s, task_definition_name: %s", + "Updating task task_id: %s, workflow_instance_id: %s, task_definition_name: %s", task_result.task_id, task_result.workflow_instance_id, task_definition_name, @@ -197,7 +204,7 @@ async def __update_task(self, task_result: TaskResultAdapter): try: response = await self.task_client.update_task(task_result=task_result) logger.debug( - "Updated task, id: %s, workflow_instance_id: %s, task_definition_name: %s, response: %s", + "Updated task task_id: %s; workflow_instance_id: %s; task_definition_name: %s; response: %s", task_result.task_id, task_result.workflow_instance_id, task_definition_name, @@ -210,7 +217,7 @@ async def __update_task(self, task_result: TaskResultAdapter): task_definition_name, e ) logger.error( - "Failed to update task, id: %s, workflow_instance_id: %s, task_definition_name: %s, reason: %s", + "Failed to update task task_id: %s; workflow_instance_id: %s; task_definition_name: %s; reason: %s", task_result.task_id, task_result.workflow_instance_id, task_definition_name, @@ -236,27 +243,20 @@ def __set_worker_properties(self) -> None: polling_interval = self.__get_property_value_from_env( "polling_interval", task_type ) + if polling_interval: try: self.worker.poll_interval = float(polling_interval) - except Exception: + except Exception as e: logger.error( - "error reading and parsing the polling interval value %s", + "Error converting polling_interval to float value: %s, exception: %s", polling_interval, + e, ) self.worker.poll_interval = ( self.worker.get_polling_interval_in_seconds() ) - if polling_interval: - try: - self.worker.poll_interval = float(polling_interval) - except Exception as e: - logger.error( - "Exception in reading polling interval from environment variable: %s", - e, - ) - def __get_property_value_from_env(self, prop, task_type): """ get the property from the env variable diff --git a/src/conductor/asyncio_client/configuration/configuration.py b/src/conductor/asyncio_client/configuration/configuration.py index cf1edf94..69519365 100644 --- a/src/conductor/asyncio_client/configuration/configuration.py +++ b/src/conductor/asyncio_client/configuration/configuration.py @@ -4,8 +4,9 @@ import os from typing import Any, Dict, Optional, Union -from conductor.asyncio_client.http.configuration import \ - Configuration as HttpConfiguration +from conductor.asyncio_client.http.configuration import ( + Configuration as HttpConfiguration, +) class Configuration: @@ -25,8 +26,9 @@ class Configuration: Worker Properties (via environment variables): ---------------------------------------------- - CONDUCTOR_WORKER_POLLING_INTERVAL: Default polling interval in seconds CONDUCTOR_WORKER_DOMAIN: Default worker domain + CONDUCTOR_WORKER_POLL_INTERVAL: Polling interval in milliseconds (default: 100) + CONDUCTOR_WORKER_POLL_INTERVAL_SECONDS: Polling interval in seconds (default: 0) CONDUCTOR_WORKER__POLLING_INTERVAL: Task-specific polling interval CONDUCTOR_WORKER__DOMAIN: Task-specific domain @@ -56,8 +58,9 @@ def __init__( auth_secret: Optional[str] = None, debug: bool = False, # Worker properties - default_polling_interval: Optional[float] = None, - default_domain: Optional[str] = None, + polling_interval: Optional[int] = None, + domain: Optional[str] = None, + polling_interval_seconds: Optional[int] = None, # HTTP Configuration parameters api_key: Optional[Dict[str, str]] = None, api_key_prefix: Optional[Dict[str, str]] = None, @@ -87,10 +90,12 @@ def __init__( Authentication key secret. If not provided, reads from CONDUCTOR_AUTH_SECRET env var. debug : bool, optional Enable debug logging. Default is False. - default_polling_interval : float, optional - Default polling interval for workers in seconds. - default_domain : str, optional - Default domain for workers. + polling_interval : int, optional + Polling interval in milliseconds. If not provided, reads from CONDUCTOR_WORKER_POLL_INTERVAL env var. + domain : str, optional + Worker domain. If not provided, reads from CONDUCTOR_WORKER_DOMAIN env var. + polling_interval_seconds : int, optional + Polling interval in seconds. If not provided, reads from CONDUCTOR_WORKER_POLL_INTERVAL_SECONDS env var. **kwargs : Any Additional parameters passed to HttpConfiguration. """ @@ -115,11 +120,14 @@ def __init__( else: self.auth_secret = os.getenv("CONDUCTOR_AUTH_SECRET") - # Worker properties with environment variable fallback - self.default_polling_interval = default_polling_interval or self._get_env_float( - "CONDUCTOR_WORKER_POLLING_INTERVAL", 1.0 + # Additional worker properties with environment variable fallback + self.polling_interval = polling_interval or self._get_env_int( + "CONDUCTOR_WORKER_POLL_INTERVAL", 100 + ) + self.domain = domain or os.getenv("CONDUCTOR_WORKER_DOMAIN", "default_domain") + self.polling_interval_seconds = polling_interval_seconds or self._get_env_int( + "CONDUCTOR_WORKER_POLL_INTERVAL_SECONDS", 0 ) - self.default_domain = default_domain or os.getenv("CONDUCTOR_WORKER_DOMAIN") # Store additional worker properties self._worker_properties: Dict[str, Dict[str, Any]] = {} @@ -172,6 +180,8 @@ def __init__( if debug: self.logger.setLevel(logging.DEBUG) + self.is_logger_config_applied = False + def _get_env_float(self, env_var: str, default: float) -> float: """Get float value from environment variable with default fallback.""" try: @@ -231,10 +241,12 @@ def get_worker_property_value( return self._convert_property_value(property_name, value) # Return default value - if property_name == "polling_interval": - return self.default_polling_interval elif property_name == "domain": - return self.default_domain + return self.domain + elif property_name == "polling_interval": + return self.polling_interval + elif property_name == "poll_interval_seconds": + return self.polling_interval_seconds return None @@ -245,7 +257,13 @@ def _convert_property_value(self, property_name: str, value: str) -> Any: return float(value) except (ValueError, TypeError): self.logger.warning("Invalid polling_interval value: %s", value) - return self.default_polling_interval + return self.polling_interval + elif property_name == "polling_interval_seconds": + try: + return float(value) + except (ValueError, TypeError): + self.logger.warning("Invalid polling_interval_seconds value: %s", value) + return self.polling_interval_seconds # For other properties, return as string return value @@ -322,6 +340,37 @@ def get_domain(self, task_type: Optional[str] = None) -> Optional[str]: """ return self.get_worker_property_value("domain", task_type) + def get_poll_interval(self, task_type: Optional[str] = None) -> int: + """ + Get polling interval in milliseconds for a task type with environment variable support. + + Parameters: + ----------- + task_type : str, optional + Task type for task-specific configuration + + Returns: + -------- + int + Polling interval in milliseconds + """ + if task_type: + value = self.get_worker_property_value("polling_interval", task_type) + if value is not None: + return int(value) + return self.polling_interval + + def get_poll_interval_seconds(self) -> int: + """ + Get polling interval in seconds. + + Returns: + -------- + int + Polling interval in seconds + """ + return self.polling_interval_seconds + # Properties for commonly used HTTP configuration attributes @property def host(self) -> str: @@ -450,21 +499,21 @@ def log_level(self) -> int: """Get log level.""" return self.__log_level - def apply_logging_config(self, log_format : Optional[str] = None, level = None): + def apply_logging_config(self, log_format: Optional[str] = None, level=None): """Apply logging configuration for the application.""" + if self.is_logger_config_applied: + return if log_format is None: log_format = self.logger_format if level is None: level = self.__log_level - logging.basicConfig( - format=log_format, - level=level - ) + logging.basicConfig(format=log_format, level=level) + self.is_logger_config_applied = True @staticmethod def get_logging_formatted_name(name): """Format a logger name with the current process ID.""" - return f"[{os.getpid()}] {name}" + return f"[pid:{os.getpid()}] {name}" @property def ui_host(self): @@ -474,5 +523,7 @@ def ui_host(self): def __getattr__(self, name: str) -> Any: """Delegate attribute access to underlying HTTP configuration.""" if "_http_config" not in self.__dict__ or self._http_config is None: - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + raise AttributeError( + f"'{self.__class__.__name__}' object has no attribute '{name}'" + ) return getattr(self._http_config, name) diff --git a/src/conductor/asyncio_client/telemetry/metrics_collector.py b/src/conductor/asyncio_client/telemetry/metrics_collector.py index d8902cf1..031e9338 100644 --- a/src/conductor/asyncio_client/telemetry/metrics_collector.py +++ b/src/conductor/asyncio_client/telemetry/metrics_collector.py @@ -67,7 +67,7 @@ async def provide_metrics(settings: MetricsSettings) -> None: write_to_textfile(OUTPUT_FILE_PATH, registry) await asyncio.sleep(settings.update_interval) except Exception as e: # noqa: PERF203 - logger.error("Error writing metrics to file: %s", e) + logger.error("Error writing metrics to file output_file_path: %s; registry: %s", OUTPUT_FILE_PATH, registry) await asyncio.sleep(settings.update_interval) async def increment_task_poll(self, task_type: str) -> None: diff --git a/src/conductor/asyncio_client/worker/worker.py b/src/conductor/asyncio_client/worker/worker.py index 610c05f6..f6fe5c06 100644 --- a/src/conductor/asyncio_client/worker/worker.py +++ b/src/conductor/asyncio_client/worker/worker.py @@ -9,14 +9,15 @@ from typing import Any, Callable, Optional, Union from conductor.asyncio_client.adapters.models.task_adapter import TaskAdapter -from conductor.asyncio_client.adapters.models.task_exec_log_adapter import \ - TaskExecLogAdapter -from conductor.asyncio_client.adapters.models.task_result_adapter import \ - TaskResultAdapter +from conductor.asyncio_client.adapters.models.task_exec_log_adapter import ( + TaskExecLogAdapter, +) +from conductor.asyncio_client.adapters.models.task_result_adapter import ( + TaskResultAdapter, +) from conductor.asyncio_client.configuration import Configuration from conductor.asyncio_client.adapters import ApiClient -from conductor.asyncio_client.worker.worker_interface import ( - DEFAULT_POLLING_INTERVAL, WorkerInterface) +from conductor.asyncio_client.worker.worker_interface import WorkerInterface from conductor.shared.automator import utils from conductor.shared.automator.utils import convert_from_dict_or_list from conductor.shared.http.enums import TaskResultStatus @@ -60,15 +61,10 @@ def __init__( ): super().__init__(task_definition_name) self.api_client = ApiClient() - if poll_interval is None: - self.poll_interval = DEFAULT_POLLING_INTERVAL - else: - self.poll_interval = deepcopy(poll_interval) - self.domain = deepcopy(domain) - if worker_id is None: - self.worker_id = deepcopy(super().get_identity()) - else: - self.worker_id = deepcopy(worker_id) + self.config = Configuration() + self.poll_interval = poll_interval or self.config.get_poll_interval() + self.domain = domain or self.config.get_domain() + self.worker_id = worker_id or super().get_identity() self.execute_function = deepcopy(execute_function) def execute(self, task: TaskAdapter) -> TaskResultAdapter: @@ -113,10 +109,9 @@ def execute(self, task: TaskAdapter) -> TaskResultAdapter: except Exception as ne: logger.error( - "Error executing task %s with id %s. error = %s", + "Error executing task task_def_name: %s; task_id: %s", task.task_def_name, task.task_id, - traceback.format_exc(), ) task_result.logs = [ diff --git a/src/conductor/asyncio_client/worker/worker_task.py b/src/conductor/asyncio_client/worker/worker_task.py index f066fa8a..e17905c1 100644 --- a/src/conductor/asyncio_client/worker/worker_task.py +++ b/src/conductor/asyncio_client/worker/worker_task.py @@ -3,8 +3,8 @@ import functools from typing import Optional -from conductor.asyncio_client.automator.task_handler import \ - register_decorated_fn +from conductor.asyncio_client.automator.task_handler import register_decorated_fn +from conductor.asyncio_client.configuration.configuration import Configuration from conductor.asyncio_client.workflow.task.simple_task import SimpleTask @@ -15,12 +15,17 @@ def WorkerTask( worker_id: Optional[str] = None, poll_interval_seconds: int = 0, ): + config = Configuration() + + poll_interval = poll_interval or config.get_poll_interval() + domain = domain or config.get_domain() + poll_interval_seconds = poll_interval_seconds or config.get_poll_interval_seconds() + poll_interval_millis = poll_interval if poll_interval_seconds > 0: poll_interval_millis = 1000 * poll_interval_seconds def worker_task_func(func): - register_decorated_fn( name=task_definition_name, poll_interval=poll_interval_millis, @@ -52,6 +57,11 @@ def worker_task( domain: Optional[str] = None, worker_id: Optional[str] = None, ): + config = Configuration() + + poll_interval_millis = poll_interval_millis or config.get_poll_interval() + domain = domain or config.get_domain() + def worker_task_func(func): register_decorated_fn( name=task_definition_name, diff --git a/src/conductor/client/CLIENT_REGENERATION_GUIDE.md b/src/conductor/client/CLIENT_REGENERATION_GUIDE.md new file mode 100644 index 00000000..9c2bec4c --- /dev/null +++ b/src/conductor/client/CLIENT_REGENERATION_GUIDE.md @@ -0,0 +1,315 @@ +# Client Regeneration Guide + +This guide provides step-by-step instructions for regenerating the Conductor Python SDK client code when updating to a new Orkes version. + +## Overview + +The client regeneration process involves: +1. Creating a new `swagger.json` file with API specifications for the new Orkes version +2. Generating client code using Swagger Codegen +3. Replacing old models and API clients in the `/client/codegen` folder +4. Creating adapters in the `/client/adapters` folder and importing them in the proxy package +5. Running tests to verify backward compatibility and handle any breaking changes + +## Prerequisites + +- Access to the new Orkes version's API documentation or OpenAPI specification +- Swagger Codegen installed and configured +- Python development environment set up +- Access to the Conductor Python SDK repository + +## Step 1: Create swagger.json File + +### 1.1 Obtain API Specification + +1. **From Orkes Documentation**: Download the OpenAPI/Swagger specification for the new Orkes version +2. **From API Endpoint**: If available, fetch the specification from `{orkes_url}/api-docs` or similar endpoint +3. **Manual Creation**: If needed, create the specification manually based on API documentation + +### 1.2 Validate swagger.json + +Ensure the `swagger.json` file: +- Is valid JSON format +- Contains all required API endpoints +- Includes proper model definitions +- Has correct version information + +```bash +# Validate JSON syntax +python -m json.tool swagger.json > /dev/null + +# Check for required fields +jq '.info.version' swagger.json +jq '.paths | keys | length' swagger.json +``` + +## Step 2: Generate Client Using Swagger Codegen + +### 2.1 Install Swagger Codegen + +```bash +# Using npm +npm install -g @openapitools/openapi-generator-cli + +# Or using Docker +docker pull openapitools/openapi-generator-cli +``` + +### 2.2 Generate Client Code + +```bash +# Using openapi-generator-cli +openapi-generator-cli generate \ + -i swagger.json \ + -g python \ + -o ./generated_client \ + --package-name conductor.client.codegen \ + --additional-properties=packageName=conductor.client.codegen,projectName=conductor-python-sdk + +# Or using Docker +docker run --rm \ + -v ${PWD}:/local openapitools/openapi-generator-cli generate \ + -i /local/swagger.json \ + -g python \ + -o /local/generated_client \ + --package-name conductor.client.codegen +``` + +### 2.3 Verify Generated Code + +Check that the generated code includes: +- API client classes in `generated_client/conductor/client/codegen/api/` +- Model classes in `generated_client/conductor/client/codegen/models/` +- Proper package structure +- All required dependencies + +## Step 3: Replace Old Models and API Clients + +### 3.1 Backup Current Codegen + +```bash +# Create backup of current codegen folder +cp -r src/conductor/client/codegen src/conductor/client/codegen.backup +``` + +### 3.2 Replace Generated Code + +```bash +# Remove old codegen content +rm -rf src/conductor/client/codegen/* + +# Copy new generated code +cp -r generated_client/conductor/client/codegen/* src/conductor/client/codegen/ + +# Clean up generated client directory +rm -rf generated_client +``` + +### 3.3 Update Package Imports + +Ensure all generated files have correct import statements: +- Update relative imports if needed +- Verify package structure matches expected layout +- Check for any missing dependencies + +## Step 4: Create Adapters and Update Proxy Package + +### 4.1 Create API Adapters + +For each new or modified API client, create an adapter in `src/conductor/client/adapters/api/`: + +```python +# Example: src/conductor/client/adapters/api/workflow_resource_api_adapter.py +from conductor.client.codegen.api.workflow_resource_api import WorkflowResourceApi + +class WorkflowResourceApiAdapter(WorkflowResourceApi): + # Add any custom logic or backward compatibility methods here + pass +``` + +### 4.2 Create Model Adapters (if needed) + +For new or modified models, create adapters in `src/conductor/client/adapters/models/`: + +```python +# Example: src/conductor/client/adapters/models/workflow_adapter.py +from conductor.client.codegen.models.workflow import Workflow + +class WorkflowAdapter(Workflow): + # Add backward compatibility methods or custom logic + pass +``` + +### 4.3 Update HTTP Proxy Package + +Update the corresponding files in `src/conductor/client/http/api/` to import from adapters: + +```python +# Example: src/conductor/client/http/api/workflow_resource_api.py +from conductor.client.adapters.api.workflow_resource_api_adapter import WorkflowResourceApiAdapter + +WorkflowResourceApi = WorkflowResourceApiAdapter + +__all__ = ["WorkflowResourceApi"] +``` + +### 4.4 Update Model Imports + +Update model imports in `src/conductor/client/http/models/`: + +```python +# Example: src/conductor/client/http/models/workflow.py +from conductor.client.adapters.models.workflow_adapter import WorkflowAdapter + +Workflow = WorkflowAdapter + +__all__ = ["Workflow"] +``` + +## Step 5: Run Tests and Handle Breaking Changes + +### 5.1 Run Backward Compatibility Tests + +```bash +# Run all backward compatibility tests +python -m pytest tests/backwardcompatibility/ -v + +# Run specific test categories +python -m pytest tests/backwardcompatibility/test_bc_workflow.py -v +python -m pytest tests/backwardcompatibility/test_bc_task.py -v +``` + +### 5.2 Run Serialization/Deserialization Tests + +```bash +# Run all serdeser tests +python -m pytest tests/serdesertest/ -v + +# Run pydantic-specific tests +python -m pytest tests/serdesertest/pydantic/ -v +``` + +### 5.3 Run Integration Tests + +```bash +# Run all integration tests +python -m pytest tests/integration/ -v + +# Run specific integration tests +python -m pytest tests/integration/test_orkes_workflow_client_integration.py -v +python -m pytest tests/integration/test_orkes_task_client_integration.py -v +``` + +### 5.4 Handle Breaking Changes + +If tests fail due to breaking changes: + +1. **Identify Breaking Changes**: + - Review test failures + - Check for removed methods or changed signatures + - Identify modified model structures + +2. **Update Adapters**: + - Add backward compatibility methods to adapters + - Implement deprecated method aliases + - Handle parameter changes with default values + +3. **Example Adapter Update**: + ```python + class WorkflowResourceApiAdapter(WorkflowResourceApi): + def start_workflow_legacy(self, workflow_id, input_data=None, **kwargs): + """Backward compatibility method for old start_workflow signature""" + # Convert old parameters to new format + start_request = StartWorkflowRequest( + name=workflow_id, + input=input_data, + **kwargs + ) + return self.start_workflow(start_request) + + # Alias for backward compatibility + start_workflow_v1 = start_workflow_legacy + ``` + +4. **Update Tests**: + - Add tests for new functionality + - Update existing tests if needed + - Ensure backward compatibility tests pass + +### 5.5 Final Verification + +```bash +# Run all tests to ensure everything works +python -m pytest tests/ -v + +# Run specific test suites +python -m pytest tests/backwardcompatibility/ tests/serdesertest/ tests/integration/ -v + +# Check for any linting issues +python -m flake8 src/conductor/client/ +python -m mypy src/conductor/client/ +``` + +## Troubleshooting + +### Common Issues + +1. **Import Errors**: Check that all generated files have correct package imports +2. **Missing Dependencies**: Ensure all required packages are installed +3. **Test Failures**: Review adapter implementations for missing backward compatibility +4. **Model Changes**: Update adapters to handle structural changes in models + +### Recovery Steps + +If the regeneration process fails: + +1. **Restore Backup**: + ```bash + rm -rf src/conductor/client/codegen + mv src/conductor/client/codegen.backup src/conductor/client/codegen + ``` + +2. **Incremental Updates**: Instead of full replacement, update specific APIs one at a time + +3. **Manual Fixes**: Apply targeted fixes to specific adapters or models + +## Best Practices + +1. **Version Control**: Always commit changes before starting regeneration +2. **Incremental Updates**: Test each API client individually when possible +3. **Documentation**: Update API documentation for any new features +4. **Backward Compatibility**: Prioritize maintaining existing API contracts +5. **Testing**: Run tests frequently during the regeneration process + +## File Structure Reference + +``` +src/conductor/client/ +├── codegen/ # Generated client code (replaced in step 3) +│ ├── api/ # Generated API clients +│ ├── models/ # Generated model classes +│ └── api_client.py # Generated API client base +├── adapters/ # Adapter layer (created in step 4) +│ ├── api/ # API client adapters +│ └── models/ # Model adapters +├── http/ # Proxy package (updated in step 4) +│ ├── api/ # Imports from adapters +│ └── models/ # Imports from adapters +└── orkes/ # Orkes-specific implementations + ├── orkes_*_client.py # Orkes client implementations + └── models/ # Orkes-specific models +``` + +## Testing Structure Reference + +``` +tests/ +├── backwardcompatibility/ # Tests for backward compatibility +├── serdesertest/ # Serialization/deserialization tests +│ └── pydantic/ # Pydantic-specific tests +└── integration/ # Integration tests + ├── test_orkes_*_client_integration.py + └── test_conductor_oss_workflow_integration.py +``` + +This guide ensures a systematic approach to client regeneration while maintaining backward compatibility and code quality. diff --git a/src/conductor/client/adapters/__init__.py b/src/conductor/client/adapters/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/conductor/client/adapters/api/__init__.py b/src/conductor/client/adapters/api/__init__.py new file mode 100644 index 00000000..a00918df --- /dev/null +++ b/src/conductor/client/adapters/api/__init__.py @@ -0,0 +1,90 @@ +from conductor.client.adapters.api.admin_resource_api_adapter import \ + AdminResourceApiAdapter as AdminResourceApi +from conductor.client.adapters.api.application_resource_api_adapter import \ + ApplicationResourceApiAdapter as ApplicationResourceApi +from conductor.client.adapters.api.authorization_resource_api_adapter import \ + AuthorizationResourceApiAdapter as AuthorizationResourceApi +from conductor.client.adapters.api.environment_resource_api_adapter import \ + EnvironmentResourceApiAdapter as EnvironmentResourceApi +from conductor.client.adapters.api.event_execution_resource_api_adapter import \ + EventExecutionResourceApiAdapter as EventExecutionResourceApi +from conductor.client.adapters.api.event_message_resource_api_adapter import \ + EventMessageResourceApiAdapter as EventMessageResourceApi +from conductor.client.adapters.api.event_resource_api_adapter import \ + EventResourceApiAdapter as EventResourceApi +from conductor.client.adapters.api.group_resource_api_adapter import \ + GroupResourceApiAdapter as GroupResourceApi +from conductor.client.adapters.api.incoming_webhook_resource_api_adapter import \ + IncomingWebhookResourceApiAdapter as IncomingWebhookResourceApi +from conductor.client.adapters.api.integration_resource_api_adapter import \ + IntegrationResourceApiAdapter as IntegrationResourceApi +from conductor.client.adapters.api.limits_resource_api_adapter import \ + LimitsResourceApiAdapter as LimitsResourceApi +from conductor.client.adapters.api.metadata_resource_api_adapter import \ + MetadataResourceApiAdapter as MetadataResourceApi +from conductor.client.adapters.api.metrics_resource_api_adapter import \ + MetricsResourceApiAdapter as MetricsResourceApi +from conductor.client.adapters.api.metrics_token_resource_api_adapter import \ + MetricsTokenResourceApiAdapter as MetricsTokenResourceApi +from conductor.client.adapters.api.prompt_resource_api_adapter import \ + PromptResourceApiAdapter as PromptResourceApi +from conductor.client.adapters.api.queue_admin_resource_api_adapter import \ + QueueAdminResourceApiAdapter as QueueAdminResourceApi +from conductor.client.adapters.api.scheduler_bulk_resource_api_adapter import \ + SchedulerBulkResourceApiAdapter as SchedulerBulkResourceApi +from conductor.client.adapters.api.scheduler_resource_api_adapter import \ + SchedulerResourceApiAdapter as SchedulerResourceApi +from conductor.client.adapters.api.schema_resource_api_adapter import \ + SchemaResourceApiAdapter as SchemaResourceApi +from conductor.client.adapters.api.secret_resource_api_adapter import \ + SecretResourceApiAdapter as SecretResourceApi +from conductor.client.adapters.api.service_registry_resource_api_adapter import \ + ServiceRegistryResourceApiAdapter as ServiceRegistryResourceApi +from conductor.client.adapters.api.tags_api_adapter import \ + TagsApiAdapter as TagsApi +from conductor.client.adapters.api.task_resource_api_adapter import \ + TaskResourceApiAdapter as TaskResourceApi +from conductor.client.adapters.api.token_resource_api_adapter import \ + TokenResourceApiAdapter as TokenResourceApi +from conductor.client.adapters.api.user_resource_api_adapter import \ + UserResourceApiAdapter as UserResourceApi +from conductor.client.adapters.api.version_resource_api_adapter import \ + VersionResourceApiAdapter as VersionResourceApi +from conductor.client.adapters.api.webhooks_config_resource_api_adapter import \ + WebhooksConfigResourceApiAdapter as WebhooksConfigResourceApi +from conductor.client.adapters.api.workflow_bulk_resource_api_adapter import \ + WorkflowBulkResourceApiAdapter as WorkflowBulkResourceApi +from conductor.client.adapters.api.workflow_resource_api_adapter import \ + WorkflowResourceApiAdapter as WorkflowResourceApi + +__all__ = [ + "AdminResourceApi", + "ApplicationResourceApi", + "AuthorizationResourceApi", + "EnvironmentResourceApi", + "EventExecutionResourceApi", + "EventMessageResourceApi", + "EventResourceApi", + "GroupResourceApi", + "IncomingWebhookResourceApi", + "IntegrationResourceApi", + "LimitsResourceApi", + "MetadataResourceApi", + "MetricsResourceApi", + "MetricsTokenResourceApi", + "PromptResourceApi", + "QueueAdminResourceApi", + "SchedulerBulkResourceApi", + "SchedulerResourceApi", + "SchemaResourceApi", + "SecretResourceApi", + "ServiceRegistryResourceApi", + "TagsApi", + "TaskResourceApi", + "TokenResourceApi", + "UserResourceApi", + "VersionResourceApi", + "WebhooksConfigResourceApi", + "WorkflowBulkResourceApi", + "WorkflowResourceApi", +] diff --git a/src/conductor/client/adapters/api/admin_resource_api_adapter.py b/src/conductor/client/adapters/api/admin_resource_api_adapter.py new file mode 100644 index 00000000..65b77122 --- /dev/null +++ b/src/conductor/client/adapters/api/admin_resource_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.api.admin_resource_api import AdminResourceApi + + +class AdminResourceApiAdapter(AdminResourceApi): ... diff --git a/src/conductor/client/adapters/api/application_resource_api_adapter.py b/src/conductor/client/adapters/api/application_resource_api_adapter.py new file mode 100644 index 00000000..9c31426b --- /dev/null +++ b/src/conductor/client/adapters/api/application_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.application_resource_api import \ + ApplicationResourceApi + + +class ApplicationResourceApiAdapter(ApplicationResourceApi): ... diff --git a/src/conductor/client/adapters/api/authorization_resource_api_adapter.py b/src/conductor/client/adapters/api/authorization_resource_api_adapter.py new file mode 100644 index 00000000..589df3f6 --- /dev/null +++ b/src/conductor/client/adapters/api/authorization_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.authorization_resource_api import \ + AuthorizationResourceApi + + +class AuthorizationResourceApiAdapter(AuthorizationResourceApi): ... diff --git a/src/conductor/client/adapters/api/environment_resource_api_adapter.py b/src/conductor/client/adapters/api/environment_resource_api_adapter.py new file mode 100644 index 00000000..73a50237 --- /dev/null +++ b/src/conductor/client/adapters/api/environment_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.environment_resource_api import \ + EnvironmentResourceApi + + +class EnvironmentResourceApiAdapter(EnvironmentResourceApi): ... diff --git a/src/conductor/client/adapters/api/event_execution_resource_api_adapter.py b/src/conductor/client/adapters/api/event_execution_resource_api_adapter.py new file mode 100644 index 00000000..57ff99ce --- /dev/null +++ b/src/conductor/client/adapters/api/event_execution_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.event_execution_resource_api import \ + EventExecutionResourceApi + + +class EventExecutionResourceApiAdapter(EventExecutionResourceApi): ... diff --git a/src/conductor/client/adapters/api/event_message_resource_api_adapter.py b/src/conductor/client/adapters/api/event_message_resource_api_adapter.py new file mode 100644 index 00000000..6f8e146d --- /dev/null +++ b/src/conductor/client/adapters/api/event_message_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.event_message_resource_api import \ + EventMessageResourceApi + + +class EventMessageResourceApiAdapter(EventMessageResourceApi): ... diff --git a/src/conductor/client/adapters/api/event_resource_api_adapter.py b/src/conductor/client/adapters/api/event_resource_api_adapter.py new file mode 100644 index 00000000..7e1d2e23 --- /dev/null +++ b/src/conductor/client/adapters/api/event_resource_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.api.event_resource_api import EventResourceApi + + +class EventResourceApiAdapter(EventResourceApi): ... diff --git a/src/conductor/client/adapters/api/group_resource_api_adapter.py b/src/conductor/client/adapters/api/group_resource_api_adapter.py new file mode 100644 index 00000000..cf9f1f36 --- /dev/null +++ b/src/conductor/client/adapters/api/group_resource_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.api.group_resource_api import GroupResourceApi + + +class GroupResourceApiAdapter(GroupResourceApi): ... diff --git a/src/conductor/client/adapters/api/incoming_webhook_resource_api_adapter.py b/src/conductor/client/adapters/api/incoming_webhook_resource_api_adapter.py new file mode 100644 index 00000000..63ab1dbf --- /dev/null +++ b/src/conductor/client/adapters/api/incoming_webhook_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.incoming_webhook_resource_api import \ + IncomingWebhookResourceApi + + +class IncomingWebhookResourceApiAdapter(IncomingWebhookResourceApi): ... diff --git a/src/conductor/client/adapters/api/integration_resource_api_adapter.py b/src/conductor/client/adapters/api/integration_resource_api_adapter.py new file mode 100644 index 00000000..d2d7f341 --- /dev/null +++ b/src/conductor/client/adapters/api/integration_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.integration_resource_api import \ + IntegrationResourceApi + + +class IntegrationResourceApiAdapter(IntegrationResourceApi): ... diff --git a/src/conductor/client/adapters/api/limits_resource_api_adapter.py b/src/conductor/client/adapters/api/limits_resource_api_adapter.py new file mode 100644 index 00000000..7d10e263 --- /dev/null +++ b/src/conductor/client/adapters/api/limits_resource_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.api.limits_resource_api import LimitsResourceApi + + +class LimitsResourceApiAdapter(LimitsResourceApi): ... diff --git a/src/conductor/client/adapters/api/metadata_resource_api_adapter.py b/src/conductor/client/adapters/api/metadata_resource_api_adapter.py new file mode 100644 index 00000000..dcc4ed72 --- /dev/null +++ b/src/conductor/client/adapters/api/metadata_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.metadata_resource_api import \ + MetadataResourceApi + + +class MetadataResourceApiAdapter(MetadataResourceApi): ... diff --git a/src/conductor/client/adapters/api/metrics_resource_api_adapter.py b/src/conductor/client/adapters/api/metrics_resource_api_adapter.py new file mode 100644 index 00000000..40fb97af --- /dev/null +++ b/src/conductor/client/adapters/api/metrics_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.metrics_resource_api import \ + MetricsResourceApi + + +class MetricsResourceApiAdapter(MetricsResourceApi): ... diff --git a/src/conductor/client/adapters/api/metrics_token_resource_api_adapter.py b/src/conductor/client/adapters/api/metrics_token_resource_api_adapter.py new file mode 100644 index 00000000..1849a93f --- /dev/null +++ b/src/conductor/client/adapters/api/metrics_token_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.metrics_token_resource_api import \ + MetricsTokenResourceApi + + +class MetricsTokenResourceApiAdapter(MetricsTokenResourceApi): ... diff --git a/src/conductor/client/adapters/api/prompt_resource_api_adapter.py b/src/conductor/client/adapters/api/prompt_resource_api_adapter.py new file mode 100644 index 00000000..e32d4a4c --- /dev/null +++ b/src/conductor/client/adapters/api/prompt_resource_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.api.prompt_resource_api import PromptResourceApi + + +class PromptResourceApiAdapter(PromptResourceApi): ... diff --git a/src/conductor/client/adapters/api/queue_admin_resource_api_adapter.py b/src/conductor/client/adapters/api/queue_admin_resource_api_adapter.py new file mode 100644 index 00000000..2f836f57 --- /dev/null +++ b/src/conductor/client/adapters/api/queue_admin_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.queue_admin_resource_api import \ + QueueAdminResourceApi + + +class QueueAdminResourceApiAdapter(QueueAdminResourceApi): ... diff --git a/src/conductor/client/adapters/api/scheduler_bulk_resource_api_adapter.py b/src/conductor/client/adapters/api/scheduler_bulk_resource_api_adapter.py new file mode 100644 index 00000000..b58a098f --- /dev/null +++ b/src/conductor/client/adapters/api/scheduler_bulk_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.scheduler_bulk_resource_api import \ + SchedulerBulkResourceApi + + +class SchedulerBulkResourceApiAdapter(SchedulerBulkResourceApi): ... diff --git a/src/conductor/client/adapters/api/scheduler_resource_api_adapter.py b/src/conductor/client/adapters/api/scheduler_resource_api_adapter.py new file mode 100644 index 00000000..ca2edf9d --- /dev/null +++ b/src/conductor/client/adapters/api/scheduler_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.scheduler_resource_api import \ + SchedulerResourceApi + + +class SchedulerResourceApiAdapter(SchedulerResourceApi): ... diff --git a/src/conductor/client/adapters/api/schema_resource_api_adapter.py b/src/conductor/client/adapters/api/schema_resource_api_adapter.py new file mode 100644 index 00000000..7884c01d --- /dev/null +++ b/src/conductor/client/adapters/api/schema_resource_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.api.schema_resource_api import SchemaResourceApi + + +class SchemaResourceApiAdapter(SchemaResourceApi): ... diff --git a/src/conductor/client/adapters/api/secret_resource_api_adapter.py b/src/conductor/client/adapters/api/secret_resource_api_adapter.py new file mode 100644 index 00000000..090a63a2 --- /dev/null +++ b/src/conductor/client/adapters/api/secret_resource_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.api.secret_resource_api import SecretResourceApi + + +class SecretResourceApiAdapter(SecretResourceApi): ... diff --git a/src/conductor/client/adapters/api/service_registry_resource_api_adapter.py b/src/conductor/client/adapters/api/service_registry_resource_api_adapter.py new file mode 100644 index 00000000..7d0b9525 --- /dev/null +++ b/src/conductor/client/adapters/api/service_registry_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.service_registry_resource_api import \ + ServiceRegistryResourceApi + + +class ServiceRegistryResourceApiAdapter(ServiceRegistryResourceApi): ... diff --git a/src/conductor/client/adapters/api/tags_api_adapter.py b/src/conductor/client/adapters/api/tags_api_adapter.py new file mode 100644 index 00000000..4684a8c0 --- /dev/null +++ b/src/conductor/client/adapters/api/tags_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.orkes.api.tags_api import TagsApi + + +class TagsApiAdapter(TagsApi): ... diff --git a/src/conductor/client/adapters/api/task_resource_api_adapter.py b/src/conductor/client/adapters/api/task_resource_api_adapter.py new file mode 100644 index 00000000..e60bfc27 --- /dev/null +++ b/src/conductor/client/adapters/api/task_resource_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.api.task_resource_api import TaskResourceApi + + +class TaskResourceApiAdapter(TaskResourceApi): ... diff --git a/src/conductor/client/adapters/api/token_resource_api_adapter.py b/src/conductor/client/adapters/api/token_resource_api_adapter.py new file mode 100644 index 00000000..5a789cab --- /dev/null +++ b/src/conductor/client/adapters/api/token_resource_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.api.token_resource_api import TokenResourceApi + + +class TokenResourceApiAdapter(TokenResourceApi): ... diff --git a/src/conductor/client/adapters/api/user_resource_api_adapter.py b/src/conductor/client/adapters/api/user_resource_api_adapter.py new file mode 100644 index 00000000..5565385f --- /dev/null +++ b/src/conductor/client/adapters/api/user_resource_api_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.api.user_resource_api import UserResourceApi + + +class UserResourceApiAdapter(UserResourceApi): ... diff --git a/src/conductor/client/adapters/api/version_resource_api_adapter.py b/src/conductor/client/adapters/api/version_resource_api_adapter.py new file mode 100644 index 00000000..aba4f21f --- /dev/null +++ b/src/conductor/client/adapters/api/version_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.version_resource_api import \ + VersionResourceApi + + +class VersionResourceApiAdapter(VersionResourceApi): ... diff --git a/src/conductor/client/adapters/api/webhooks_config_resource_api_adapter.py b/src/conductor/client/adapters/api/webhooks_config_resource_api_adapter.py new file mode 100644 index 00000000..fa43a8da --- /dev/null +++ b/src/conductor/client/adapters/api/webhooks_config_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.webhooks_config_resource_api import \ + WebhooksConfigResourceApi + + +class WebhooksConfigResourceApiAdapter(WebhooksConfigResourceApi): ... diff --git a/src/conductor/client/adapters/api/workflow_bulk_resource_api_adapter.py b/src/conductor/client/adapters/api/workflow_bulk_resource_api_adapter.py new file mode 100644 index 00000000..9aa21bcc --- /dev/null +++ b/src/conductor/client/adapters/api/workflow_bulk_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.workflow_bulk_resource_api import \ + WorkflowBulkResourceApi + + +class WorkflowBulkResourceApiAdapter(WorkflowBulkResourceApi): ... diff --git a/src/conductor/client/adapters/api/workflow_resource_api_adapter.py b/src/conductor/client/adapters/api/workflow_resource_api_adapter.py new file mode 100644 index 00000000..d9a365c0 --- /dev/null +++ b/src/conductor/client/adapters/api/workflow_resource_api_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.api.workflow_resource_api import \ + WorkflowResourceApi + + +class WorkflowResourceApiAdapter(WorkflowResourceApi): ... diff --git a/src/conductor/client/adapters/api_client_adapter.py b/src/conductor/client/adapters/api_client_adapter.py new file mode 100644 index 00000000..55f97701 --- /dev/null +++ b/src/conductor/client/adapters/api_client_adapter.py @@ -0,0 +1,97 @@ +import logging + +from conductor.client.codegen.api_client import ApiClient +from conductor.client.configuration.configuration import Configuration +from conductor.client.adapters.rest_adapter import RESTClientObjectAdapter + +from conductor.client.codegen.rest import AuthorizationException, ApiException + +logger = logging.getLogger(Configuration.get_logging_formatted_name(__name__)) + + +class ApiClientAdapter(ApiClient): + def __init__( + self, configuration=None, header_name=None, header_value=None, cookie=None + ): + """Initialize the API client adapter with httpx-based REST client.""" + super().__init__(configuration, header_name, header_value, cookie) + self.rest_client = RESTClientObjectAdapter( + connection=configuration.http_connection if configuration else None + ) + + def __call_api( + self, + resource_path, + method, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_type=None, + auth_settings=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + ): + try: + logger.debug( + "HTTP request method: %s; resource_path: %s; header_params: %s", + method, + resource_path, + header_params, + ) + return self.__call_api_no_retry( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + body=body, + post_params=post_params, + files=files, + response_type=response_type, + auth_settings=auth_settings, + _return_http_data_only=_return_http_data_only, + collection_formats=collection_formats, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) + except AuthorizationException as ae: + if ae.token_expired or ae.invalid_token: + token_status = "expired" if ae.token_expired else "invalid" + logger.warning( + "HTTP response from: %s; token_status: %s; status code: 401 - obtaining new token", + resource_path, + token_status, + ) + # if the token has expired or is invalid, lets refresh the token + self.__force_refresh_auth_token() + # and now retry the same request + return self.__call_api_no_retry( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + body=body, + post_params=post_params, + files=files, + response_type=response_type, + auth_settings=auth_settings, + _return_http_data_only=_return_http_data_only, + collection_formats=collection_formats, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) + raise ae + except ApiException as e: + logger.error( + "HTTP request failed url: %s status: %s; reason: %s", + resource_path, + e.status, + e.reason, + ) + raise e diff --git a/src/conductor/client/adapters/models/__init__.py b/src/conductor/client/adapters/models/__init__.py new file mode 100644 index 00000000..c27b9c60 --- /dev/null +++ b/src/conductor/client/adapters/models/__init__.py @@ -0,0 +1,398 @@ +from conductor.client.adapters.models.action_adapter import \ + ActionAdapter as Action +from conductor.client.adapters.models.any_adapter import AnyAdapter as Any +from conductor.client.adapters.models.authorization_request_adapter import \ + AuthorizationRequestAdapter as AuthorizationRequest +from conductor.client.adapters.models.bulk_response_adapter import \ + BulkResponseAdapter as BulkResponse +from conductor.client.adapters.models.byte_string_adapter import \ + ByteStringAdapter as ByteString +from conductor.client.adapters.models.cache_config_adapter import \ + CacheConfigAdapter as CacheConfig +from conductor.client.adapters.models.conductor_user_adapter import \ + ConductorUserAdapter as ConductorUser +from conductor.client.adapters.models.connectivity_test_input_adapter import \ + ConnectivityTestInputAdapter as ConnectivityTestInput +from conductor.client.adapters.models.connectivity_test_result_adapter import \ + ConnectivityTestResultAdapter as ConnectivityTestResult +from conductor.client.adapters.models.correlation_ids_search_request_adapter import \ + CorrelationIdsSearchRequestAdapter as CorrelationIdsSearchRequest +from conductor.client.adapters.models.create_or_update_application_request_adapter import \ + CreateOrUpdateApplicationRequestAdapter as CreateOrUpdateApplicationRequest +from conductor.client.adapters.models.declaration_adapter import \ + DeclarationAdapter as Declaration +from conductor.client.adapters.models.declaration_or_builder_adapter import \ + DeclarationOrBuilderAdapter as DeclarationOrBuilder +from conductor.client.adapters.models.descriptor_adapter import \ + DescriptorAdapter as Descriptor +from conductor.client.adapters.models.descriptor_proto_adapter import \ + DescriptorProtoAdapter as DescriptorProto +from conductor.client.adapters.models.descriptor_proto_or_builder_adapter import \ + DescriptorProtoOrBuilderAdapter as DescriptorProtoOrBuilder +from conductor.client.adapters.models.edition_default_adapter import \ + EditionDefaultAdapter as EditionDefault +from conductor.client.adapters.models.edition_default_or_builder_adapter import \ + EditionDefaultOrBuilderAdapter as EditionDefaultOrBuilder +from conductor.client.adapters.models.enum_descriptor_adapter import \ + EnumDescriptorAdapter as EnumDescriptor +from conductor.client.adapters.models.enum_descriptor_proto_adapter import \ + EnumDescriptorProtoAdapter as EnumDescriptorProto +from conductor.client.adapters.models.enum_descriptor_proto_or_builder_adapter import \ + EnumDescriptorProtoOrBuilderAdapter as EnumDescriptorProtoOrBuilder +from conductor.client.adapters.models.enum_options_adapter import \ + EnumOptionsAdapter as EnumOptions +from conductor.client.adapters.models.enum_options_or_builder_adapter import \ + EnumOptionsOrBuilderAdapter as EnumOptionsOrBuilder +from conductor.client.adapters.models.enum_reserved_range_adapter import \ + EnumReservedRangeAdapter as EnumReservedRange +from conductor.client.adapters.models.enum_reserved_range_or_builder_adapter import \ + EnumReservedRangeOrBuilderAdapter as EnumReservedRangeOrBuilder +from conductor.client.adapters.models.enum_value_descriptor_adapter import \ + EnumValueDescriptorAdapter as EnumValueDescriptor +from conductor.client.adapters.models.enum_value_descriptor_proto_adapter import \ + EnumValueDescriptorProtoAdapter as EnumValueDescriptorProto +from conductor.client.adapters.models.enum_value_descriptor_proto_or_builder_adapter import \ + EnumValueDescriptorProtoOrBuilderAdapter as \ + EnumValueDescriptorProtoOrBuilder +from conductor.client.adapters.models.enum_value_options_adapter import \ + EnumValueOptionsAdapter as EnumValueOptions +from conductor.client.adapters.models.enum_value_options_or_builder_adapter import \ + EnumValueOptionsOrBuilderAdapter as EnumValueOptionsOrBuilder +from conductor.client.adapters.models.environment_variable_adapter import \ + EnvironmentVariableAdapter as EnvironmentVariable +from conductor.client.adapters.models.event_handler_adapter import \ + EventHandlerAdapter as EventHandler +from conductor.client.adapters.models.event_log_adapter import \ + EventLogAdapter as EventLog +from conductor.client.adapters.models.extended_conductor_application_adapter import \ + ExtendedConductorApplicationAdapter as ConductorApplication +from conductor.client.adapters.models.extended_conductor_application_adapter import \ + ExtendedConductorApplicationAdapter as ExtendedConductorApplication +from conductor.client.adapters.models.extended_event_execution_adapter import \ + ExtendedEventExecutionAdapter as ExtendedEventExecution +from conductor.client.adapters.models.extended_secret_adapter import \ + ExtendedSecretAdapter as ExtendedSecret +from conductor.client.adapters.models.extended_task_def_adapter import \ + ExtendedTaskDefAdapter as ExtendedTaskDef +from conductor.client.adapters.models.extended_workflow_def_adapter import \ + ExtendedWorkflowDefAdapter as ExtendedWorkflowDef +from conductor.client.adapters.models.extension_range_adapter import \ + ExtensionRangeAdapter as ExtensionRange +from conductor.client.adapters.models.extension_range_options_adapter import \ + ExtensionRangeOptionsAdapter as ExtensionRangeOptions +from conductor.client.adapters.models.extension_range_options_or_builder_adapter import \ + ExtensionRangeOptionsOrBuilderAdapter as ExtensionRangeOptionsOrBuilder +from conductor.client.adapters.models.extension_range_or_builder_adapter import \ + ExtensionRangeOrBuilderAdapter as ExtensionRangeOrBuilder +from conductor.client.adapters.models.feature_set_adapter import \ + FeatureSetAdapter as FeatureSet +from conductor.client.adapters.models.feature_set_or_builder_adapter import \ + FeatureSetOrBuilderAdapter as FeatureSetOrBuilder +from conductor.client.adapters.models.field_descriptor_adapter import \ + FieldDescriptorAdapter as FieldDescriptor +from conductor.client.adapters.models.field_descriptor_proto_adapter import \ + FieldDescriptorProtoAdapter as FieldDescriptorProto +from conductor.client.adapters.models.field_descriptor_proto_or_builder_adapter import \ + FieldDescriptorProtoOrBuilderAdapter as FieldDescriptorProtoOrBuilder +from conductor.client.adapters.models.field_options_adapter import \ + FieldOptionsAdapter as FieldOptions +from conductor.client.adapters.models.field_options_or_builder_adapter import \ + FieldOptionsOrBuilderAdapter as FieldOptionsOrBuilder +from conductor.client.adapters.models.file_descriptor_adapter import \ + FileDescriptorAdapter as FileDescriptor +from conductor.client.adapters.models.file_descriptor_proto_adapter import \ + FileDescriptorProtoAdapter as FileDescriptorProto +from conductor.client.adapters.models.file_options_adapter import \ + FileOptionsAdapter as FileOptions +from conductor.client.adapters.models.file_options_or_builder_adapter import \ + FileOptionsOrBuilderAdapter as FileOptionsOrBuilder +from conductor.client.adapters.models.generate_token_request_adapter import \ + GenerateTokenRequestAdapter as GenerateTokenRequest +from conductor.client.adapters.models.granted_access_adapter import \ + GrantedAccessAdapter as GrantedAccess +from conductor.client.adapters.models.granted_access_response_adapter import \ + GrantedAccessResponseAdapter as GrantedAccessResponse +from conductor.client.adapters.models.group_adapter import \ + GroupAdapter as Group +from conductor.client.adapters.models.handled_event_response_adapter import \ + HandledEventResponseAdapter as HandledEventResponse +from conductor.client.adapters.models.health import Health +from conductor.client.adapters.models.health_check_status import \ + HealthCheckStatus +from conductor.client.adapters.models.integration_adapter import \ + IntegrationAdapter as Integration +from conductor.client.adapters.models.integration_api_adapter import \ + IntegrationApiAdapter as IntegrationApi +from conductor.client.adapters.models.integration_api_update_adapter import \ + IntegrationApiUpdateAdapter as IntegrationApiUpdate +from conductor.client.adapters.models.integration_def_adapter import \ + IntegrationDefAdapter as IntegrationDef +from conductor.client.adapters.models.integration_def_api_adapter import \ + IntegrationDefApi +from conductor.client.adapters.models.integration_def_form_field_adapter import \ + IntegrationDefFormFieldAdapter as IntegrationDefFormField +from conductor.client.adapters.models.integration_update_adapter import \ + IntegrationUpdateAdapter as IntegrationUpdate +from conductor.client.adapters.models.location_adapter import \ + LocationAdapter as Location +from conductor.client.adapters.models.location_or_builder_adapter import \ + LocationOrBuilderAdapter as LocationOrBuilder +from conductor.client.adapters.models.message_adapter import \ + MessageAdapter as Message +from conductor.client.adapters.models.message_lite_adapter import \ + MessageLiteAdapter as MessageLite +from conductor.client.adapters.models.message_options_adapter import \ + MessageOptionsAdapter as MessageOptions +from conductor.client.adapters.models.message_options_or_builder_adapter import \ + MessageOptionsOrBuilderAdapter as MessageOptionsOrBuilder +from conductor.client.adapters.models.message_template_adapter import \ + MessageTemplateAdapter as MessageTemplate +from conductor.client.adapters.models.method_descriptor_adapter import \ + MethodDescriptorAdapter as MethodDescriptor +from conductor.client.adapters.models.method_descriptor_proto_adapter import \ + MethodDescriptorProtoAdapter as MethodDescriptorProto +from conductor.client.adapters.models.method_descriptor_proto_or_builder_adapter import \ + MethodDescriptorProtoOrBuilderAdapter as MethodDescriptorProtoOrBuilder +from conductor.client.adapters.models.method_options_adapter import \ + MethodOptionsAdapter as MethodOptions +from conductor.client.adapters.models.method_options_or_builder_adapter import \ + MethodOptionsOrBuilderAdapter as MethodOptionsOrBuilder +from conductor.client.adapters.models.metrics_token_adapter import \ + MetricsTokenAdapter as MetricsToken +from conductor.client.adapters.models.name_part_adapter import \ + NamePartAdapter as NamePart +from conductor.client.adapters.models.name_part_or_builder_adapter import \ + NamePartOrBuilderAdapter as NamePartOrBuilder +from conductor.client.adapters.models.oneof_descriptor_adapter import \ + OneofDescriptorAdapter as OneofDescriptor +from conductor.client.adapters.models.oneof_descriptor_proto_adapter import \ + OneofDescriptorProtoAdapter as OneofDescriptorProto +from conductor.client.adapters.models.oneof_descriptor_proto_or_builder_adapter import \ + OneofDescriptorProtoOrBuilderAdapter as OneofDescriptorProtoOrBuilder +from conductor.client.adapters.models.oneof_options_adapter import \ + OneofOptionsAdapter as OneofOptions +from conductor.client.adapters.models.oneof_options_or_builder_adapter import \ + OneofOptionsOrBuilderAdapter as OneofOptionsOrBuilder +from conductor.client.adapters.models.option_adapter import \ + OptionAdapter as Option +from conductor.client.adapters.models.permission_adapter import \ + PermissionAdapter as Permission +from conductor.client.adapters.models.poll_data_adapter import \ + PollDataAdapter as PollData +from conductor.client.adapters.models.prompt_template_adapter import \ + PromptTemplateAdapter as PromptTemplate +from conductor.client.adapters.models.prompt_template_test_request_adapter import \ + PromptTemplateTestRequestAdapter as PromptTemplateTestRequest +from conductor.client.adapters.models.rate_limit_adapter import \ + RateLimitAdapter as RateLimit +from conductor.client.adapters.models.rate_limit_config_adapter import \ + RateLimitConfigAdapter as RateLimitConfig +from conductor.client.adapters.models.request_param_adapter import \ + RequestParamAdapter as RequestParam +from conductor.client.adapters.models.request_param_adapter import \ + SchemaAdapter as Schema +from conductor.client.adapters.models.rerun_workflow_request_adapter import \ + RerunWorkflowRequestAdapter as RerunWorkflowRequest +from conductor.client.adapters.models.response_adapter import \ + ResponseAdapter as Response +from conductor.client.adapters.models.role_adapter import RoleAdapter as Role +from conductor.client.adapters.models.schema_def_adapter import \ + SchemaDefAdapter as SchemaDef +from conductor.client.adapters.models.schema_def_adapter import SchemaType +from conductor.client.adapters.models.scrollable_search_result_workflow_summary_adapter import \ + ScrollableSearchResultWorkflowSummaryAdapter as \ + ScrollableSearchResultWorkflowSummary +from conductor.client.adapters.models.search_result_workflow_schedule_execution_model_adapter import \ + SearchResultWorkflowScheduleExecutionModelAdapter as \ + SearchResultWorkflowScheduleExecutionModel +from conductor.client.adapters.models.service_method_adapter import \ + ServiceMethodAdapter as ServiceMethod +from conductor.client.adapters.models.service_registry_adapter import \ + ConfigAdapter as Config +from conductor.client.adapters.models.service_registry_adapter import \ + OrkesCircuitBreakerConfigAdapter as OrkesCircuitBreakerConfig +from conductor.client.adapters.models.service_registry_adapter import \ + ServiceRegistryAdapter as ServiceRegistry +from conductor.client.adapters.models.signal_response_adapter import \ + SignalResponseAdapter as SignalResponse +from conductor.client.adapters.models.start_workflow_request_adapter import \ + StartWorkflowRequestAdapter as StartWorkflowRequest +from conductor.client.adapters.models.state_change_event_adapter import \ + StateChangeEventAdapter as StateChangeEvent +from conductor.client.adapters.models.sub_workflow_params_adapter import \ + SubWorkflowParamsAdapter as SubWorkflowParams +from conductor.client.adapters.models.subject_ref_adapter import \ + SubjectRefAdapter as SubjectRef +from conductor.client.adapters.models.tag_adapter import TagAdapter as Tag +from conductor.client.adapters.models.target_ref_adapter import \ + TargetRefAdapter as TargetRef +from conductor.client.adapters.models.task_adapter import TaskAdapter as Task +from conductor.client.adapters.models.task_def_adapter import \ + TaskDefAdapter as TaskDef +from conductor.client.adapters.models.task_exec_log_adapter import \ + TaskExecLogAdapter as TaskExecLog +from conductor.client.adapters.models.task_result_adapter import \ + TaskResultAdapter as TaskResult +from conductor.client.adapters.models.token_adapter import \ + TokenAdapter as Token +from conductor.client.adapters.models.upsert_group_request_adapter import \ + UpsertGroupRequestAdapter as UpsertGroupRequest +from conductor.client.adapters.models.upsert_user_request_adapter import \ + UpsertUserRequestAdapter as UpsertUserRequest +from conductor.client.adapters.models.workflow_adapter import \ + WorkflowAdapter as Workflow +from conductor.client.adapters.models.workflow_def_adapter import \ + WorkflowDefAdapter as WorkflowDef +from conductor.client.adapters.models.workflow_run_adapter import \ + WorkflowRunAdapter as WorkflowRun +from conductor.client.adapters.models.workflow_schedule_adapter import \ + WorkflowScheduleAdapter as WorkflowSchedule +from conductor.client.adapters.models.workflow_schedule_execution_model_adapter import \ + WorkflowScheduleExecutionModelAdapter as WorkflowScheduleExecutionModel +from conductor.client.adapters.models.workflow_schedule_model_adapter import \ + WorkflowScheduleModelAdapter as WorkflowScheduleModel +from conductor.client.adapters.models.workflow_status_adapter import \ + WorkflowStatusAdapter as WorkflowStatus +from conductor.client.adapters.models.workflow_summary_adapter import \ + WorkflowSummaryAdapter as WorkflowSummary +from conductor.client.adapters.models.workflow_tag_adapter import \ + WorkflowTagAdapter as WorkflowTag +from conductor.client.adapters.models.workflow_task_adapter import \ + WorkflowTaskAdapter as WorkflowTask + +__all__ = [ # noqa: RUF022 + "Action", + "Any", + "AuthorizationRequest", + "BulkResponse", + "ByteString", + "CacheConfig", + "ConductorUser", + "ConnectivityTestInput", + "ConnectivityTestResult", + "CorrelationIdsSearchRequest", + "CreateOrUpdateApplicationRequest", + "Declaration", + "DeclarationOrBuilder", + "Descriptor", + "DescriptorProto", + "DescriptorProtoOrBuilder", + "EditionDefault", + "EditionDefaultOrBuilder", + "EnumDescriptor", + "EnumDescriptorProto", + "EnumDescriptorProtoOrBuilder", + "EnumOptions", + "EnumOptionsOrBuilder", + "EnumReservedRange", + "EnumReservedRangeOrBuilder", + "EnumValueDescriptor", + "EnumValueDescriptorProto", + "EnumValueDescriptorProtoOrBuilder", + "EnumValueOptions", + "EnumValueOptions", + "EnumValueOptionsOrBuilder", + "EnvironmentVariable", + "EventHandler", + "EventLog", + "ExtendedConductorApplication", + "ConductorApplication", + "ExtendedEventExecution", + "ExtendedSecret", + "ExtendedTaskDef", + "ExtendedWorkflowDef", + "ExtensionRange", + "ExtensionRangeOptions", + "ExtensionRangeOptionsOrBuilder", + "ExtensionRangeOrBuilder", + "FeatureSet", + "FeatureSet", + "FeatureSetOrBuilder", + "FieldDescriptor", + "FieldDescriptorProto", + "FieldDescriptorProtoOrBuilder", + "FieldOptions", + "FieldOptionsOrBuilder", + "FileDescriptor", + "FileDescriptorProto", + "FileOptions", + "FileOptionsOrBuilder", + "GenerateTokenRequest", + "GrantedAccess", + "GrantedAccessResponse", + "Group", + "HandledEventResponse", + "Integration", + "IntegrationApi", + "IntegrationApiUpdate", + "IntegrationDef", + "IntegrationDefFormField", + "IntegrationUpdate", + "Location", + "LocationOrBuilder", + "Message", + "MessageLite", + "MessageOptions", + "MessageOptionsOrBuilder", + "MessageTemplate", + "MethodDescriptor", + "MethodDescriptorProto", + "MethodDescriptorProtoOrBuilder", + "MethodOptions", + "MethodOptionsOrBuilder", + "MetricsToken", + "NamePart", + "NamePartOrBuilder", + "OneofDescriptor", + "OneofDescriptorProto", + "OneofDescriptorProtoOrBuilder", + "OneofOptions", + "OneofOptionsOrBuilder", + "Option", + "Permission", + "PollData", + "PromptTemplateTestRequest", + "RateLimit", + "RerunWorkflowRequest", + "Response", + "Task", + "TaskResult", + "WorkflowTask", + "UpsertUserRequest", + "PromptTemplate", + "WorkflowSchedule", + "WorkflowTag", + "Role", + "Token", + "Tag", + "UpsertGroupRequest", + "TargetRef", + "SubjectRef", + "TaskDef", + "WorkflowDef", + "SubWorkflowParams", + "StateChangeEvent", + "TaskExecLog", + "Workflow", + "SchemaDef", + "RateLimitConfig", + "StartWorkflowRequest", + "WorkflowScheduleModel", + "SearchResultWorkflowScheduleExecutionModel", + "WorkflowScheduleExecutionModel", + "WorkflowRun", + "SignalResponse", + "WorkflowStatus", + "ScrollableSearchResultWorkflowSummary", + "WorkflowSummary", + "IntegrationDefApi", + "ServiceRegistry", + "Config", + "OrkesCircuitBreakerConfig", + "ServiceMethod", + "RequestParam", + "Schema", + "SchemaType", + "HealthCheckStatus", + "Health", +] diff --git a/src/conductor/client/adapters/models/action_adapter.py b/src/conductor/client/adapters/models/action_adapter.py new file mode 100644 index 00000000..fe7ad5c1 --- /dev/null +++ b/src/conductor/client/adapters/models/action_adapter.py @@ -0,0 +1,23 @@ +from conductor.client.codegen.models import Action + + +class ActionAdapter(Action): + def __init__( + self, + action=None, + start_workflow=None, + complete_task=None, + fail_task=None, + expand_inline_json=None, + terminate_workflow=None, + update_workflow_variables=None, + ): + super().__init__( + action=action, + complete_task=complete_task, + expand_inline_json=expand_inline_json, + fail_task=fail_task, + start_workflow=start_workflow, + terminate_workflow=terminate_workflow, + update_workflow_variables=update_workflow_variables, + ) diff --git a/src/conductor/client/adapters/models/any_adapter.py b/src/conductor/client/adapters/models/any_adapter.py new file mode 100644 index 00000000..1af12fe5 --- /dev/null +++ b/src/conductor/client/adapters/models/any_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import Any + + +class AnyAdapter(Any): ... diff --git a/src/conductor/client/adapters/models/authorization_request_adapter.py b/src/conductor/client/adapters/models/authorization_request_adapter.py new file mode 100644 index 00000000..5b99c867 --- /dev/null +++ b/src/conductor/client/adapters/models/authorization_request_adapter.py @@ -0,0 +1,41 @@ +from conductor.client.codegen.models import AuthorizationRequest + + +class AuthorizationRequestAdapter(AuthorizationRequest): + def __init__(self, subject=None, target=None, access=None): + super().__init__(access=access, subject=subject, target=target) + + @property + def subject(self): + return super().subject + + @subject.setter + def subject(self, subject): + self._subject = subject + + @property + def target(self): + return super().target + + @target.setter + def target(self, target): + self._target = target + + @property + def access(self): + return super().access + + @access.setter + def access(self, access): + allowed_values = ["CREATE", "READ", "EXECUTE", "UPDATE", "DELETE"] # noqa: E501 + if not set(access).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `access` [{0}], must be a subset of [{1}]".format( # noqa: E501 + ", ".join( + map(str, set(access) - set(allowed_values)) + ), # noqa: E501 + ", ".join(map(str, allowed_values)), + ) + ) + + self._access = access diff --git a/src/conductor/client/adapters/models/bulk_response_adapter.py b/src/conductor/client/adapters/models/bulk_response_adapter.py new file mode 100644 index 00000000..40b0182f --- /dev/null +++ b/src/conductor/client/adapters/models/bulk_response_adapter.py @@ -0,0 +1,75 @@ +from conductor.client.codegen.models import BulkResponse + + +class BulkResponseAdapter(BulkResponse): + swagger_types = { + "bulk_error_results": "dict(str, str)", + "bulk_successful_results": "list[str]", + "message": "str", + } + + attribute_map = { + "bulk_error_results": "bulkErrorResults", + "bulk_successful_results": "bulkSuccessfulResults", + "message": "message", + } + + def __init__( + self, + bulk_error_results=None, + bulk_successful_results=None, + message=None, + *_args, + **_kwargs + ): + if bulk_error_results is None: + bulk_error_results = {} + if bulk_successful_results is None: + bulk_successful_results = [] + + super().__init__( + bulk_error_results=bulk_error_results, + bulk_successful_results=bulk_successful_results, + ) + self._message = "Bulk Request has been processed." + if message is not None: + self._message = message + + @property + def message(self): + """Gets the message of this BulkResponse. # noqa: E501 + + + :return: The message of this BulkResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this BulkResponse. + + + :param message: The message of this BulkResponse. # noqa: E501 + :type: str + """ + + self._message = message + + def append_successful_response(self, result) -> None: + """Appends a successful result to the bulk_successful_results list. + + :param result: The successful result to append + :type result: T + """ + self._bulk_successful_results.append(result) + + def append_failed_response(self, id: str, error_message: str) -> None: + """Appends a failed response to the bulk_error_results map. + + :param id: The entity ID + :type id: str + :param error_message: The error message + :type error_message: str + """ + self._bulk_error_results[id] = error_message diff --git a/src/conductor/client/adapters/models/byte_string_adapter.py b/src/conductor/client/adapters/models/byte_string_adapter.py new file mode 100644 index 00000000..71fa0e46 --- /dev/null +++ b/src/conductor/client/adapters/models/byte_string_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ByteString + + +class ByteStringAdapter(ByteString): ... diff --git a/src/conductor/client/adapters/models/cache_config_adapter.py b/src/conductor/client/adapters/models/cache_config_adapter.py new file mode 100644 index 00000000..0368f283 --- /dev/null +++ b/src/conductor/client/adapters/models/cache_config_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import CacheConfig + + +class CacheConfigAdapter(CacheConfig): ... diff --git a/src/conductor/client/adapters/models/circuit_breaker_transition_response_adapter.py b/src/conductor/client/adapters/models/circuit_breaker_transition_response_adapter.py new file mode 100644 index 00000000..8fe6988b --- /dev/null +++ b/src/conductor/client/adapters/models/circuit_breaker_transition_response_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.circuit_breaker_transition_response import \ + CircuitBreakerTransitionResponse + + +class CircuitBreakerTransitionResponseAdapter(CircuitBreakerTransitionResponse): + pass diff --git a/src/conductor/client/adapters/models/conductor_application_adapter.py b/src/conductor/client/adapters/models/conductor_application_adapter.py new file mode 100644 index 00000000..daf83091 --- /dev/null +++ b/src/conductor/client/adapters/models/conductor_application_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.conductor_application import \ + ConductorApplication + + +class ConductorApplicationAdapter(ConductorApplication): + pass diff --git a/src/conductor/client/adapters/models/conductor_user_adapter.py b/src/conductor/client/adapters/models/conductor_user_adapter.py new file mode 100644 index 00000000..68298a39 --- /dev/null +++ b/src/conductor/client/adapters/models/conductor_user_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ConductorUser + + +class ConductorUserAdapter(ConductorUser): ... diff --git a/src/conductor/client/adapters/models/connectivity_test_input_adapter.py b/src/conductor/client/adapters/models/connectivity_test_input_adapter.py new file mode 100644 index 00000000..32cedd87 --- /dev/null +++ b/src/conductor/client/adapters/models/connectivity_test_input_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ConnectivityTestInput + + +class ConnectivityTestInputAdapter(ConnectivityTestInput): ... diff --git a/src/conductor/client/adapters/models/connectivity_test_result_adapter.py b/src/conductor/client/adapters/models/connectivity_test_result_adapter.py new file mode 100644 index 00000000..bb2f08b2 --- /dev/null +++ b/src/conductor/client/adapters/models/connectivity_test_result_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ConnectivityTestResult + + +class ConnectivityTestResultAdapter(ConnectivityTestResult): ... diff --git a/src/conductor/client/adapters/models/correlation_ids_search_request_adapter.py b/src/conductor/client/adapters/models/correlation_ids_search_request_adapter.py new file mode 100644 index 00000000..2effa692 --- /dev/null +++ b/src/conductor/client/adapters/models/correlation_ids_search_request_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import CorrelationIdsSearchRequest + + +class CorrelationIdsSearchRequestAdapter(CorrelationIdsSearchRequest): ... diff --git a/src/conductor/client/adapters/models/create_or_update_application_request_adapter.py b/src/conductor/client/adapters/models/create_or_update_application_request_adapter.py new file mode 100644 index 00000000..8c344cea --- /dev/null +++ b/src/conductor/client/adapters/models/create_or_update_application_request_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import CreateOrUpdateApplicationRequest + + +class CreateOrUpdateApplicationRequestAdapter(CreateOrUpdateApplicationRequest): ... diff --git a/src/conductor/client/adapters/models/declaration_adapter.py b/src/conductor/client/adapters/models/declaration_adapter.py new file mode 100644 index 00000000..a84fa9d5 --- /dev/null +++ b/src/conductor/client/adapters/models/declaration_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import Declaration + + +class DeclarationAdapter(Declaration): ... diff --git a/src/conductor/client/adapters/models/declaration_or_builder_adapter.py b/src/conductor/client/adapters/models/declaration_or_builder_adapter.py new file mode 100644 index 00000000..a72b1c75 --- /dev/null +++ b/src/conductor/client/adapters/models/declaration_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import DeclarationOrBuilder + + +class DeclarationOrBuilderAdapter(DeclarationOrBuilder): ... diff --git a/src/conductor/client/adapters/models/descriptor_adapter.py b/src/conductor/client/adapters/models/descriptor_adapter.py new file mode 100644 index 00000000..59999b38 --- /dev/null +++ b/src/conductor/client/adapters/models/descriptor_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import Descriptor + + +class DescriptorAdapter(Descriptor): ... diff --git a/src/conductor/client/adapters/models/descriptor_proto_adapter.py b/src/conductor/client/adapters/models/descriptor_proto_adapter.py new file mode 100644 index 00000000..6ec5eedc --- /dev/null +++ b/src/conductor/client/adapters/models/descriptor_proto_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import DescriptorProto + + +class DescriptorProtoAdapter(DescriptorProto): ... diff --git a/src/conductor/client/adapters/models/descriptor_proto_or_builder_adapter.py b/src/conductor/client/adapters/models/descriptor_proto_or_builder_adapter.py new file mode 100644 index 00000000..4e6ee534 --- /dev/null +++ b/src/conductor/client/adapters/models/descriptor_proto_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import DescriptorProtoOrBuilder + + +class DescriptorProtoOrBuilderAdapter(DescriptorProtoOrBuilder): ... diff --git a/src/conductor/client/adapters/models/edition_default_adapter.py b/src/conductor/client/adapters/models/edition_default_adapter.py new file mode 100644 index 00000000..8502d110 --- /dev/null +++ b/src/conductor/client/adapters/models/edition_default_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EditionDefault + + +class EditionDefaultAdapter(EditionDefault): ... diff --git a/src/conductor/client/adapters/models/edition_default_or_builder_adapter.py b/src/conductor/client/adapters/models/edition_default_or_builder_adapter.py new file mode 100644 index 00000000..b209b93e --- /dev/null +++ b/src/conductor/client/adapters/models/edition_default_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EditionDefaultOrBuilder + + +class EditionDefaultOrBuilderAdapter(EditionDefaultOrBuilder): ... diff --git a/src/conductor/client/adapters/models/enum_descriptor_adapter.py b/src/conductor/client/adapters/models/enum_descriptor_adapter.py new file mode 100644 index 00000000..8a1c5ba6 --- /dev/null +++ b/src/conductor/client/adapters/models/enum_descriptor_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumDescriptor + + +class EnumDescriptorAdapter(EnumDescriptor): ... diff --git a/src/conductor/client/adapters/models/enum_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/enum_descriptor_proto_adapter.py new file mode 100644 index 00000000..8af7fd94 --- /dev/null +++ b/src/conductor/client/adapters/models/enum_descriptor_proto_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumDescriptorProto + + +class EnumDescriptorProtoAdapter(EnumDescriptorProto): ... diff --git a/src/conductor/client/adapters/models/enum_descriptor_proto_or_builder_adapter.py b/src/conductor/client/adapters/models/enum_descriptor_proto_or_builder_adapter.py new file mode 100644 index 00000000..b2eff5b3 --- /dev/null +++ b/src/conductor/client/adapters/models/enum_descriptor_proto_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumDescriptorProtoOrBuilder + + +class EnumDescriptorProtoOrBuilderAdapter(EnumDescriptorProtoOrBuilder): ... diff --git a/src/conductor/client/adapters/models/enum_options_adapter.py b/src/conductor/client/adapters/models/enum_options_adapter.py new file mode 100644 index 00000000..4097d52d --- /dev/null +++ b/src/conductor/client/adapters/models/enum_options_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumOptions + + +class EnumOptionsAdapter(EnumOptions): ... diff --git a/src/conductor/client/adapters/models/enum_options_or_builder_adapter.py b/src/conductor/client/adapters/models/enum_options_or_builder_adapter.py new file mode 100644 index 00000000..f1d99393 --- /dev/null +++ b/src/conductor/client/adapters/models/enum_options_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumOptionsOrBuilder + + +class EnumOptionsOrBuilderAdapter(EnumOptionsOrBuilder): ... diff --git a/src/conductor/client/adapters/models/enum_reserved_range_adapter.py b/src/conductor/client/adapters/models/enum_reserved_range_adapter.py new file mode 100644 index 00000000..c48ea6ce --- /dev/null +++ b/src/conductor/client/adapters/models/enum_reserved_range_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumReservedRange + + +class EnumReservedRangeAdapter(EnumReservedRange): ... diff --git a/src/conductor/client/adapters/models/enum_reserved_range_or_builder_adapter.py b/src/conductor/client/adapters/models/enum_reserved_range_or_builder_adapter.py new file mode 100644 index 00000000..ffebe0d3 --- /dev/null +++ b/src/conductor/client/adapters/models/enum_reserved_range_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumReservedRangeOrBuilder + + +class EnumReservedRangeOrBuilderAdapter(EnumReservedRangeOrBuilder): ... diff --git a/src/conductor/client/adapters/models/enum_value_descriptor_adapter.py b/src/conductor/client/adapters/models/enum_value_descriptor_adapter.py new file mode 100644 index 00000000..82bce297 --- /dev/null +++ b/src/conductor/client/adapters/models/enum_value_descriptor_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumValueDescriptor + + +class EnumValueDescriptorAdapter(EnumValueDescriptor): ... diff --git a/src/conductor/client/adapters/models/enum_value_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/enum_value_descriptor_proto_adapter.py new file mode 100644 index 00000000..8f35ed6f --- /dev/null +++ b/src/conductor/client/adapters/models/enum_value_descriptor_proto_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumValueDescriptorProto + + +class EnumValueDescriptorProtoAdapter(EnumValueDescriptorProto): ... diff --git a/src/conductor/client/adapters/models/enum_value_descriptor_proto_or_builder_adapter.py b/src/conductor/client/adapters/models/enum_value_descriptor_proto_or_builder_adapter.py new file mode 100644 index 00000000..8b938b1e --- /dev/null +++ b/src/conductor/client/adapters/models/enum_value_descriptor_proto_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumValueDescriptorProtoOrBuilder + + +class EnumValueDescriptorProtoOrBuilderAdapter(EnumValueDescriptorProtoOrBuilder): ... diff --git a/src/conductor/client/adapters/models/enum_value_options_adapter.py b/src/conductor/client/adapters/models/enum_value_options_adapter.py new file mode 100644 index 00000000..0ea61ad6 --- /dev/null +++ b/src/conductor/client/adapters/models/enum_value_options_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumValueOptions + + +class EnumValueOptionsAdapter(EnumValueOptions): ... diff --git a/src/conductor/client/adapters/models/enum_value_options_or_builder_adapter.py b/src/conductor/client/adapters/models/enum_value_options_or_builder_adapter.py new file mode 100644 index 00000000..b6dd6373 --- /dev/null +++ b/src/conductor/client/adapters/models/enum_value_options_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnumValueOptionsOrBuilder + + +class EnumValueOptionsOrBuilderAdapter(EnumValueOptionsOrBuilder): ... diff --git a/src/conductor/client/adapters/models/environment_variable_adapter.py b/src/conductor/client/adapters/models/environment_variable_adapter.py new file mode 100644 index 00000000..9945197a --- /dev/null +++ b/src/conductor/client/adapters/models/environment_variable_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EnvironmentVariable + + +class EnvironmentVariableAdapter(EnvironmentVariable): ... diff --git a/src/conductor/client/adapters/models/event_handler_adapter.py b/src/conductor/client/adapters/models/event_handler_adapter.py new file mode 100644 index 00000000..ac145ced --- /dev/null +++ b/src/conductor/client/adapters/models/event_handler_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EventHandler + + +class EventHandlerAdapter(EventHandler): ... diff --git a/src/conductor/client/adapters/models/event_log_adapter.py b/src/conductor/client/adapters/models/event_log_adapter.py new file mode 100644 index 00000000..28c04ead --- /dev/null +++ b/src/conductor/client/adapters/models/event_log_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import EventLog + + +class EventLogAdapter(EventLog): ... diff --git a/src/conductor/client/adapters/models/event_message_adapter.py b/src/conductor/client/adapters/models/event_message_adapter.py new file mode 100644 index 00000000..a48d7df4 --- /dev/null +++ b/src/conductor/client/adapters/models/event_message_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.event_message import EventMessage + + +class EventMessageAdapter(EventMessage): + pass diff --git a/src/conductor/client/adapters/models/extended_conductor_application_adapter.py b/src/conductor/client/adapters/models/extended_conductor_application_adapter.py new file mode 100644 index 00000000..d39f9758 --- /dev/null +++ b/src/conductor/client/adapters/models/extended_conductor_application_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ExtendedConductorApplication + + +class ExtendedConductorApplicationAdapter(ExtendedConductorApplication): ... diff --git a/src/conductor/client/adapters/models/extended_event_execution_adapter.py b/src/conductor/client/adapters/models/extended_event_execution_adapter.py new file mode 100644 index 00000000..cf363218 --- /dev/null +++ b/src/conductor/client/adapters/models/extended_event_execution_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ExtendedEventExecution + + +class ExtendedEventExecutionAdapter(ExtendedEventExecution): ... diff --git a/src/conductor/client/adapters/models/extended_secret_adapter.py b/src/conductor/client/adapters/models/extended_secret_adapter.py new file mode 100644 index 00000000..886e4395 --- /dev/null +++ b/src/conductor/client/adapters/models/extended_secret_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ExtendedSecret + + +class ExtendedSecretAdapter(ExtendedSecret): ... diff --git a/src/conductor/client/adapters/models/extended_task_def_adapter.py b/src/conductor/client/adapters/models/extended_task_def_adapter.py new file mode 100644 index 00000000..84a92e75 --- /dev/null +++ b/src/conductor/client/adapters/models/extended_task_def_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ExtendedTaskDef + + +class ExtendedTaskDefAdapter(ExtendedTaskDef): ... diff --git a/src/conductor/client/adapters/models/extended_workflow_def_adapter.py b/src/conductor/client/adapters/models/extended_workflow_def_adapter.py new file mode 100644 index 00000000..2b675e83 --- /dev/null +++ b/src/conductor/client/adapters/models/extended_workflow_def_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ExtendedWorkflowDef + + +class ExtendedWorkflowDefAdapter(ExtendedWorkflowDef): ... diff --git a/src/conductor/client/adapters/models/extension_range_adapter.py b/src/conductor/client/adapters/models/extension_range_adapter.py new file mode 100644 index 00000000..b4aa1ec2 --- /dev/null +++ b/src/conductor/client/adapters/models/extension_range_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ExtensionRange + + +class ExtensionRangeAdapter(ExtensionRange): ... diff --git a/src/conductor/client/adapters/models/extension_range_options_adapter.py b/src/conductor/client/adapters/models/extension_range_options_adapter.py new file mode 100644 index 00000000..ca8a7e51 --- /dev/null +++ b/src/conductor/client/adapters/models/extension_range_options_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ExtensionRangeOptions + + +class ExtensionRangeOptionsAdapter(ExtensionRangeOptions): ... diff --git a/src/conductor/client/adapters/models/extension_range_options_or_builder_adapter.py b/src/conductor/client/adapters/models/extension_range_options_or_builder_adapter.py new file mode 100644 index 00000000..2c2c9191 --- /dev/null +++ b/src/conductor/client/adapters/models/extension_range_options_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ExtensionRangeOptionsOrBuilder + + +class ExtensionRangeOptionsOrBuilderAdapter(ExtensionRangeOptionsOrBuilder): ... diff --git a/src/conductor/client/adapters/models/extension_range_or_builder_adapter.py b/src/conductor/client/adapters/models/extension_range_or_builder_adapter.py new file mode 100644 index 00000000..f27ccf83 --- /dev/null +++ b/src/conductor/client/adapters/models/extension_range_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import ExtensionRangeOrBuilder + + +class ExtensionRangeOrBuilderAdapter(ExtensionRangeOrBuilder): ... diff --git a/src/conductor/client/adapters/models/external_storage_location_adapter.py b/src/conductor/client/adapters/models/external_storage_location_adapter.py new file mode 100644 index 00000000..9c34ce83 --- /dev/null +++ b/src/conductor/client/adapters/models/external_storage_location_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.external_storage_location import \ + ExternalStorageLocation + + +class ExternalStorageLocationAdapter(ExternalStorageLocation): + pass diff --git a/src/conductor/client/adapters/models/feature_set_adapter.py b/src/conductor/client/adapters/models/feature_set_adapter.py new file mode 100644 index 00000000..bb62bf28 --- /dev/null +++ b/src/conductor/client/adapters/models/feature_set_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FeatureSet + + +class FeatureSetAdapter(FeatureSet): ... diff --git a/src/conductor/client/adapters/models/feature_set_or_builder_adapter.py b/src/conductor/client/adapters/models/feature_set_or_builder_adapter.py new file mode 100644 index 00000000..0a521e8f --- /dev/null +++ b/src/conductor/client/adapters/models/feature_set_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FeatureSetOrBuilder + + +class FeatureSetOrBuilderAdapter(FeatureSetOrBuilder): ... diff --git a/src/conductor/client/adapters/models/field_descriptor_adapter.py b/src/conductor/client/adapters/models/field_descriptor_adapter.py new file mode 100644 index 00000000..628801f5 --- /dev/null +++ b/src/conductor/client/adapters/models/field_descriptor_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FieldDescriptor + + +class FieldDescriptorAdapter(FieldDescriptor): ... diff --git a/src/conductor/client/adapters/models/field_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/field_descriptor_proto_adapter.py new file mode 100644 index 00000000..b0cb9ddb --- /dev/null +++ b/src/conductor/client/adapters/models/field_descriptor_proto_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FieldDescriptorProto + + +class FieldDescriptorProtoAdapter(FieldDescriptorProto): ... diff --git a/src/conductor/client/adapters/models/field_descriptor_proto_or_builder_adapter.py b/src/conductor/client/adapters/models/field_descriptor_proto_or_builder_adapter.py new file mode 100644 index 00000000..6aa57f08 --- /dev/null +++ b/src/conductor/client/adapters/models/field_descriptor_proto_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FieldDescriptorProtoOrBuilder + + +class FieldDescriptorProtoOrBuilderAdapter(FieldDescriptorProtoOrBuilder): ... diff --git a/src/conductor/client/adapters/models/field_options_adapter.py b/src/conductor/client/adapters/models/field_options_adapter.py new file mode 100644 index 00000000..589d4f6e --- /dev/null +++ b/src/conductor/client/adapters/models/field_options_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FieldOptions + + +class FieldOptionsAdapter(FieldOptions): ... diff --git a/src/conductor/client/adapters/models/field_options_or_builder_adapter.py b/src/conductor/client/adapters/models/field_options_or_builder_adapter.py new file mode 100644 index 00000000..af30a745 --- /dev/null +++ b/src/conductor/client/adapters/models/field_options_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FieldOptionsOrBuilder + + +class FieldOptionsOrBuilderAdapter(FieldOptionsOrBuilder): ... diff --git a/src/conductor/client/adapters/models/file_descriptor_adapter.py b/src/conductor/client/adapters/models/file_descriptor_adapter.py new file mode 100644 index 00000000..270d3357 --- /dev/null +++ b/src/conductor/client/adapters/models/file_descriptor_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FileDescriptor + + +class FileDescriptorAdapter(FileDescriptor): ... diff --git a/src/conductor/client/adapters/models/file_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/file_descriptor_proto_adapter.py new file mode 100644 index 00000000..5e4d4c9e --- /dev/null +++ b/src/conductor/client/adapters/models/file_descriptor_proto_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FileDescriptorProto + + +class FileDescriptorProtoAdapter(FileDescriptorProto): ... diff --git a/src/conductor/client/adapters/models/file_options_adapter.py b/src/conductor/client/adapters/models/file_options_adapter.py new file mode 100644 index 00000000..18daacc8 --- /dev/null +++ b/src/conductor/client/adapters/models/file_options_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FileOptions + + +class FileOptionsAdapter(FileOptions): ... diff --git a/src/conductor/client/adapters/models/file_options_or_builder_adapter.py b/src/conductor/client/adapters/models/file_options_or_builder_adapter.py new file mode 100644 index 00000000..650eb0ad --- /dev/null +++ b/src/conductor/client/adapters/models/file_options_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import FileOptionsOrBuilder + + +class FileOptionsOrBuilderAdapter(FileOptionsOrBuilder): ... diff --git a/src/conductor/client/adapters/models/generate_token_request_adapter.py b/src/conductor/client/adapters/models/generate_token_request_adapter.py new file mode 100644 index 00000000..2e420213 --- /dev/null +++ b/src/conductor/client/adapters/models/generate_token_request_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import GenerateTokenRequest + + +class GenerateTokenRequestAdapter(GenerateTokenRequest): ... diff --git a/src/conductor/client/adapters/models/granted_access_adapter.py b/src/conductor/client/adapters/models/granted_access_adapter.py new file mode 100644 index 00000000..ef08abeb --- /dev/null +++ b/src/conductor/client/adapters/models/granted_access_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import GrantedAccess + + +class GrantedAccessAdapter(GrantedAccess): ... diff --git a/src/conductor/client/adapters/models/granted_access_response_adapter.py b/src/conductor/client/adapters/models/granted_access_response_adapter.py new file mode 100644 index 00000000..013ec479 --- /dev/null +++ b/src/conductor/client/adapters/models/granted_access_response_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import GrantedAccessResponse + + +class GrantedAccessResponseAdapter(GrantedAccessResponse): ... diff --git a/src/conductor/client/adapters/models/group_adapter.py b/src/conductor/client/adapters/models/group_adapter.py new file mode 100644 index 00000000..1e252a61 --- /dev/null +++ b/src/conductor/client/adapters/models/group_adapter.py @@ -0,0 +1,11 @@ +from conductor.client.codegen.models import Group + + +class GroupAdapter(Group): + @property + def default_access(self): + return super().default_access + + @default_access.setter + def default_access(self, default_access): + self._default_access = default_access diff --git a/src/conductor/client/adapters/models/handled_event_response_adapter.py b/src/conductor/client/adapters/models/handled_event_response_adapter.py new file mode 100644 index 00000000..91d92bf2 --- /dev/null +++ b/src/conductor/client/adapters/models/handled_event_response_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import HandledEventResponse + + +class HandledEventResponseAdapter(HandledEventResponse): ... diff --git a/src/conductor/client/adapters/models/health.py b/src/conductor/client/adapters/models/health.py new file mode 100644 index 00000000..7e33d4d3 --- /dev/null +++ b/src/conductor/client/adapters/models/health.py @@ -0,0 +1,156 @@ +import pprint +import re # noqa: F401 + +import six + + +class Health(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + "details": "dict(str, object)", + "error_message": "str", + "healthy": "bool", + } + + attribute_map = { + "details": "details", + "error_message": "errorMessage", + "healthy": "healthy", + } + + def __init__(self, details=None, error_message=None, healthy=None): # noqa: E501 + """Health - a model defined in Swagger""" # noqa: E501 + self._details = None + self._error_message = None + self._healthy = None + self.discriminator = None + if details is not None: + self.details = details + if error_message is not None: + self.error_message = error_message + if healthy is not None: + self.healthy = healthy + + @property + def details(self): + """Gets the details of this Health. # noqa: E501 + + + :return: The details of this Health. # noqa: E501 + :rtype: dict(str, object) + """ + return self._details + + @details.setter + def details(self, details): + """Sets the details of this Health. + + + :param details: The details of this Health. # noqa: E501 + :type: dict(str, object) + """ + + self._details = details + + @property + def error_message(self): + """Gets the error_message of this Health. # noqa: E501 + + + :return: The error_message of this Health. # noqa: E501 + :rtype: str + """ + return self._error_message + + @error_message.setter + def error_message(self, error_message): + """Sets the error_message of this Health. + + + :param error_message: The error_message of this Health. # noqa: E501 + :type: str + """ + + self._error_message = error_message + + @property + def healthy(self): + """Gets the healthy of this Health. # noqa: E501 + + + :return: The healthy of this Health. # noqa: E501 + :rtype: bool + """ + return self._healthy + + @healthy.setter + def healthy(self, healthy): + """Sets the healthy of this Health. + + + :param healthy: The healthy of this Health. # noqa: E501 + :type: bool + """ + + self._healthy = healthy + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: ( + (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item + ), + value.items(), + ) + ) + else: + result[attr] = value + if issubclass(Health, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Health): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/adapters/models/health_check_status.py b/src/conductor/client/adapters/models/health_check_status.py new file mode 100644 index 00000000..a7a94e3c --- /dev/null +++ b/src/conductor/client/adapters/models/health_check_status.py @@ -0,0 +1,157 @@ +import pprint + +import six + + +class HealthCheckStatus(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + "health_results": "list[Health]", + "suppressed_health_results": "list[Health]", + "healthy": "bool", + } + + attribute_map = { + "health_results": "healthResults", + "suppressed_health_results": "suppressedHealthResults", + "healthy": "healthy", + } + + def __init__( + self, health_results=None, suppressed_health_results=None, healthy=None + ): # noqa: E501 + """HealthCheckStatus - a model defined in Swagger""" # noqa: E501 + self._health_results = None + self._suppressed_health_results = None + self._healthy = None + self.discriminator = None + if health_results is not None: + self.health_results = health_results + if suppressed_health_results is not None: + self.suppressed_health_results = suppressed_health_results + if healthy is not None: + self.healthy = healthy + + @property + def health_results(self): + """Gets the health_results of this HealthCheckStatus. # noqa: E501 + + + :return: The health_results of this HealthCheckStatus. # noqa: E501 + :rtype: list[Health] + """ + return self._health_results + + @health_results.setter + def health_results(self, health_results): + """Sets the health_results of this HealthCheckStatus. + + + :param health_results: The health_results of this HealthCheckStatus. # noqa: E501 + :type: list[Health] + """ + + self._health_results = health_results + + @property + def suppressed_health_results(self): + """Gets the suppressed_health_results of this HealthCheckStatus. # noqa: E501 + + + :return: The suppressed_health_results of this HealthCheckStatus. # noqa: E501 + :rtype: list[Health] + """ + return self._suppressed_health_results + + @suppressed_health_results.setter + def suppressed_health_results(self, suppressed_health_results): + """Sets the suppressed_health_results of this HealthCheckStatus. + + + :param suppressed_health_results: The suppressed_health_results of this HealthCheckStatus. # noqa: E501 + :type: list[Health] + """ + + self._suppressed_health_results = suppressed_health_results + + @property + def healthy(self): + """Gets the healthy of this HealthCheckStatus. # noqa: E501 + + + :return: The healthy of this HealthCheckStatus. # noqa: E501 + :rtype: bool + """ + return self._healthy + + @healthy.setter + def healthy(self, healthy): + """Sets the healthy of this HealthCheckStatus. + + + :param healthy: The healthy of this HealthCheckStatus. # noqa: E501 + :type: bool + """ + + self._healthy = healthy + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: ( + (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item + ), + value.items(), + ) + ) + else: + result[attr] = value + if issubclass(HealthCheckStatus, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HealthCheckStatus): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/adapters/models/incoming_bpmn_file_adapter.py b/src/conductor/client/adapters/models/incoming_bpmn_file_adapter.py new file mode 100644 index 00000000..29ccbd99 --- /dev/null +++ b/src/conductor/client/adapters/models/incoming_bpmn_file_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.incoming_bpmn_file import IncomingBpmnFile + + +class IncomingBpmnFileAdapter(IncomingBpmnFile): + pass diff --git a/src/conductor/client/adapters/models/integration_adapter.py b/src/conductor/client/adapters/models/integration_adapter.py new file mode 100644 index 00000000..ac7d40f9 --- /dev/null +++ b/src/conductor/client/adapters/models/integration_adapter.py @@ -0,0 +1,153 @@ +from __future__ import annotations + +from typing import ClassVar, Dict + +from conductor.client.codegen.models import Integration + + +class IntegrationAdapter(Integration): + swagger_types: ClassVar[Dict[str, str]] = { + "apis": "list[IntegrationApi]", + "category": "str", + "configuration": "dict(str, object)", + "create_time": "int", + "created_on": "int", + "created_by": "str", + "description": "str", + "enabled": "bool", + "models_count": "int", + "name": "str", + "owner_app": "str", + "tags": "list[Tag]", + "type": "str", + "update_time": "int", + "updated_on": "int", + "updated_by": "str", + } + + attribute_map: ClassVar[Dict[str, str]] = { + "apis": "apis", + "category": "category", + "configuration": "configuration", + "create_time": "createTime", + "created_on": "createdOn", + "created_by": "createdBy", + "description": "description", + "enabled": "enabled", + "models_count": "modelsCount", + "name": "name", + "owner_app": "ownerApp", + "tags": "tags", + "type": "type", + "update_time": "updateTime", + "updated_on": "updatedOn", + "updated_by": "updatedBy", + } + + def __init__( + self, + apis=None, + category=None, + configuration=None, + create_time=None, + created_by=None, + description=None, + enabled=None, + models_count=None, + name=None, + owner_app=None, + tags=None, + type=None, + update_time=None, + updated_by=None, + updated_on=None, # added to handle backwards compatibility + created_on=None, # added to handle backwards compatibility + ): # noqa: E501 + """Integration - a model defined in Swagger""" # noqa: E501 + self._apis = None + self._category = None + self._configuration = None + self._created_by = None + self._description = None + self._enabled = None + self._models_count = None + self._name = None + self._owner_app = None + self._tags = None + self._type = None + self._updated_by = None + self.discriminator = None + self._create_time = None + self._update_time = None + self._created_on = None + self._updated_on = None + + if apis is not None: + self.apis = apis + if category is not None: + self.category = category + if configuration is not None: + self.configuration = configuration + if created_on is not None: + self.create_time = created_on + self.created_on = created_on + if created_by is not None: + self.created_by = created_by + if description is not None: + self.description = description + if enabled is not None: + self.enabled = enabled + if models_count is not None: + self.models_count = models_count + if name is not None: + self.name = name + if owner_app is not None: + self.owner_app = owner_app + if tags is not None: + self.tags = tags + if type is not None: + self.type = type + if updated_by is not None: + self.updated_by = updated_by + if updated_on is not None: + self.update_time = updated_on + self.updated_on = updated_on + + @property + def created_on(self): + return self._create_time + + @created_on.setter + def created_on(self, create_time): + self._create_time = create_time + self._created_on = create_time + + @property + def updated_on(self): + return self._update_time + + @updated_on.setter + def updated_on(self, update_time): + self._update_time = update_time + self._updated_on = update_time + + @Integration.category.setter + def category(self, category): + allowed_values = [ + "API", + "AI_MODEL", + "VECTOR_DB", + "RELATIONAL_DB", + "MESSAGE_BROKER", + "GIT", + "EMAIL", + "MCP", + ] # noqa: E501 + if category not in allowed_values: + raise ValueError( + "Invalid value for `category` ({0}), must be one of {1}".format( # noqa: E501 + category, allowed_values + ) + ) + + self._category = category diff --git a/src/conductor/client/adapters/models/integration_api_adapter.py b/src/conductor/client/adapters/models/integration_api_adapter.py new file mode 100644 index 00000000..79cbacd4 --- /dev/null +++ b/src/conductor/client/adapters/models/integration_api_adapter.py @@ -0,0 +1,110 @@ +from __future__ import annotations + +from typing import ClassVar, Dict + +from conductor.client.codegen.models import IntegrationApi + + +class IntegrationApiAdapter(IntegrationApi): + swagger_types: ClassVar[Dict[str, str]] = { + "api": "str", + "configuration": "dict(str, object)", + "create_time": "int", + "created_on": "int", + "created_by": "str", + "description": "str", + "enabled": "bool", + "integration_name": "str", + "owner_app": "str", + "tags": "list[Tag]", + "update_time": "int", + "updated_on": "int", + "updated_by": "str", + } + + attribute_map: ClassVar[Dict[str, str]] = { + "api": "api", + "configuration": "configuration", + "create_time": "createTime", + "created_on": "createdOn", + "created_by": "createdBy", + "description": "description", + "enabled": "enabled", + "integration_name": "integrationName", + "owner_app": "ownerApp", + "tags": "tags", + "update_time": "updateTime", + "updated_on": "updatedOn", + "updated_by": "updatedBy", + } + + def __init__( + self, + api=None, + configuration=None, + created_on=None, + created_by=None, + description=None, + enabled=None, + integration_name=None, + owner_app=None, + tags=None, + updated_on=None, # added to handle backwards compatibility + updated_by=None, # added to handle backwards compatibility + create_time=None, + update_time=None, + ): + self._api = None + self._configuration = None + self._create_time = None + self._created_by = None + self._description = None + self._enabled = None + self._integration_name = None + self._owner_app = None + self._tags = None + self._update_time = None + self._updated_by = None + self.discriminator = None + if api is not None: + self.api = api + if configuration is not None: + self.configuration = configuration + if created_on is not None: + self.create_time = created_on + if created_by is not None: + self.created_by = created_by + if description is not None: + self.description = description + if enabled is not None: + self.enabled = enabled + if integration_name is not None: + self.integration_name = integration_name + if owner_app is not None: + self.owner_app = owner_app + if tags is not None: + self.tags = tags + if updated_on is not None: + self.update_time = updated_on + if updated_by is not None: + self.updated_by = updated_by + if create_time is not None: + self.created_on = create_time + if update_time is not None: + self.updated_on = update_time + + @property + def created_on(self): + return self._create_time + + @created_on.setter + def created_on(self, create_time): + self._create_time = create_time + + @property + def updated_on(self): + return self._update_time + + @updated_on.setter + def updated_on(self, update_time): + self._update_time = update_time diff --git a/src/conductor/client/adapters/models/integration_api_update_adapter.py b/src/conductor/client/adapters/models/integration_api_update_adapter.py new file mode 100644 index 00000000..e5b97fa3 --- /dev/null +++ b/src/conductor/client/adapters/models/integration_api_update_adapter.py @@ -0,0 +1,8 @@ +from conductor.client.codegen.models import IntegrationApiUpdate + + +class IntegrationApiUpdateAdapter(IntegrationApiUpdate): + def __init__( + self, configuration=None, description=None, enabled=None, *_args, **_kwargs + ): + super().__init__(configuration, description, enabled) diff --git a/src/conductor/client/adapters/models/integration_def_adapter.py b/src/conductor/client/adapters/models/integration_def_adapter.py new file mode 100644 index 00000000..e73bdf17 --- /dev/null +++ b/src/conductor/client/adapters/models/integration_def_adapter.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from typing import ClassVar, Dict + +from conductor.client.codegen.models import IntegrationDef + + +class IntegrationDefAdapter(IntegrationDef): + swagger_types: ClassVar[Dict[str, str]] = { + "category": "str", + "category_label": "str", + "configuration": "list[IntegrationDefFormField]", + "description": "str", + "enabled": "bool", + "icon_name": "str", + "name": "str", + "tags": "list[str]", + "type": "str", + "apis": "list[IntegrationDefApi]", + } + + attribute_map: ClassVar[Dict[str, str]] = { + "category": "category", + "category_label": "categoryLabel", + "configuration": "configuration", + "description": "description", + "enabled": "enabled", + "icon_name": "iconName", + "name": "name", + "tags": "tags", + "type": "type", + "apis": "apis", + } + + def __init__( + self, + category=None, + category_label=None, + configuration=None, + description=None, + enabled=None, + icon_name=None, + name=None, + tags=None, + type=None, + apis=None, + ): # noqa: E501 + self._category = None + self._category_label = None + self._configuration = None + self._description = None + self._enabled = None + self._icon_name = None + self._name = None + self._tags = None + self._type = None + self._apis = None + self.discriminator = None + if category is not None: + self.category = category + if category_label is not None: + self.category_label = category_label + if configuration is not None: + self.configuration = configuration + if description is not None: + self.description = description + if enabled is not None: + self.enabled = enabled + if icon_name is not None: + self.icon_name = icon_name + if name is not None: + self.name = name + if tags is not None: + self.tags = tags + if type is not None: + self.type = type + if apis is not None: + self.apis = apis + + @property + def apis(self): + return self._apis + + @apis.setter + def apis(self, apis): + self._apis = apis + + @IntegrationDef.category.setter + def category(self, category): + """Sets the category of this IntegrationUpdate. + + + :param category: The category of this IntegrationUpdate. # noqa: E501 + :type: str + """ + allowed_values = [ + "API", + "AI_MODEL", + "VECTOR_DB", + "RELATIONAL_DB", + "MESSAGE_BROKER", + "GIT", + "EMAIL", + "MCP", + ] # noqa: E501 + if category not in allowed_values: + raise ValueError( + "Invalid value for `category` ({0}), must be one of {1}".format( # noqa: E501 + category, allowed_values + ) + ) + + self._category = category diff --git a/src/conductor/client/adapters/models/integration_def_api_adapter.py b/src/conductor/client/adapters/models/integration_def_api_adapter.py new file mode 100644 index 00000000..eebf0762 --- /dev/null +++ b/src/conductor/client/adapters/models/integration_def_api_adapter.py @@ -0,0 +1,210 @@ +import pprint + +import six + + +class IntegrationDefApi(object): # Model from v5.2.6 spec + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + + swagger_types = { + "api": "str", + "description": "str", + "input_schema": "SchemaDef", + "integration_type": "str", + "output_schema": "SchemaDef", + } + + attribute_map = { + "api": "api", + "description": "description", + "input_schema": "inputSchema", + "integration_type": "integrationType", + "output_schema": "outputSchema", + } + + def __init__( + self, + api=None, + description=None, + input_schema=None, + integration_type=None, + output_schema=None, + ): # noqa: E501 + """IntegrationDefApi - a model defined in Swagger""" # noqa: E501 + self._api = None + self._description = None + self._input_schema = None + self._integration_type = None + self._output_schema = None + self.discriminator = None + if api is not None: + self.api = api + if description is not None: + self.description = description + if input_schema is not None: + self.input_schema = input_schema + if integration_type is not None: + self.integration_type = integration_type + if output_schema is not None: + self.output_schema = output_schema + + @property + def api(self): + """Gets the api of this IntegrationDefApi. # noqa: E501 + + + :return: The api of this IntegrationDefApi. # noqa: E501 + :rtype: str + """ + return self._api + + @api.setter + def api(self, api): + """Sets the api of this IntegrationDefApi. + + + :param api: The api of this IntegrationDefApi. # noqa: E501 + :type: str + """ + + self._api = api + + @property + def description(self): + """Gets the description of this IntegrationDefApi. # noqa: E501 + + + :return: The description of this IntegrationDefApi. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IntegrationDefApi. + + + :param description: The description of this IntegrationDefApi. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def input_schema(self): + """Gets the input_schema of this IntegrationDefApi. # noqa: E501 + + + :return: The input_schema of this IntegrationDefApi. # noqa: E501 + :rtype: SchemaDef + """ + return self._input_schema + + @input_schema.setter + def input_schema(self, input_schema): + """Sets the input_schema of this IntegrationDefApi. + + + :param input_schema: The input_schema of this IntegrationDefApi. # noqa: E501 + :type: SchemaDef + """ + + self._input_schema = input_schema + + @property + def integration_type(self): + """Gets the integration_type of this IntegrationDefApi. # noqa: E501 + + + :return: The integration_type of this IntegrationDefApi. # noqa: E501 + :rtype: str + """ + return self._integration_type + + @integration_type.setter + def integration_type(self, integration_type): + """Sets the integration_type of this IntegrationDefApi. + + + :param integration_type: The integration_type of this IntegrationDefApi. # noqa: E501 + :type: str + """ + + self._integration_type = integration_type + + @property + def output_schema(self): + """Gets the output_schema of this IntegrationDefApi. # noqa: E501 + + + :return: The output_schema of this IntegrationDefApi. # noqa: E501 + :rtype: SchemaDef + """ + return self._output_schema + + @output_schema.setter + def output_schema(self, output_schema): + """Sets the output_schema of this IntegrationDefApi. + + + :param output_schema: The output_schema of this IntegrationDefApi. # noqa: E501 + :type: SchemaDef + """ + + self._output_schema = output_schema + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: ( + (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item + ), + value.items(), + ) + ) + else: + result[attr] = value + if issubclass(IntegrationDefApi, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IntegrationDefApi): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/adapters/models/integration_def_form_field_adapter.py b/src/conductor/client/adapters/models/integration_def_form_field_adapter.py new file mode 100644 index 00000000..661a9e59 --- /dev/null +++ b/src/conductor/client/adapters/models/integration_def_form_field_adapter.py @@ -0,0 +1,79 @@ +from conductor.client.codegen.models import IntegrationDefFormField + + +class IntegrationDefFormFieldAdapter(IntegrationDefFormField): + @IntegrationDefFormField.field_name.setter + def field_name(self, field_name): + """Sets the field_name of this IntegrationDefFormField. + + + :param field_name: The field_name of this IntegrationDefFormField. # noqa: E501 + :type: str + """ + allowed_values = [ + "api_key", + "user", + "header", + "endpoint", + "authUrl", + "environment", + "projectName", + "indexName", + "publisher", + "password", + "namespace", + "batchSize", + "batchWaitTime", + "visibilityTimeout", + "connectionType", + "connectionPoolSize", + "consumer", + "stream", + "batchPollConsumersCount", + "consumer_type", + "region", + "awsAccountId", + "externalId", + "roleArn", + "protocol", + "mechanism", + "port", + "schemaRegistryUrl", + "schemaRegistryApiKey", + "schemaRegistryApiSecret", + "authenticationType", + "truststoreAuthenticationType", + "tls", + "cipherSuite", + "pubSubMethod", + "keyStorePassword", + "keyStoreLocation", + "schemaRegistryAuthType", + "valueSubjectNameStrategy", + "datasourceURL", + "jdbcDriver", + "subscription", + "serviceAccountCredentials", + "file", + "tlsFile", + "queueManager", + "groupId", + "channel", + "dimensions", + "distance_metric", + "indexing_method", + "inverted_list_count", + "pullPeriod", + "pullBatchWaitMillis", + "completionsPath", + "betaVersion", + "version", + ] + if field_name not in allowed_values: + raise ValueError( + "Invalid value for `field_name` ({0}), must be one of {1}".format( # noqa: E501 + field_name, allowed_values + ) + ) + + self._field_name = field_name diff --git a/src/conductor/client/adapters/models/integration_update_adapter.py b/src/conductor/client/adapters/models/integration_update_adapter.py new file mode 100644 index 00000000..945deb2d --- /dev/null +++ b/src/conductor/client/adapters/models/integration_update_adapter.py @@ -0,0 +1,24 @@ +from conductor.client.codegen.models import IntegrationUpdate + + +class IntegrationUpdateAdapter(IntegrationUpdate): + @IntegrationUpdate.category.setter + def category(self, category): + allowed_values = [ + "API", + "AI_MODEL", + "VECTOR_DB", + "RELATIONAL_DB", + "MESSAGE_BROKER", + "GIT", + "EMAIL", + "MCP", + ] # noqa: E501 + if category not in allowed_values: + raise ValueError( + "Invalid value for `category` ({0}), must be one of {1}".format( # noqa: E501 + category, allowed_values + ) + ) + + self._category = category diff --git a/src/conductor/client/adapters/models/json_node_adapter.py b/src/conductor/client/adapters/models/json_node_adapter.py new file mode 100644 index 00000000..47de415e --- /dev/null +++ b/src/conductor/client/adapters/models/json_node_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.json_node import JsonNode + + +class JsonNodeAdapter(JsonNode): + pass diff --git a/src/conductor/client/adapters/models/location_adapter.py b/src/conductor/client/adapters/models/location_adapter.py new file mode 100644 index 00000000..f51d5174 --- /dev/null +++ b/src/conductor/client/adapters/models/location_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import Location + + +class LocationAdapter(Location): ... diff --git a/src/conductor/client/adapters/models/location_or_builder_adapter.py b/src/conductor/client/adapters/models/location_or_builder_adapter.py new file mode 100644 index 00000000..bacf510f --- /dev/null +++ b/src/conductor/client/adapters/models/location_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import LocationOrBuilder + + +class LocationOrBuilderAdapter(LocationOrBuilder): ... diff --git a/src/conductor/client/adapters/models/message_adapter.py b/src/conductor/client/adapters/models/message_adapter.py new file mode 100644 index 00000000..848568b6 --- /dev/null +++ b/src/conductor/client/adapters/models/message_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import Message + + +class MessageAdapter(Message): ... diff --git a/src/conductor/client/adapters/models/message_lite_adapter.py b/src/conductor/client/adapters/models/message_lite_adapter.py new file mode 100644 index 00000000..30d7c1de --- /dev/null +++ b/src/conductor/client/adapters/models/message_lite_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import MessageLite + + +class MessageLiteAdapter(MessageLite): ... diff --git a/src/conductor/client/adapters/models/message_options_adapter.py b/src/conductor/client/adapters/models/message_options_adapter.py new file mode 100644 index 00000000..998b6e4d --- /dev/null +++ b/src/conductor/client/adapters/models/message_options_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import MessageOptions + + +class MessageOptionsAdapter(MessageOptions): ... diff --git a/src/conductor/client/adapters/models/message_options_or_builder_adapter.py b/src/conductor/client/adapters/models/message_options_or_builder_adapter.py new file mode 100644 index 00000000..6b423fdf --- /dev/null +++ b/src/conductor/client/adapters/models/message_options_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import MessageOptionsOrBuilder + + +class MessageOptionsOrBuilderAdapter(MessageOptionsOrBuilder): ... diff --git a/src/conductor/client/adapters/models/message_template_adapter.py b/src/conductor/client/adapters/models/message_template_adapter.py new file mode 100644 index 00000000..14a3c810 --- /dev/null +++ b/src/conductor/client/adapters/models/message_template_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import MessageTemplate + + +class MessageTemplateAdapter(MessageTemplate): ... diff --git a/src/conductor/client/adapters/models/method_descriptor_adapter.py b/src/conductor/client/adapters/models/method_descriptor_adapter.py new file mode 100644 index 00000000..759b2515 --- /dev/null +++ b/src/conductor/client/adapters/models/method_descriptor_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import MethodDescriptor + + +class MethodDescriptorAdapter(MethodDescriptor): ... diff --git a/src/conductor/client/adapters/models/method_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/method_descriptor_proto_adapter.py new file mode 100644 index 00000000..421d3813 --- /dev/null +++ b/src/conductor/client/adapters/models/method_descriptor_proto_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import MethodDescriptorProto + + +class MethodDescriptorProtoAdapter(MethodDescriptorProto): ... diff --git a/src/conductor/client/adapters/models/method_descriptor_proto_or_builder_adapter.py b/src/conductor/client/adapters/models/method_descriptor_proto_or_builder_adapter.py new file mode 100644 index 00000000..d71227e5 --- /dev/null +++ b/src/conductor/client/adapters/models/method_descriptor_proto_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import MethodDescriptorProtoOrBuilder + + +class MethodDescriptorProtoOrBuilderAdapter(MethodDescriptorProtoOrBuilder): ... diff --git a/src/conductor/client/adapters/models/method_options_adapter.py b/src/conductor/client/adapters/models/method_options_adapter.py new file mode 100644 index 00000000..db5b03e9 --- /dev/null +++ b/src/conductor/client/adapters/models/method_options_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import MethodOptions + + +class MethodOptionsAdapter(MethodOptions): ... diff --git a/src/conductor/client/adapters/models/method_options_or_builder_adapter.py b/src/conductor/client/adapters/models/method_options_or_builder_adapter.py new file mode 100644 index 00000000..86213d4c --- /dev/null +++ b/src/conductor/client/adapters/models/method_options_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import MethodOptionsOrBuilder + + +class MethodOptionsOrBuilderAdapter(MethodOptionsOrBuilder): ... diff --git a/src/conductor/client/adapters/models/metrics_token_adapter.py b/src/conductor/client/adapters/models/metrics_token_adapter.py new file mode 100644 index 00000000..c7622f82 --- /dev/null +++ b/src/conductor/client/adapters/models/metrics_token_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import MetricsToken + + +class MetricsTokenAdapter(MetricsToken): ... diff --git a/src/conductor/client/adapters/models/name_part_adapter.py b/src/conductor/client/adapters/models/name_part_adapter.py new file mode 100644 index 00000000..cef8f74c --- /dev/null +++ b/src/conductor/client/adapters/models/name_part_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import NamePart + + +class NamePartAdapter(NamePart): ... diff --git a/src/conductor/client/adapters/models/name_part_or_builder_adapter.py b/src/conductor/client/adapters/models/name_part_or_builder_adapter.py new file mode 100644 index 00000000..d9c49dcd --- /dev/null +++ b/src/conductor/client/adapters/models/name_part_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import NamePartOrBuilder + + +class NamePartOrBuilderAdapter(NamePartOrBuilder): ... diff --git a/src/conductor/client/adapters/models/oneof_descriptor_adapter.py b/src/conductor/client/adapters/models/oneof_descriptor_adapter.py new file mode 100644 index 00000000..401228b1 --- /dev/null +++ b/src/conductor/client/adapters/models/oneof_descriptor_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import OneofDescriptor + + +class OneofDescriptorAdapter(OneofDescriptor): ... diff --git a/src/conductor/client/adapters/models/oneof_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/oneof_descriptor_proto_adapter.py new file mode 100644 index 00000000..5a874a3f --- /dev/null +++ b/src/conductor/client/adapters/models/oneof_descriptor_proto_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import OneofDescriptorProto + + +class OneofDescriptorProtoAdapter(OneofDescriptorProto): ... diff --git a/src/conductor/client/adapters/models/oneof_descriptor_proto_or_builder_adapter.py b/src/conductor/client/adapters/models/oneof_descriptor_proto_or_builder_adapter.py new file mode 100644 index 00000000..85eaa632 --- /dev/null +++ b/src/conductor/client/adapters/models/oneof_descriptor_proto_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import OneofDescriptorProtoOrBuilder + + +class OneofDescriptorProtoOrBuilderAdapter(OneofDescriptorProtoOrBuilder): ... diff --git a/src/conductor/client/adapters/models/oneof_options_adapter.py b/src/conductor/client/adapters/models/oneof_options_adapter.py new file mode 100644 index 00000000..94f7465e --- /dev/null +++ b/src/conductor/client/adapters/models/oneof_options_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import OneofOptions + + +class OneofOptionsAdapter(OneofOptions): ... diff --git a/src/conductor/client/adapters/models/oneof_options_or_builder_adapter.py b/src/conductor/client/adapters/models/oneof_options_or_builder_adapter.py new file mode 100644 index 00000000..77a41c84 --- /dev/null +++ b/src/conductor/client/adapters/models/oneof_options_or_builder_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import OneofOptionsOrBuilder + + +class OneofOptionsOrBuilderAdapter(OneofOptionsOrBuilder): ... diff --git a/src/conductor/client/adapters/models/option_adapter.py b/src/conductor/client/adapters/models/option_adapter.py new file mode 100644 index 00000000..745cefae --- /dev/null +++ b/src/conductor/client/adapters/models/option_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import Option + + +class OptionAdapter(Option): ... diff --git a/src/conductor/client/adapters/models/parser_adapter.py b/src/conductor/client/adapters/models/parser_adapter.py new file mode 100644 index 00000000..d23b6f06 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.parser_adapter import ParserAdapter + +Parser = ParserAdapter + +__all__ = ["Parser"] diff --git a/src/conductor/client/adapters/models/parser_any_adapter.py b/src/conductor/client/adapters/models/parser_any_adapter.py new file mode 100644 index 00000000..ea97b98a --- /dev/null +++ b/src/conductor/client/adapters/models/parser_any_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.parser_any import ParserAny + + +class ParserAnyAdapter(ParserAny): + pass diff --git a/src/conductor/client/adapters/models/parser_declaration_adapter.py b/src/conductor/client/adapters/models/parser_declaration_adapter.py new file mode 100644 index 00000000..5c1ea333 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_declaration_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_declaration import \ + ParserDeclaration + + +class ParserDeclarationAdapter(ParserDeclaration): + pass diff --git a/src/conductor/client/adapters/models/parser_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/parser_descriptor_proto_adapter.py new file mode 100644 index 00000000..7c2f6ccc --- /dev/null +++ b/src/conductor/client/adapters/models/parser_descriptor_proto_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_descriptor_proto import \ + ParserDescriptorProto + + +class ParserDescriptorProtoAdapter(ParserDescriptorProto): + pass diff --git a/src/conductor/client/adapters/models/parser_edition_default_adapter.py b/src/conductor/client/adapters/models/parser_edition_default_adapter.py new file mode 100644 index 00000000..793fd0df --- /dev/null +++ b/src/conductor/client/adapters/models/parser_edition_default_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_edition_default import \ + ParserEditionDefault + + +class ParserEditionDefaultAdapter(ParserEditionDefault): + pass diff --git a/src/conductor/client/adapters/models/parser_enum_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/parser_enum_descriptor_proto_adapter.py new file mode 100644 index 00000000..5a4602c9 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_enum_descriptor_proto_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_enum_descriptor_proto import \ + ParserEnumDescriptorProto + + +class ParserEnumDescriptorProtoAdapter(ParserEnumDescriptorProto): + pass diff --git a/src/conductor/client/adapters/models/parser_enum_options_adapter.py b/src/conductor/client/adapters/models/parser_enum_options_adapter.py new file mode 100644 index 00000000..1c783623 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_enum_options_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_enum_options import \ + ParserEnumOptions + + +class ParserEnumOptionsAdapter(ParserEnumOptions): + pass diff --git a/src/conductor/client/adapters/models/parser_enum_reserved_range_adapter.py b/src/conductor/client/adapters/models/parser_enum_reserved_range_adapter.py new file mode 100644 index 00000000..c091c89c --- /dev/null +++ b/src/conductor/client/adapters/models/parser_enum_reserved_range_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_enum_reserved_range import \ + ParserEnumReservedRange + + +class ParserEnumReservedRangeAdapter(ParserEnumReservedRange): + pass diff --git a/src/conductor/client/adapters/models/parser_enum_value_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/parser_enum_value_descriptor_proto_adapter.py new file mode 100644 index 00000000..59ce5ac5 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_enum_value_descriptor_proto_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_enum_value_descriptor_proto import \ + ParserEnumValueDescriptorProto + + +class ParserEnumValueDescriptorProtoAdapter(ParserEnumValueDescriptorProto): + pass diff --git a/src/conductor/client/adapters/models/parser_enum_value_options_adapter.py b/src/conductor/client/adapters/models/parser_enum_value_options_adapter.py new file mode 100644 index 00000000..4fe65493 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_enum_value_options_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_enum_value_options import \ + ParserEnumValueOptions + + +class ParserEnumValueOptionsAdapter(ParserEnumValueOptions): + pass diff --git a/src/conductor/client/adapters/models/parser_extension_range_adapter.py b/src/conductor/client/adapters/models/parser_extension_range_adapter.py new file mode 100644 index 00000000..64880b0d --- /dev/null +++ b/src/conductor/client/adapters/models/parser_extension_range_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_extension_range import \ + ParserExtensionRange + + +class ParserExtensionRangeAdapter(ParserExtensionRange): + pass diff --git a/src/conductor/client/adapters/models/parser_extension_range_options_adapter.py b/src/conductor/client/adapters/models/parser_extension_range_options_adapter.py new file mode 100644 index 00000000..a156a699 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_extension_range_options_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_extension_range_options import \ + ParserExtensionRangeOptions + + +class ParserExtensionRangeOptionsAdapter(ParserExtensionRangeOptions): + pass diff --git a/src/conductor/client/adapters/models/parser_feature_set_adapter.py b/src/conductor/client/adapters/models/parser_feature_set_adapter.py new file mode 100644 index 00000000..59a8d631 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_feature_set_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.parser_feature_set import ParserFeatureSet + + +class ParserFeatureSetAdapter(ParserFeatureSet): + pass diff --git a/src/conductor/client/adapters/models/parser_field_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/parser_field_descriptor_proto_adapter.py new file mode 100644 index 00000000..7ac679b9 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_field_descriptor_proto_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_field_descriptor_proto import \ + ParserFieldDescriptorProto + + +class ParserFieldDescriptorProtoAdapter(ParserFieldDescriptorProto): + pass diff --git a/src/conductor/client/adapters/models/parser_field_options_adapter.py b/src/conductor/client/adapters/models/parser_field_options_adapter.py new file mode 100644 index 00000000..d2c06dfc --- /dev/null +++ b/src/conductor/client/adapters/models/parser_field_options_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_field_options import \ + ParserFieldOptions + + +class ParserFieldOptionsAdapter(ParserFieldOptions): + pass diff --git a/src/conductor/client/adapters/models/parser_file_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/parser_file_descriptor_proto_adapter.py new file mode 100644 index 00000000..379a6d2b --- /dev/null +++ b/src/conductor/client/adapters/models/parser_file_descriptor_proto_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_file_descriptor_proto import \ + ParserFileDescriptorProto + + +class ParserFileDescriptorProtoAdapter(ParserFileDescriptorProto): + pass diff --git a/src/conductor/client/adapters/models/parser_file_options_adapter.py b/src/conductor/client/adapters/models/parser_file_options_adapter.py new file mode 100644 index 00000000..69a1c6f4 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_file_options_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_file_options import \ + ParserFileOptions + + +class ParserFileOptionsAdapter(ParserFileOptions): + pass diff --git a/src/conductor/client/adapters/models/parser_location_adapter.py b/src/conductor/client/adapters/models/parser_location_adapter.py new file mode 100644 index 00000000..fc2c3608 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_location_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.parser_location import ParserLocation + + +class ParserLocationAdapter(ParserLocation): + pass diff --git a/src/conductor/client/adapters/models/parser_message_adapter.py b/src/conductor/client/adapters/models/parser_message_adapter.py new file mode 100644 index 00000000..3cefba73 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_message_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.parser_message import ParserMessage + + +class ParserMessageAdapter(ParserMessage): + pass diff --git a/src/conductor/client/adapters/models/parser_message_lite_adapter.py b/src/conductor/client/adapters/models/parser_message_lite_adapter.py new file mode 100644 index 00000000..7982c0b3 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_message_lite_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_message_lite import \ + ParserMessageLite + + +class ParserMessageLiteAdapter(ParserMessageLite): + pass diff --git a/src/conductor/client/adapters/models/parser_message_options_adapter.py b/src/conductor/client/adapters/models/parser_message_options_adapter.py new file mode 100644 index 00000000..9e55fc43 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_message_options_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_message_options import \ + ParserMessageOptions + + +class ParserMessageOptionsAdapter(ParserMessageOptions): + pass diff --git a/src/conductor/client/adapters/models/parser_method_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/parser_method_descriptor_proto_adapter.py new file mode 100644 index 00000000..3e20067f --- /dev/null +++ b/src/conductor/client/adapters/models/parser_method_descriptor_proto_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_method_descriptor_proto import \ + ParserMethodDescriptorProto + + +class ParserMethodDescriptorProtoAdapter(ParserMethodDescriptorProto): + pass diff --git a/src/conductor/client/adapters/models/parser_method_options_adapter.py b/src/conductor/client/adapters/models/parser_method_options_adapter.py new file mode 100644 index 00000000..05848590 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_method_options_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_method_options import \ + ParserMethodOptions + + +class ParserMethodOptionsAdapter(ParserMethodOptions): + pass diff --git a/src/conductor/client/adapters/models/parser_name_part_adapter.py b/src/conductor/client/adapters/models/parser_name_part_adapter.py new file mode 100644 index 00000000..5ef139a1 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_name_part_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.parser_name_part import ParserNamePart + + +class ParserNamePartAdapter(ParserNamePart): + pass diff --git a/src/conductor/client/adapters/models/parser_oneof_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/parser_oneof_descriptor_proto_adapter.py new file mode 100644 index 00000000..614b0a7d --- /dev/null +++ b/src/conductor/client/adapters/models/parser_oneof_descriptor_proto_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_oneof_descriptor_proto import \ + ParserOneofDescriptorProto + + +class ParserOneofDescriptorProtoAdapter(ParserOneofDescriptorProto): + pass diff --git a/src/conductor/client/adapters/models/parser_oneof_options_adapter.py b/src/conductor/client/adapters/models/parser_oneof_options_adapter.py new file mode 100644 index 00000000..822531c5 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_oneof_options_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_oneof_options import \ + ParserOneofOptions + + +class ParserOneofOptionsAdapter(ParserOneofOptions): + pass diff --git a/src/conductor/client/adapters/models/parser_reserved_range_adapter.py b/src/conductor/client/adapters/models/parser_reserved_range_adapter.py new file mode 100644 index 00000000..9acc3945 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_reserved_range_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_reserved_range import \ + ParserReservedRange + + +class ParserReservedRangeAdapter(ParserReservedRange): + pass diff --git a/src/conductor/client/adapters/models/parser_service_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/parser_service_descriptor_proto_adapter.py new file mode 100644 index 00000000..ed5d42ca --- /dev/null +++ b/src/conductor/client/adapters/models/parser_service_descriptor_proto_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_service_descriptor_proto import \ + ParserServiceDescriptorProto + + +class ParserServiceDescriptorProtoAdapter(ParserServiceDescriptorProto): + pass diff --git a/src/conductor/client/adapters/models/parser_service_options_adapter.py b/src/conductor/client/adapters/models/parser_service_options_adapter.py new file mode 100644 index 00000000..97b17c1d --- /dev/null +++ b/src/conductor/client/adapters/models/parser_service_options_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_service_options import \ + ParserServiceOptions + + +class ParserServiceOptionsAdapter(ParserServiceOptions): + pass diff --git a/src/conductor/client/adapters/models/parser_source_code_info_adapter.py b/src/conductor/client/adapters/models/parser_source_code_info_adapter.py new file mode 100644 index 00000000..8f9dd2b3 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_source_code_info_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_source_code_info import \ + ParserSourceCodeInfo + + +class ParserSourceCodeInfoAdapter(ParserSourceCodeInfo): + pass diff --git a/src/conductor/client/adapters/models/parser_uninterpreted_option_adapter.py b/src/conductor/client/adapters/models/parser_uninterpreted_option_adapter.py new file mode 100644 index 00000000..3bb59635 --- /dev/null +++ b/src/conductor/client/adapters/models/parser_uninterpreted_option_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.parser_uninterpreted_option import \ + ParserUninterpretedOption + + +class ParserUninterpretedOptionAdapter(ParserUninterpretedOption): + pass diff --git a/src/conductor/client/adapters/models/permission_adapter.py b/src/conductor/client/adapters/models/permission_adapter.py new file mode 100644 index 00000000..63750216 --- /dev/null +++ b/src/conductor/client/adapters/models/permission_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import Permission + + +class PermissionAdapter(Permission): ... diff --git a/src/conductor/client/adapters/models/poll_data_adapter.py b/src/conductor/client/adapters/models/poll_data_adapter.py new file mode 100644 index 00000000..4d8adc79 --- /dev/null +++ b/src/conductor/client/adapters/models/poll_data_adapter.py @@ -0,0 +1,13 @@ +from conductor.client.codegen.models import PollData + + +class PollDataAdapter(PollData): + def __init__( + self, queue_name=None, domain=None, worker_id=None, last_poll_time=None + ): + super().__init__( + domain=domain, + last_poll_time=last_poll_time, + queue_name=queue_name, + worker_id=worker_id, + ) diff --git a/src/conductor/client/adapters/models/prompt_template_adapter.py b/src/conductor/client/adapters/models/prompt_template_adapter.py new file mode 100644 index 00000000..2ce4bf17 --- /dev/null +++ b/src/conductor/client/adapters/models/prompt_template_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models.prompt_template import PromptTemplate + + +class PromptTemplateAdapter(PromptTemplate): ... diff --git a/src/conductor/client/adapters/models/prompt_template_test_request_adapter.py b/src/conductor/client/adapters/models/prompt_template_test_request_adapter.py new file mode 100644 index 00000000..705554f6 --- /dev/null +++ b/src/conductor/client/adapters/models/prompt_template_test_request_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models import PromptTemplateTestRequest + + +class PromptTemplateTestRequestAdapter(PromptTemplateTestRequest): ... diff --git a/src/conductor/client/adapters/models/prompt_test_request_adapter.py b/src/conductor/client/adapters/models/prompt_test_request_adapter.py new file mode 100644 index 00000000..03b68dfe --- /dev/null +++ b/src/conductor/client/adapters/models/prompt_test_request_adapter.py @@ -0,0 +1,6 @@ +from src.conductor.client.adapters.models.prompt_template_adapter import \ + PromptTemplate + + +class PromptTemplateRequestAdapter(PromptTemplate): + pass diff --git a/src/conductor/client/adapters/models/proto_registry_entry_adapter.py b/src/conductor/client/adapters/models/proto_registry_entry_adapter.py new file mode 100644 index 00000000..33b01bbc --- /dev/null +++ b/src/conductor/client/adapters/models/proto_registry_entry_adapter.py @@ -0,0 +1,6 @@ +from src.conductor.client.codegen.models.proto_registry_entry import \ + ProtoRegistryEntry + + +class ProtoRegistryEntryAdapter(ProtoRegistryEntry): + pass diff --git a/src/conductor/client/adapters/models/rate_limit_adapter.py b/src/conductor/client/adapters/models/rate_limit_adapter.py new file mode 100644 index 00000000..987384e5 --- /dev/null +++ b/src/conductor/client/adapters/models/rate_limit_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.rate_limit import RateLimit + + +class RateLimitAdapter(RateLimit): + pass diff --git a/src/conductor/client/adapters/models/rate_limit_config_adapter.py b/src/conductor/client/adapters/models/rate_limit_config_adapter.py new file mode 100644 index 00000000..8efee0e3 --- /dev/null +++ b/src/conductor/client/adapters/models/rate_limit_config_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.rate_limit_config import RateLimitConfig + + +class RateLimitConfigAdapter(RateLimitConfig): + pass diff --git a/src/conductor/client/adapters/models/request_param_adapter.py b/src/conductor/client/adapters/models/request_param_adapter.py new file mode 100644 index 00000000..a77d4910 --- /dev/null +++ b/src/conductor/client/adapters/models/request_param_adapter.py @@ -0,0 +1,9 @@ +from conductor.client.codegen.models.request_param import RequestParam, Schema + + +class RequestParamAdapter(RequestParam): + pass + + +class SchemaAdapter(Schema): + pass diff --git a/src/conductor/client/adapters/models/rerun_workflow_request_adapter.py b/src/conductor/client/adapters/models/rerun_workflow_request_adapter.py new file mode 100644 index 00000000..3d90ae36 --- /dev/null +++ b/src/conductor/client/adapters/models/rerun_workflow_request_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.rerun_workflow_request import \ + RerunWorkflowRequest + + +class RerunWorkflowRequestAdapter(RerunWorkflowRequest): + pass diff --git a/src/conductor/client/adapters/models/reserved_range_adapter.py b/src/conductor/client/adapters/models/reserved_range_adapter.py new file mode 100644 index 00000000..2f98c1b2 --- /dev/null +++ b/src/conductor/client/adapters/models/reserved_range_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.reserved_range import ReservedRange + + +class ReservedRangeAdapter(ReservedRange): + pass diff --git a/src/conductor/client/adapters/models/reserved_range_or_builder_adapter.py b/src/conductor/client/adapters/models/reserved_range_or_builder_adapter.py new file mode 100644 index 00000000..f3673d96 --- /dev/null +++ b/src/conductor/client/adapters/models/reserved_range_or_builder_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.reserved_range_or_builder import \ + ReservedRangeOrBuilder + + +class ReservedRangeOrBuilderAdapter(ReservedRangeOrBuilder): + pass diff --git a/src/conductor/client/adapters/models/response_adapter.py b/src/conductor/client/adapters/models/response_adapter.py new file mode 100644 index 00000000..b7dd5d88 --- /dev/null +++ b/src/conductor/client/adapters/models/response_adapter.py @@ -0,0 +1,13 @@ +from conductor.client.codegen.models.response import Response + + +class ResponseAdapter(Response): + """NOTE: This class is adapter for auto generated by the swagger code generator program.""" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ diff --git a/src/conductor/client/adapters/models/role_adapter.py b/src/conductor/client/adapters/models/role_adapter.py new file mode 100644 index 00000000..f8623af7 --- /dev/null +++ b/src/conductor/client/adapters/models/role_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.role import Role + + +class RoleAdapter(Role): + pass diff --git a/src/conductor/client/adapters/models/save_schedule_request_adapter.py b/src/conductor/client/adapters/models/save_schedule_request_adapter.py new file mode 100644 index 00000000..a2cb4c07 --- /dev/null +++ b/src/conductor/client/adapters/models/save_schedule_request_adapter.py @@ -0,0 +1,15 @@ +from conductor.client.codegen.models.save_schedule_request import \ + SaveScheduleRequest + + +class SaveScheduleRequestAdapter(SaveScheduleRequest): + @SaveScheduleRequest.start_workflow_request.setter + def start_workflow_request(self, start_workflow_request): + """Sets the start_workflow_request of this SaveScheduleRequest. + + + :param start_workflow_request: The start_workflow_request of this SaveScheduleRequest. # noqa: E501 + :type: StartWorkflowRequest + """ + + self._start_workflow_request = start_workflow_request diff --git a/src/conductor/client/adapters/models/schema_def_adapter.py b/src/conductor/client/adapters/models/schema_def_adapter.py new file mode 100644 index 00000000..1d24ad71 --- /dev/null +++ b/src/conductor/client/adapters/models/schema_def_adapter.py @@ -0,0 +1,88 @@ +from enum import Enum + +from conductor.client.codegen.models.schema_def import SchemaDef + + +class SchemaType(str, Enum): + JSON = ("JSON",) + AVRO = ("AVRO",) + PROTOBUF = "PROTOBUF" + + def __str__(self) -> str: + return self.name.__str__() + + +class SchemaDefAdapter(SchemaDef): + def __init__( + self, + create_time=None, + created_by=None, + data=None, + external_ref=None, + name=None, + owner_app=None, + type=None, + update_time=None, + updated_by=None, + version=1, + ): # noqa: E501 + """SchemaDef - a model defined in Swagger""" # noqa: E501 + self._create_time = None + self._created_by = None + self._data = None + self._external_ref = None + self._name = None + self._owner_app = None + self._type = None + self._update_time = None + self._updated_by = None + self._version = None + self.discriminator = None + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if data is not None: + self.data = data + if external_ref is not None: + self.external_ref = external_ref + self.name = name + if owner_app is not None: + self.owner_app = owner_app + self.type = type + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + if version is not None: + self.version = version + + @SchemaDef.type.setter + def type(self, type): + """Sets the type of this SchemaDef. + + + :param type: The type of this SchemaDef. + :type: str + """ + self._type = type + + @SchemaDef.name.setter + def name(self, name): + """Sets the name of this SchemaDef. + + + :param name: The name of this SchemaDef. # noqa: E501 + :type: str + """ + self._name = name + + @SchemaDef.version.setter + def version(self, version): + """Sets the data of this SchemaDef. + + + :param data: The data of this SchemaDef. # noqa: E501 + :type: dict(str, object) + """ + self._version = version diff --git a/src/conductor/client/adapters/models/scrollable_search_result_workflow_summary_adapter.py b/src/conductor/client/adapters/models/scrollable_search_result_workflow_summary_adapter.py new file mode 100644 index 00000000..a4ad31f7 --- /dev/null +++ b/src/conductor/client/adapters/models/scrollable_search_result_workflow_summary_adapter.py @@ -0,0 +1,8 @@ +from conductor.client.codegen.models.scrollable_search_result_workflow_summary import \ + ScrollableSearchResultWorkflowSummary + + +class ScrollableSearchResultWorkflowSummaryAdapter( + ScrollableSearchResultWorkflowSummary +): + pass diff --git a/src/conductor/client/adapters/models/search_result_handled_event_response_adapter.py b/src/conductor/client/adapters/models/search_result_handled_event_response_adapter.py new file mode 100644 index 00000000..57d863cd --- /dev/null +++ b/src/conductor/client/adapters/models/search_result_handled_event_response_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.search_result_handled_event_response import \ + SearchResultHandledEventResponse + + +class SearchResultHandledEventResponseAdapter(SearchResultHandledEventResponse): + pass diff --git a/src/conductor/client/adapters/models/search_result_task_adapter.py b/src/conductor/client/adapters/models/search_result_task_adapter.py new file mode 100644 index 00000000..518af770 --- /dev/null +++ b/src/conductor/client/adapters/models/search_result_task_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.search_result_task import SearchResultTask + + +class SearchResultTaskAdapter(SearchResultTask): + pass diff --git a/src/conductor/client/adapters/models/search_result_task_summary_adapter.py b/src/conductor/client/adapters/models/search_result_task_summary_adapter.py new file mode 100644 index 00000000..9274c6ca --- /dev/null +++ b/src/conductor/client/adapters/models/search_result_task_summary_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.search_result_task_summary import \ + SearchResultTaskSummary + + +class SearchResultTaskSummaryAdapter(SearchResultTaskSummary): + pass diff --git a/src/conductor/client/adapters/models/search_result_workflow_adapter.py b/src/conductor/client/adapters/models/search_result_workflow_adapter.py new file mode 100644 index 00000000..6ef958a7 --- /dev/null +++ b/src/conductor/client/adapters/models/search_result_workflow_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.search_result_workflow import \ + SearchResultWorkflow + + +class SearchResultWorkflowAdapter(SearchResultWorkflow): + pass diff --git a/src/conductor/client/adapters/models/search_result_workflow_schedule_execution_model_adapter.py b/src/conductor/client/adapters/models/search_result_workflow_schedule_execution_model_adapter.py new file mode 100644 index 00000000..db26ded3 --- /dev/null +++ b/src/conductor/client/adapters/models/search_result_workflow_schedule_execution_model_adapter.py @@ -0,0 +1,8 @@ +from conductor.client.codegen.models.search_result_workflow_schedule_execution_model import \ + SearchResultWorkflowScheduleExecutionModel + + +class SearchResultWorkflowScheduleExecutionModelAdapter( + SearchResultWorkflowScheduleExecutionModel +): + pass diff --git a/src/conductor/client/adapters/models/search_result_workflow_summary_adapter.py b/src/conductor/client/adapters/models/search_result_workflow_summary_adapter.py new file mode 100644 index 00000000..12a5e2b4 --- /dev/null +++ b/src/conductor/client/adapters/models/search_result_workflow_summary_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.search_result_workflow_summary import \ + SearchResultWorkflowSummary + + +class SearchResultWorkflowSummaryAdapter(SearchResultWorkflowSummary): + pass diff --git a/src/conductor/client/adapters/models/service_descriptor_adapter.py b/src/conductor/client/adapters/models/service_descriptor_adapter.py new file mode 100644 index 00000000..65cab1a7 --- /dev/null +++ b/src/conductor/client/adapters/models/service_descriptor_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.service_descriptor import \ + ServiceDescriptor + + +class ServiceDescriptorAdapter(ServiceDescriptor): + pass diff --git a/src/conductor/client/adapters/models/service_descriptor_proto_adapter.py b/src/conductor/client/adapters/models/service_descriptor_proto_adapter.py new file mode 100644 index 00000000..4c7aed62 --- /dev/null +++ b/src/conductor/client/adapters/models/service_descriptor_proto_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.service_descriptor_proto import \ + ServiceDescriptorProto + + +class ServiceDescriptorProtoAdapter(ServiceDescriptorProto): + pass diff --git a/src/conductor/client/adapters/models/service_descriptor_proto_or_builder_adapter.py b/src/conductor/client/adapters/models/service_descriptor_proto_or_builder_adapter.py new file mode 100644 index 00000000..7401d163 --- /dev/null +++ b/src/conductor/client/adapters/models/service_descriptor_proto_or_builder_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.service_descriptor_proto_or_builder import \ + ServiceDescriptorProtoOrBuilder + + +class ServiceDescriptorProtoOrBuilderAdapter(ServiceDescriptorProtoOrBuilder): + pass diff --git a/src/conductor/client/adapters/models/service_method_adapter.py b/src/conductor/client/adapters/models/service_method_adapter.py new file mode 100644 index 00000000..813e26ef --- /dev/null +++ b/src/conductor/client/adapters/models/service_method_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.service_method import ServiceMethod + + +class ServiceMethodAdapter(ServiceMethod): + pass diff --git a/src/conductor/client/adapters/models/service_options_adapter.py b/src/conductor/client/adapters/models/service_options_adapter.py new file mode 100644 index 00000000..84bc5d23 --- /dev/null +++ b/src/conductor/client/adapters/models/service_options_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.service_options import ServiceOptions + + +class ServiceOptionsAdapter(ServiceOptions): + pass diff --git a/src/conductor/client/adapters/models/service_options_or_builder_adapter.py b/src/conductor/client/adapters/models/service_options_or_builder_adapter.py new file mode 100644 index 00000000..e1ae254e --- /dev/null +++ b/src/conductor/client/adapters/models/service_options_or_builder_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.service_options_or_builder import \ + ServiceOptionsOrBuilder + + +class ServiceOptionsOrBuilderAdapter(ServiceOptionsOrBuilder): + pass diff --git a/src/conductor/client/adapters/models/service_registry_adapter.py b/src/conductor/client/adapters/models/service_registry_adapter.py new file mode 100644 index 00000000..7183745e --- /dev/null +++ b/src/conductor/client/adapters/models/service_registry_adapter.py @@ -0,0 +1,21 @@ +from enum import Enum + +from conductor.client.codegen.models.service_registry import ( + Config, OrkesCircuitBreakerConfig, ServiceRegistry) + + +class ServiceType(str, Enum): + HTTP = "HTTP" + GRPC = "gRPC" + + +class ServiceRegistryAdapter(ServiceRegistry): + pass + + +class OrkesCircuitBreakerConfigAdapter(OrkesCircuitBreakerConfig): + pass + + +class ConfigAdapter(Config): + pass diff --git a/src/conductor/client/adapters/models/signal_response_adapter.py b/src/conductor/client/adapters/models/signal_response_adapter.py new file mode 100644 index 00000000..33b46a3b --- /dev/null +++ b/src/conductor/client/adapters/models/signal_response_adapter.py @@ -0,0 +1,31 @@ +from enum import Enum + +from conductor.client.codegen.models.signal_response import SignalResponse + + +class WorkflowSignalReturnStrategy(Enum): + """Enum for workflow signal return strategy""" + + TARGET_WORKFLOW = "TARGET_WORKFLOW" + BLOCKING_WORKFLOW = "BLOCKING_WORKFLOW" + BLOCKING_TASK = "BLOCKING_TASK" + BLOCKING_TASK_INPUT = "BLOCKING_TASK_INPUT" + + +class TaskStatus(Enum): + """Enum for task status""" + + IN_PROGRESS = "IN_PROGRESS" + CANCELED = "CANCELED" + FAILED = "FAILED" + FAILED_WITH_TERMINAL_ERROR = "FAILED_WITH_TERMINAL_ERROR" + COMPLETED = "COMPLETED" + COMPLETED_WITH_ERRORS = "COMPLETED_WITH_ERRORS" + SCHEDULED = "SCHEDULED" + TIMED_OUT = "TIMED_OUT" + READY_FOR_RERUN = "READY_FOR_RERUN" + SKIPPED = "SKIPPED" + + +class SignalResponseAdapter(SignalResponse): + pass diff --git a/src/conductor/client/adapters/models/skip_task_request_adapter.py b/src/conductor/client/adapters/models/skip_task_request_adapter.py new file mode 100644 index 00000000..0b33c60a --- /dev/null +++ b/src/conductor/client/adapters/models/skip_task_request_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.skip_task_request import SkipTaskRequest + + +class SkipTaskRequestAdapter(SkipTaskRequest): + pass diff --git a/src/conductor/client/adapters/models/source_code_info_adapter.py b/src/conductor/client/adapters/models/source_code_info_adapter.py new file mode 100644 index 00000000..a3902025 --- /dev/null +++ b/src/conductor/client/adapters/models/source_code_info_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.source_code_info import SourceCodeInfo + + +class SourceCodeInfoAdapter(SourceCodeInfo): + pass diff --git a/src/conductor/client/adapters/models/source_code_info_or_builder_adapter.py b/src/conductor/client/adapters/models/source_code_info_or_builder_adapter.py new file mode 100644 index 00000000..5a347af0 --- /dev/null +++ b/src/conductor/client/adapters/models/source_code_info_or_builder_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.source_code_info_or_builder import \ + SourceCodeInfoOrBuilder + + +class SourceCodeInfoOrBuilderAdapter(SourceCodeInfoOrBuilder): + pass diff --git a/src/conductor/client/adapters/models/start_workflow_adapter.py b/src/conductor/client/adapters/models/start_workflow_adapter.py new file mode 100644 index 00000000..02353600 --- /dev/null +++ b/src/conductor/client/adapters/models/start_workflow_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.start_workflow import StartWorkflow + + +class StartWorkflowAdapter(StartWorkflow): + pass diff --git a/src/conductor/client/adapters/models/start_workflow_request_adapter.py b/src/conductor/client/adapters/models/start_workflow_request_adapter.py new file mode 100644 index 00000000..2ef2821d --- /dev/null +++ b/src/conductor/client/adapters/models/start_workflow_request_adapter.py @@ -0,0 +1,75 @@ +from enum import Enum + +from conductor.client.codegen.models.start_workflow_request import \ + StartWorkflowRequest + + +class IdempotencyStrategy(str, Enum): # shared + FAIL = ("FAIL",) + RETURN_EXISTING = "RETURN_EXISTING" + + def __str__(self) -> str: + return self.name.__str__() + + +class StartWorkflowRequestAdapter(StartWorkflowRequest): + def __init__( + self, + correlation_id=None, + created_by=None, + external_input_payload_storage_path=None, + idempotency_key=None, + idempotency_strategy=None, + input=None, + name=None, + priority=None, + task_to_domain=None, + version=None, + workflow_def=None, + ): # noqa: E501 + """StartWorkflowRequest - a model defined in Swagger""" # noqa: E501 + self._correlation_id = None + self._created_by = None + self._external_input_payload_storage_path = None + self._idempotency_key = None + self._idempotency_strategy = IdempotencyStrategy.FAIL + self._input = None + self._name = None + self._priority = None + self._task_to_domain = None + self._version = None + self._workflow_def = None + self.discriminator = None + if correlation_id is not None: + self.correlation_id = correlation_id + if created_by is not None: + self.created_by = created_by + if external_input_payload_storage_path is not None: + self.external_input_payload_storage_path = ( + external_input_payload_storage_path + ) + if idempotency_key is not None: + self.idempotency_key = idempotency_key + if idempotency_strategy is not None: + self.idempotency_strategy = idempotency_strategy + if input is not None: + self.input = input + self.name = name + if priority is not None: + self.priority = priority + if task_to_domain is not None: + self.task_to_domain = task_to_domain + if version is not None: + self.version = version + if workflow_def is not None: + self.workflow_def = workflow_def + + @StartWorkflowRequest.name.setter + def name(self, name): + """Sets the name of this StartWorkflowRequest. + + + :param name: The name of this StartWorkflowRequest. # noqa: E501 + :type: str + """ + self._name = name diff --git a/src/conductor/client/adapters/models/state_change_event_adapter.py b/src/conductor/client/adapters/models/state_change_event_adapter.py new file mode 100644 index 00000000..86ef8463 --- /dev/null +++ b/src/conductor/client/adapters/models/state_change_event_adapter.py @@ -0,0 +1,139 @@ +from __future__ import annotations + +from enum import Enum +from typing import Dict, List, Union + +from typing_extensions import Self + +from conductor.client.codegen.models.state_change_event import StateChangeEvent + + +class StateChangeEventType(Enum): + onScheduled = "onScheduled" + onStart = "onStart" + onFailed = "onFailed" + onSuccess = "onSuccess" + onCancelled = "onCancelled" + + +class StateChangeConfig: + swagger_types = {"type": "str", "events": "list[StateChangeEvent]"} + + attribute_map = {"type": "type", "events": "events"} + + # Keep original init for backward compatibility + def __init__( + self, + event_type: Union[str, StateChangeEventType, List[StateChangeEventType]] = None, + events: List[StateChangeEvent] = None, + ) -> None: + if event_type is None: + return + if isinstance(event_type, list): + str_values = [] + for et in event_type: + str_values.append(et.name) + self._type = ",".join(str_values) + else: + self._type = event_type.name + self._events = events + + @property + def type(self): + return self._type + + @type.setter + def type(self, event_type: StateChangeEventType) -> Self: + self._type = event_type.name + + @property + def events(self): + return self._events + + @events.setter + def events(self, events: List[StateChangeEvent]) -> Self: + self._events = events + + def to_dict(self) -> Dict: + """Returns the model properties as a dict""" + result = {} + for attr, _ in self.swagger_types.items(): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: ( + (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item + ), + value.items(), + ) + ) + else: + result[attr] = value + return result + + def to_str(self) -> str: + """Returns the string representation of the model""" + return f"StateChangeConfig{{type='{self.type}', events={self.events}}}" + + def __repr__(self) -> str: + return self.to_str() + + def __eq__(self, other) -> bool: + """Returns true if both objects are equal""" + if not isinstance(other, StateChangeConfig): + return False + return self.type == other.type and self.events == other.events + + def __ne__(self, other) -> bool: + """Returns true if both objects are not equal""" + return not self == other + + +class StateChangeEventAdapter(StateChangeEvent): + def __init__(self, payload=None, type=None): # noqa: E501 + """StateChangeEvent - a model defined in Swagger""" # noqa: E501 + self._payload = None + self._type = None + self.discriminator = None + self.payload = payload + self.type = type + + @StateChangeEvent.payload.setter + def payload(self, payload): + """Sets the payload of this StateChangeEvent. + + + :param payload: The payload of this StateChangeEvent. # noqa: E501 + :type: dict(str, object) + """ + if payload is None: + raise TypeError( + "Invalid value for `payload`, must not be `None`" + ) # noqa: E501 + + self._payload = payload + + @StateChangeEvent.type.setter + def type(self, type): + """Sets the type of this StateChangeEvent. + + + :param type: The type of this StateChangeEvent. # noqa: E501 + :type: str + """ + print(f"type: {type}") + if type is None: + raise TypeError( + "Invalid value for `type`, must not be `None`" + ) # noqa: E501 + + self._type = type diff --git a/src/conductor/client/adapters/models/sub_workflow_params_adapter.py b/src/conductor/client/adapters/models/sub_workflow_params_adapter.py new file mode 100644 index 00000000..ebf257df --- /dev/null +++ b/src/conductor/client/adapters/models/sub_workflow_params_adapter.py @@ -0,0 +1,15 @@ +from conductor.client.codegen.models.sub_workflow_params import \ + SubWorkflowParams + + +class SubWorkflowParamsAdapter(SubWorkflowParams): + @SubWorkflowParams.idempotency_strategy.setter + def idempotency_strategy(self, idempotency_strategy): + """Sets the idempotency_strategy of this SubWorkflowParams. + + + :param idempotency_strategy: The idempotency_strategy of this SubWorkflowParams. # noqa: E501 + :type: str + """ + + self._idempotency_strategy = idempotency_strategy diff --git a/src/conductor/client/adapters/models/subject_ref_adapter.py b/src/conductor/client/adapters/models/subject_ref_adapter.py new file mode 100644 index 00000000..fe13829c --- /dev/null +++ b/src/conductor/client/adapters/models/subject_ref_adapter.py @@ -0,0 +1,4 @@ +from conductor.client.codegen.models.subject_ref import SubjectRef + + +class SubjectRefAdapter(SubjectRef): ... diff --git a/src/conductor/client/adapters/models/tag_adapter.py b/src/conductor/client/adapters/models/tag_adapter.py new file mode 100644 index 00000000..262d074d --- /dev/null +++ b/src/conductor/client/adapters/models/tag_adapter.py @@ -0,0 +1,12 @@ +from enum import Enum + +from conductor.client.codegen.models.tag import Tag + + +class TypeEnum(str, Enum): + METADATA = "METADATA" + RATE_LIMIT = "RATE_LIMIT" + + +class TagAdapter(Tag): + pass diff --git a/src/conductor/client/adapters/models/tag_object_adapter.py b/src/conductor/client/adapters/models/tag_object_adapter.py new file mode 100644 index 00000000..7ac3e86b --- /dev/null +++ b/src/conductor/client/adapters/models/tag_object_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.tag_object import TagObject + + +class TagObjectAdapter(TagObject): + pass diff --git a/src/conductor/client/adapters/models/tag_string_adapter.py b/src/conductor/client/adapters/models/tag_string_adapter.py new file mode 100644 index 00000000..431f83fb --- /dev/null +++ b/src/conductor/client/adapters/models/tag_string_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.tag_string import TagString + + +class TagStringAdapter(TagString): + pass diff --git a/src/conductor/client/adapters/models/target_ref_adapter.py b/src/conductor/client/adapters/models/target_ref_adapter.py new file mode 100644 index 00000000..845bc461 --- /dev/null +++ b/src/conductor/client/adapters/models/target_ref_adapter.py @@ -0,0 +1,53 @@ +from conductor.client.codegen.models.target_ref import TargetRef + + +class TargetRefAdapter(TargetRef): + @TargetRef.id.setter + def id(self, id): + """Sets the id of this TargetRef. + + + :param id: The id of this TargetRef. # noqa: E501 + :type: str + """ + self._id = id + + @TargetRef.type.setter + def type(self, type): + """Sets the type of this TargetRef. + + + :param type: The type of this TargetRef. # noqa: E501 + :type: str + """ + allowed_values = [ + "WORKFLOW", + "WORKFLOW_DEF", + "WORKFLOW_SCHEDULE", + "EVENT_HANDLER", + "TASK_DEF", + "TASK_REF_NAME", + "TASK_ID", + "APPLICATION", + "USER", + "SECRET_NAME", + "ENV_VARIABLE", + "TAG", + "DOMAIN", + "INTEGRATION_PROVIDER", + "INTEGRATION", + "PROMPT", + "USER_FORM_TEMPLATE", + "SCHEMA", + "CLUSTER_CONFIG", + "WEBHOOK", + "SECRET", + ] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}".format( # noqa: E501 + type, allowed_values + ) + ) + + self._type = type diff --git a/src/conductor/client/adapters/models/task_adapter.py b/src/conductor/client/adapters/models/task_adapter.py new file mode 100644 index 00000000..cfaceb3b --- /dev/null +++ b/src/conductor/client/adapters/models/task_adapter.py @@ -0,0 +1,17 @@ +from conductor.client.adapters.models.task_result_adapter import \ + TaskResultAdapter +from conductor.client.codegen.models.task import Task +from conductor.shared.http.enums import TaskResultStatus + + +class TaskAdapter(Task): + def to_task_result( + self, status: TaskResultStatus = TaskResultStatus.COMPLETED + ) -> TaskResultAdapter: + task_result = TaskResultAdapter( + task_id=self.task_id, + workflow_instance_id=self.workflow_instance_id, + worker_id=self.worker_id, + status=status, + ) + return task_result diff --git a/src/conductor/client/adapters/models/task_def_adapter.py b/src/conductor/client/adapters/models/task_def_adapter.py new file mode 100644 index 00000000..875b7884 --- /dev/null +++ b/src/conductor/client/adapters/models/task_def_adapter.py @@ -0,0 +1,23 @@ +from conductor.client.codegen.models.task_def import TaskDef + + +class TaskDefAdapter(TaskDef): + @TaskDef.total_timeout_seconds.setter + def total_timeout_seconds(self, total_timeout_seconds): + """Sets the total_timeout_seconds of this TaskDef. + + + :param total_timeout_seconds: The total_timeout_seconds of this TaskDef. # noqa: E501 + :type: int + """ + self._total_timeout_seconds = total_timeout_seconds + + @TaskDef.timeout_seconds.setter + def timeout_seconds(self, timeout_seconds): + """Sets the timeout_seconds of this TaskDef. + + + :param timeout_seconds: The timeout_seconds of this TaskDef. # noqa: E501 + :type: int + """ + self._timeout_seconds = timeout_seconds diff --git a/src/conductor/client/adapters/models/task_details_adapter.py b/src/conductor/client/adapters/models/task_details_adapter.py new file mode 100644 index 00000000..3d6e998b --- /dev/null +++ b/src/conductor/client/adapters/models/task_details_adapter.py @@ -0,0 +1,15 @@ +from conductor.client.codegen.models.task_details import TaskDetails + + +class TaskDetailsAdapter(TaskDetails): + def put_output_item(self, key, output_item): + """Adds an item to the output dictionary. + + :param key: The key for the output item + :param output_item: The value to add + :return: self + """ + if self._output is None: + self._output = {} + self._output[key] = output_item + return self diff --git a/src/conductor/client/adapters/models/task_exec_log_adapter.py b/src/conductor/client/adapters/models/task_exec_log_adapter.py new file mode 100644 index 00000000..6f528dec --- /dev/null +++ b/src/conductor/client/adapters/models/task_exec_log_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.task_exec_log import TaskExecLog + + +class TaskExecLogAdapter(TaskExecLog): + pass diff --git a/src/conductor/client/adapters/models/task_list_search_result_summary_adapter.py b/src/conductor/client/adapters/models/task_list_search_result_summary_adapter.py new file mode 100644 index 00000000..6acd16bc --- /dev/null +++ b/src/conductor/client/adapters/models/task_list_search_result_summary_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.task_list_search_result_summary import \ + TaskListSearchResultSummary + + +class TaskListSearchResultSummaryAdapter(TaskListSearchResultSummary): + pass diff --git a/src/conductor/client/adapters/models/task_mock_adapter.py b/src/conductor/client/adapters/models/task_mock_adapter.py new file mode 100644 index 00000000..df44681f --- /dev/null +++ b/src/conductor/client/adapters/models/task_mock_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.task_mock import TaskMock + + +class TaskMockAdapter(TaskMock): + pass diff --git a/src/conductor/client/adapters/models/task_result_adapter.py b/src/conductor/client/adapters/models/task_result_adapter.py new file mode 100644 index 00000000..73950625 --- /dev/null +++ b/src/conductor/client/adapters/models/task_result_adapter.py @@ -0,0 +1,91 @@ +from conductor.client.adapters.models.task_exec_log_adapter import \ + TaskExecLogAdapter +from conductor.client.codegen.models.task_result import TaskResult +from conductor.client.http.models.task_result_status import TaskResultStatus + + +class TaskResultAdapter(TaskResult): + @TaskResult.status.setter + def status(self, status): + """Sets the status of this TaskResult. + + + :param status: The status of this TaskResult. # noqa: E501 + :type: str + """ + if isinstance(status, str): + try: + status = TaskResultStatus(status) + except ValueError: + raise ValueError( + f"Invalid value for `status` ({status}), must be one of {[e.value for e in TaskResultStatus]}" + ) + elif not isinstance(status, TaskResultStatus): + raise TypeError( + f"status must be a TaskStatus enum or string, got {type(status)}" + ) + + self._status = status + + def add_output_data(self, key, value): + if self.output_data is None: + self.output_data = {} + self.output_data[key] = value + return self + + def log(self, log): + """Adds a log entry to this TaskResult. + + :param log: The log message to add + :type: str + :return: This TaskResult instance + :rtype: TaskResult + """ + if self.logs is None: + self.logs = [] + self.logs.append(TaskExecLogAdapter(log=log)) + return self + + @staticmethod + def new_task_result(status): + """Creates a new TaskResult with the specified status. + + :param status: The status for the new TaskResult + :type: str + :return: A new TaskResult with the specified status + :rtype: TaskResult + """ + result = TaskResult() + result.status = status + return result + + @staticmethod + def complete(): + """Creates a new TaskResult with COMPLETED status. + + :return: A new TaskResult with COMPLETED status + :rtype: TaskResult + """ + return TaskResultAdapter.new_task_result("COMPLETED") + + @staticmethod + def failed(failure_reason): + """Creates a new TaskResult with FAILED status and the specified failure reason. + + :param failure_reason: The reason for failure + :type: str + :return: A new TaskResult with FAILED status and the specified failure reason + :rtype: TaskResult + """ + result = TaskResultAdapter.new_task_result("FAILED") + result.reason_for_incompletion = failure_reason + return result + + @staticmethod + def in_progress(): + """Creates a new TaskResult with IN_PROGRESS status. + + :return: A new TaskResult with IN_PROGRESS status + :rtype: TaskResult + """ + return TaskResultAdapter.new_task_result("IN_PROGRESS") diff --git a/src/conductor/client/adapters/models/task_summary_adapter.py b/src/conductor/client/adapters/models/task_summary_adapter.py new file mode 100644 index 00000000..5dff9dae --- /dev/null +++ b/src/conductor/client/adapters/models/task_summary_adapter.py @@ -0,0 +1,170 @@ +from __future__ import annotations + +from typing import ClassVar, Dict + +from conductor.client.codegen.models.task_summary import TaskSummary + + +class TaskSummaryAdapter(TaskSummary): + swagger_types: ClassVar[Dict[str, str]] = { + "correlation_id": "str", + "end_time": "str", + "execution_time": "int", + "external_input_payload_storage_path": "str", + "external_output_payload_storage_path": "str", + "input": "str", + "output": "str", + "queue_wait_time": "int", + "reason_for_incompletion": "str", + "scheduled_time": "str", + "start_time": "str", + "status": "str", + "task_def_name": "str", + "task_id": "str", + "task_reference_name": "str", + "task_type": "str", + "update_time": "str", + "workflow_id": "str", + "workflow_priority": "int", + "workflow_type": "str", + "domain": "str", + } + + attribute_map: ClassVar[Dict[str, str]] = { + "correlation_id": "correlationId", + "end_time": "endTime", + "execution_time": "executionTime", + "external_input_payload_storage_path": "externalInputPayloadStoragePath", + "external_output_payload_storage_path": "externalOutputPayloadStoragePath", + "input": "input", + "output": "output", + "queue_wait_time": "queueWaitTime", + "reason_for_incompletion": "reasonForIncompletion", + "scheduled_time": "scheduledTime", + "start_time": "startTime", + "status": "status", + "task_def_name": "taskDefName", + "task_id": "taskId", + "task_reference_name": "taskReferenceName", + "task_type": "taskType", + "update_time": "updateTime", + "workflow_id": "workflowId", + "workflow_priority": "workflowPriority", + "workflow_type": "workflowType", + "domain": "domain", + } + + def __init__( + self, + correlation_id=None, + end_time=None, + execution_time=None, + external_input_payload_storage_path=None, + external_output_payload_storage_path=None, + input=None, + output=None, + queue_wait_time=None, + reason_for_incompletion=None, + scheduled_time=None, + start_time=None, + status=None, + task_def_name=None, + task_id=None, + task_reference_name=None, + task_type=None, + update_time=None, + workflow_id=None, + workflow_priority=None, + workflow_type=None, + domain=None, + ): # noqa: E501 + """TaskSummary - a model defined in Swagger""" # noqa: E501 + self._correlation_id = None + self._end_time = None + self._execution_time = None + self._external_input_payload_storage_path = None + self._external_output_payload_storage_path = None + self._input = None + self._output = None + self._queue_wait_time = None + self._reason_for_incompletion = None + self._scheduled_time = None + self._start_time = None + self._status = None + self._task_def_name = None + self._task_id = None + self._task_reference_name = None + self._task_type = None + self._update_time = None + self._workflow_id = None + self._workflow_priority = None + self._workflow_type = None + self._domain = None + self.discriminator = None + if correlation_id is not None: + self.correlation_id = correlation_id + if end_time is not None: + self.end_time = end_time + if execution_time is not None: + self.execution_time = execution_time + if external_input_payload_storage_path is not None: + self.external_input_payload_storage_path = ( + external_input_payload_storage_path + ) + if external_output_payload_storage_path is not None: + self.external_output_payload_storage_path = ( + external_output_payload_storage_path + ) + if input is not None: + self.input = input + if output is not None: + self.output = output + if queue_wait_time is not None: + self.queue_wait_time = queue_wait_time + if reason_for_incompletion is not None: + self.reason_for_incompletion = reason_for_incompletion + if scheduled_time is not None: + self.scheduled_time = scheduled_time + if start_time is not None: + self.start_time = start_time + if status is not None: + self.status = status + if task_def_name is not None: + self.task_def_name = task_def_name + if task_id is not None: + self.task_id = task_id + if task_reference_name is not None: + self.task_reference_name = task_reference_name + if task_type is not None: + self.task_type = task_type + if update_time is not None: + self.update_time = update_time + if workflow_id is not None: + self.workflow_id = workflow_id + if workflow_priority is not None: + self.workflow_priority = workflow_priority + if workflow_type is not None: + self.workflow_type = workflow_type + if domain is not None: + self.domain = domain + + @property + def domain(self): + """Gets the domain of this TaskSummary. # noqa: E501 + + + :return: The domain of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._domain + + @domain.setter + def domain(self, domain): + """Sets the domain of this TaskSummary. + + + :param domain: The domain of this TaskSummary. # noqa: E501 + :type: str + """ + + self._domain = domain diff --git a/src/conductor/client/adapters/models/terminate_workflow_adapter.py b/src/conductor/client/adapters/models/terminate_workflow_adapter.py new file mode 100644 index 00000000..3430b682 --- /dev/null +++ b/src/conductor/client/adapters/models/terminate_workflow_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.terminate_workflow import \ + TerminateWorkflow + + +class TerminateWorkflowAdapter(TerminateWorkflow): + pass diff --git a/src/conductor/client/adapters/models/token_adapter.py b/src/conductor/client/adapters/models/token_adapter.py new file mode 100644 index 00000000..3cd3e222 --- /dev/null +++ b/src/conductor/client/adapters/models/token_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.token import Token + + +class TokenAdapter(Token): + pass diff --git a/src/conductor/client/adapters/models/uninterpreted_option_adapter.py b/src/conductor/client/adapters/models/uninterpreted_option_adapter.py new file mode 100644 index 00000000..375ee24d --- /dev/null +++ b/src/conductor/client/adapters/models/uninterpreted_option_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.uninterpreted_option import \ + UninterpretedOption + + +class UninterpretedOptionAdapter(UninterpretedOption): + pass diff --git a/src/conductor/client/adapters/models/uninterpreted_option_or_builder_adapter.py b/src/conductor/client/adapters/models/uninterpreted_option_or_builder_adapter.py new file mode 100644 index 00000000..49e5acfc --- /dev/null +++ b/src/conductor/client/adapters/models/uninterpreted_option_or_builder_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.uninterpreted_option_or_builder import \ + UninterpretedOptionOrBuilder + + +class UninterpretedOptionOrBuilderAdapter(UninterpretedOptionOrBuilder): + pass diff --git a/src/conductor/client/adapters/models/unknown_field_set_adapter.py b/src/conductor/client/adapters/models/unknown_field_set_adapter.py new file mode 100644 index 00000000..4c385002 --- /dev/null +++ b/src/conductor/client/adapters/models/unknown_field_set_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.unknown_field_set import UnknownFieldSet + + +class UnknownFieldSetAdapter(UnknownFieldSet): + pass diff --git a/src/conductor/client/adapters/models/update_workflow_variables_adapter.py b/src/conductor/client/adapters/models/update_workflow_variables_adapter.py new file mode 100644 index 00000000..9371c60c --- /dev/null +++ b/src/conductor/client/adapters/models/update_workflow_variables_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.update_workflow_variables import \ + UpdateWorkflowVariables + + +class UpdateWorkflowVariablesAdapter(UpdateWorkflowVariables): + pass diff --git a/src/conductor/client/adapters/models/update_workflow_variables_adapters.py b/src/conductor/client/adapters/models/update_workflow_variables_adapters.py new file mode 100644 index 00000000..9371c60c --- /dev/null +++ b/src/conductor/client/adapters/models/update_workflow_variables_adapters.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.update_workflow_variables import \ + UpdateWorkflowVariables + + +class UpdateWorkflowVariablesAdapter(UpdateWorkflowVariables): + pass diff --git a/src/conductor/client/adapters/models/upgrade_workflow_request_adapter.py b/src/conductor/client/adapters/models/upgrade_workflow_request_adapter.py new file mode 100644 index 00000000..871ac814 --- /dev/null +++ b/src/conductor/client/adapters/models/upgrade_workflow_request_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.upgrade_workflow_request import \ + UpgradeWorkflowRequest + + +class UpgradeWorkflowRequestAdapter(UpgradeWorkflowRequest): + pass diff --git a/src/conductor/client/adapters/models/upsert_group_request_adapter.py b/src/conductor/client/adapters/models/upsert_group_request_adapter.py new file mode 100644 index 00000000..08fa17a5 --- /dev/null +++ b/src/conductor/client/adapters/models/upsert_group_request_adapter.py @@ -0,0 +1,40 @@ +from conductor.client.codegen.models.upsert_group_request import \ + UpsertGroupRequest + + +class UpsertGroupRequestAdapter(UpsertGroupRequest): + @UpsertGroupRequest.roles.setter + def roles(self, roles): + """Sets the roles of this UpsertGroupRequest. + + + :param roles: The roles of this UpsertGroupRequest. # noqa: E501 + :type: list[str] + """ + allowed_values = [ + "ADMIN", + "USER", + "WORKER", + "METADATA_MANAGER", + "WORKFLOW_MANAGER", + ] + if not set(roles).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `roles` [{0}], must be a subset of [{1}]".format( + ", ".join(map(str, set(roles) - set(allowed_values))), + ", ".join(map(str, allowed_values)), + ) + ) + + self._roles = roles + + @UpsertGroupRequest.default_access.setter + def default_access(self, default_access): + """Sets the default_access of this UpsertGroupRequest. + + A default Map> to share permissions, allowed target types: WORKFLOW_DEF, TASK_DEF # noqa: E501 + + :param default_access: The default_access of this UpsertGroupRequest. # noqa: E501 + :type: dict(str, list[str]) + """ + self._default_access = default_access diff --git a/src/conductor/client/adapters/models/upsert_user_request_adapter.py b/src/conductor/client/adapters/models/upsert_user_request_adapter.py new file mode 100644 index 00000000..5456e088 --- /dev/null +++ b/src/conductor/client/adapters/models/upsert_user_request_adapter.py @@ -0,0 +1,39 @@ +from enum import Enum + +from conductor.client.codegen.models.upsert_user_request import \ + UpsertUserRequest + + +class RolesEnum(str, Enum): + ADMIN = "ADMIN" + USER = "USER" + WORKER = "WORKER" + METADATA_MANAGER = "METADATA_MANAGER" + WORKFLOW_MANAGER = "WORKFLOW_MANAGER" + + +class UpsertUserRequestAdapter(UpsertUserRequest): + @UpsertUserRequest.roles.setter + def roles(self, roles): + """Sets the roles of this UpsertUserRequest. + + + :param roles: The roles of this UpsertUserRequest. # noqa: E501 + :type: list[str] + """ + allowed_values = [ + "ADMIN", + "USER", + "WORKER", + "METADATA_MANAGER", + "WORKFLOW_MANAGER", + ] + if not set(roles).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `roles` [{0}], must be a subset of [{1}]".format( + ", ".join(map(str, set(roles) - set(allowed_values))), + ", ".join(map(str, allowed_values)), + ) + ) + + self._roles = roles diff --git a/src/conductor/client/adapters/models/webhook_config_adapter.py b/src/conductor/client/adapters/models/webhook_config_adapter.py new file mode 100644 index 00000000..8ab6ee20 --- /dev/null +++ b/src/conductor/client/adapters/models/webhook_config_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.webhook_config import WebhookConfig + + +class WebhookConfigAdapter(WebhookConfig): + pass diff --git a/src/conductor/client/adapters/models/webhook_execution_history_adapter.py b/src/conductor/client/adapters/models/webhook_execution_history_adapter.py new file mode 100644 index 00000000..18dc2168 --- /dev/null +++ b/src/conductor/client/adapters/models/webhook_execution_history_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.webhook_execution_history import \ + WebhookExecutionHistory + + +class WebhookExecutionHistoryAdapter(WebhookExecutionHistory): + pass diff --git a/src/conductor/client/adapters/models/workflow_adapter.py b/src/conductor/client/adapters/models/workflow_adapter.py new file mode 100644 index 00000000..9c5feed9 --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_adapter.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from typing import Optional + +from conductor.client.adapters.models.task_adapter import TaskAdapter +from conductor.client.adapters.models.workflow_run_adapter import ( + running_status, successful_status, terminal_status) +from conductor.client.codegen.models.workflow import Workflow + + +class WorkflowAdapter(Workflow): + def is_completed(self) -> bool: + """Checks if the workflow has completed + :return: True if the workflow status is COMPLETED, FAILED or TERMINATED + """ + return self.status in terminal_status + + def is_successful(self) -> bool: + """Checks if the workflow has completed in successful state (ie COMPLETED) + :return: True if the workflow status is COMPLETED + """ + return self._status in successful_status + + def is_running(self) -> bool: + return self.status in running_status + + @property + def current_task(self) -> TaskAdapter: + current = None + for task in self.tasks: + if task.status in ("SCHEDULED", "IN_PROGRESS"): + current = task + return current + + def get_task( + self, name: Optional[str] = None, task_reference_name: Optional[str] = None + ) -> TaskAdapter: + if name is None and task_reference_name is None: + raise Exception( + "ONLY one of name or task_reference_name MUST be provided. None were provided" + ) + if name is not None and task_reference_name is not None: + raise Exception( + "ONLY one of name or task_reference_name MUST be provided. both were provided" + ) + + current = None + for task in self.tasks: + if ( + task.task_def_name == name + or task.workflow_task.task_reference_name == task_reference_name + ): + current = task + return current diff --git a/src/conductor/client/adapters/models/workflow_def_adapter.py b/src/conductor/client/adapters/models/workflow_def_adapter.py new file mode 100644 index 00000000..629f4fe6 --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_def_adapter.py @@ -0,0 +1,167 @@ +from __future__ import annotations + +import json +from typing import Optional + +from deprecated import deprecated + +from conductor.client.codegen.models.workflow_def import WorkflowDef +from conductor.client.helpers.helper import ObjectMapper + +object_mapper = ObjectMapper() + + +class WorkflowDefAdapter(WorkflowDef): + def toJSON(self): + return object_mapper.to_json(obj=self) + + @property + @deprecated("This field is deprecated and will be removed in a future version") + def owner_app(self): + """Gets the owner_app of this WorkflowDef. # noqa: E501 + + + :return: The owner_app of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._owner_app + + @owner_app.setter + @deprecated("This field is deprecated and will be removed in a future version") + def owner_app(self, owner_app): + """Sets the owner_app of this WorkflowDef. + + + :param owner_app: The owner_app of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._owner_app = owner_app + + @property + @deprecated("This field is deprecated and will be removed in a future version") + def create_time(self): + """Gets the create_time of this WorkflowDef. # noqa: E501 + + + :return: The create_time of this WorkflowDef. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + @deprecated("This field is deprecated and will be removed in a future version") + def create_time(self, create_time): + """Sets the create_time of this WorkflowDef. + + + :param create_time: The create_time of this WorkflowDef. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + @deprecated("This field is deprecated and will be removed in a future version") + def update_time(self): + """Gets the update_time of this WorkflowDef. # noqa: E501 + + + :return: The update_time of this WorkflowDef. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + @deprecated("This field is deprecated and will be removed in a future version") + def update_time(self, update_time): + """Sets the update_time of this WorkflowDef. + + + :param update_time: The update_time of this WorkflowDef. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + @deprecated("This field is deprecated and will be removed in a future version") + def created_by(self): + """Gets the created_by of this WorkflowDef. # noqa: E501 + + + :return: The created_by of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + @deprecated("This field is deprecated and will be removed in a future version") + def created_by(self, created_by): + """Sets the created_by of this WorkflowDef. + + + :param created_by: The created_by of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + @deprecated("This field is deprecated and will be removed in a future version") + def updated_by(self): + """Gets the updated_by of this WorkflowDef. # noqa: E501 + + + :return: The updated_by of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + @deprecated("This field is deprecated and will be removed in a future version") + def updated_by(self, updated_by): + """Sets the updated_by of this WorkflowDef. + + + :param updated_by: The updated_by of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + @property + def tasks(self): + if self._tasks is None: + self._tasks = [] + return self._tasks + + @tasks.setter + def tasks(self, tasks): + """Sets the tasks of this WorkflowDef. + + + :param tasks: The tasks of this WorkflowDef. # noqa: E501 + :type: list[WorkflowTask] + """ + self._tasks = tasks + + @WorkflowDef.timeout_seconds.setter + def timeout_seconds(self, timeout_seconds): + """Sets the timeout_seconds of this WorkflowDef. + + + :param timeout_seconds: The timeout_seconds of this WorkflowDef. # noqa: E501 + :type: int + """ + self._timeout_seconds = timeout_seconds + + +def to_workflow_def( + data: Optional[str] = None, json_data: Optional[dict] = None +) -> WorkflowDefAdapter: + if json_data is not None: + return object_mapper.from_json(json_data, WorkflowDefAdapter) + if data is not None: + return object_mapper.from_json(json.loads(data), WorkflowDefAdapter) + raise Exception("missing data or json_data parameter") diff --git a/src/conductor/client/adapters/models/workflow_run_adapter.py b/src/conductor/client/adapters/models/workflow_run_adapter.py new file mode 100644 index 00000000..25465c8f --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_run_adapter.py @@ -0,0 +1,120 @@ +from __future__ import annotations + +from typing import Optional + +from deprecated import deprecated + +from conductor.client.adapters.models.task_adapter import TaskAdapter +from conductor.client.codegen.models.workflow_run import WorkflowRun + +terminal_status = ("COMPLETED", "FAILED", "TIMED_OUT", "TERMINATED") # shared +successful_status = ("PAUSED", "COMPLETED") +running_status = ("RUNNING", "PAUSED") + + +class WorkflowRunAdapter(WorkflowRun): + def __init__( + self, + correlation_id=None, + create_time=None, + created_by=None, + input=None, + output=None, + priority=None, + request_id=None, + status=None, + tasks=None, + update_time=None, + variables=None, + workflow_id=None, + reason_for_incompletion=None, + ): + """WorkflowRun - a model defined in Swagger""" + self._correlation_id = None + self._create_time = None + self._created_by = None + self._input = None + self._output = None + self._priority = None + self._request_id = None + self._status = None + self._tasks = None + self._update_time = None + self._variables = None + self._workflow_id = None + self.discriminator = None + self._reason_for_incompletion = reason_for_incompletion # deprecated + + if correlation_id is not None: + self.correlation_id = correlation_id + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if input is not None: + self.input = input + if output is not None: + self.output = output + if priority is not None: + self.priority = priority + if request_id is not None: + self.request_id = request_id + if status is not None: + self.status = status + if tasks is not None: + self.tasks = tasks + if update_time is not None: + self.update_time = update_time + if variables is not None: + self.variables = variables + if workflow_id is not None: + self.workflow_id = workflow_id + + @property + def current_task(self) -> TaskAdapter: + current = None + for task in self.tasks: + if task.status in ("SCHEDULED", "IN_PROGRESS"): + current = task + return current + + def get_task( + self, name: Optional[str] = None, task_reference_name: Optional[str] = None + ) -> TaskAdapter: + if name is None and task_reference_name is None: + raise Exception( + "ONLY one of name or task_reference_name MUST be provided. None were provided" + ) + if name is not None and task_reference_name is not None: + raise Exception( + "ONLY one of name or task_reference_name MUST be provided. both were provided" + ) + + current = None + for task in self.tasks: + if ( + task.task_def_name == name + or task.workflow_task.task_reference_name == task_reference_name + ): + current = task + return current + + def is_completed(self) -> bool: + """Checks if the workflow has completed + :return: True if the workflow status is COMPLETED, FAILED or TERMINATED + """ + return self._status in terminal_status + + def is_successful(self) -> bool: + """Checks if the workflow has completed in successful state (ie COMPLETED) + :return: True if the workflow status is COMPLETED + """ + return self._status in successful_status + + def is_running(self) -> bool: + return self.status in running_status + + @property + @deprecated + def reason_for_incompletion(self): + return self._reason_for_incompletion diff --git a/src/conductor/client/adapters/models/workflow_schedule_adapter.py b/src/conductor/client/adapters/models/workflow_schedule_adapter.py new file mode 100644 index 00000000..879f03e9 --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_schedule_adapter.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from typing import Optional + +from conductor.client.codegen.models.workflow_schedule import WorkflowSchedule + + +class WorkflowScheduleAdapter(WorkflowSchedule): + def __init__( + self, + name: Optional[str] = None, + cron_expression: Optional[str] = None, + run_catchup_schedule_instances: Optional[bool] = None, + paused: Optional[bool] = None, + start_workflow_request = None, + schedule_start_time: Optional[int] = None, + schedule_end_time: Optional[int] = None, + create_time: Optional[int] = None, + updated_time: Optional[int] = None, + created_by: Optional[str] = None, + updated_by: Optional[str] = None, + paused_reason: Optional[str] = None, + description: Optional[str] = None, + tags = None, + zone_id = None, + ): # noqa: E501 + self._create_time = None + self._created_by = None + self._cron_expression = None + self._description = None + self._name = None + self._paused = None + self._paused_reason = None + self._run_catchup_schedule_instances = None + self._schedule_end_time = None + self._schedule_start_time = None + self._start_workflow_request = None + self._tags = None + self._updated_by = None + self._updated_time = None + self._zone_id = None + self.discriminator = None + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if cron_expression is not None: + self.cron_expression = cron_expression + if description is not None: + self.description = description + if name is not None: + self.name = name + if paused is not None: + self.paused = paused + if paused_reason is not None: + self.paused_reason = paused_reason + if run_catchup_schedule_instances is not None: + self.run_catchup_schedule_instances = run_catchup_schedule_instances + if schedule_end_time is not None: + self.schedule_end_time = schedule_end_time + if schedule_start_time is not None: + self.schedule_start_time = schedule_start_time + if start_workflow_request is not None: + self.start_workflow_request = start_workflow_request + if tags is not None: + self.tags = tags + if updated_by is not None: + self.updated_by = updated_by + if updated_time is not None: + self.updated_time = updated_time + if zone_id is not None: + self.zone_id = zone_id diff --git a/src/conductor/client/adapters/models/workflow_schedule_execution_model_adapter.py b/src/conductor/client/adapters/models/workflow_schedule_execution_model_adapter.py new file mode 100644 index 00000000..6306fa65 --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_schedule_execution_model_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.workflow_schedule_execution_model import \ + WorkflowScheduleExecutionModel + + +class WorkflowScheduleExecutionModelAdapter(WorkflowScheduleExecutionModel): + pass diff --git a/src/conductor/client/adapters/models/workflow_schedule_model_adapter.py b/src/conductor/client/adapters/models/workflow_schedule_model_adapter.py new file mode 100644 index 00000000..7c831ee9 --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_schedule_model_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.workflow_schedule_model import \ + WorkflowScheduleModel + + +class WorkflowScheduleModelAdapter(WorkflowScheduleModel): + pass diff --git a/src/conductor/client/adapters/models/workflow_state_update_adapter.py b/src/conductor/client/adapters/models/workflow_state_update_adapter.py new file mode 100644 index 00000000..67389e5e --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_state_update_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.workflow_state_update import \ + WorkflowStateUpdate + + +class WorkflowStateUpdateAdapter(WorkflowStateUpdate): + pass diff --git a/src/conductor/client/adapters/models/workflow_status_adapter.py b/src/conductor/client/adapters/models/workflow_status_adapter.py new file mode 100644 index 00000000..7ecafda4 --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_status_adapter.py @@ -0,0 +1,20 @@ +from conductor.client.adapters.models.workflow_run_adapter import ( # shared + running_status, successful_status, terminal_status) +from conductor.client.codegen.models.workflow_status import WorkflowStatus + + +class WorkflowStatusAdapter(WorkflowStatus): + def is_completed(self) -> bool: + """Checks if the workflow has completed + :return: True if the workflow status is COMPLETED, FAILED or TERMINATED + """ + return self._status in terminal_status + + def is_successful(self) -> bool: + """Checks if the workflow has completed in successful state (ie COMPLETED) + :return: True if the workflow status is COMPLETED + """ + return self._status in successful_status + + def is_running(self) -> bool: + return self.status in running_status diff --git a/src/conductor/client/adapters/models/workflow_summary_adapter.py b/src/conductor/client/adapters/models/workflow_summary_adapter.py new file mode 100644 index 00000000..21a782c8 --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_summary_adapter.py @@ -0,0 +1,51 @@ +from deprecated import deprecated + +from conductor.client.codegen.models.workflow_summary import WorkflowSummary + + +class WorkflowSummaryAdapter(WorkflowSummary): + @property + @deprecated(reason="This field is not present in the Java POJO") + def output_size(self): + """Gets the output_size of this WorkflowSummary. # noqa: E501 + + + :return: The output_size of this WorkflowSummary. # noqa: E501 + :rtype: int + """ + return self._output_size + + @output_size.setter + @deprecated(reason="This field is not present in the Java POJO") + def output_size(self, output_size): + """Sets the output_size of this WorkflowSummary. + + + :param output_size: The output_size of this WorkflowSummary. # noqa: E501 + :type: int + """ + + self._output_size = output_size + + @property + @deprecated(reason="This field is not present in the Java POJO") + def input_size(self): + """Gets the input_size of this WorkflowSummary. # noqa: E501 + + + :return: The input_size of this WorkflowSummary. # noqa: E501 + :rtype: int + """ + return self._input_size + + @input_size.setter + @deprecated(reason="This field is not present in the Java POJO") + def input_size(self, input_size): + """Sets the input_size of this WorkflowSummary. + + + :param input_size: The input_size of this WorkflowSummary. # noqa: E501 + :type: int + """ + + self._input_size = input_size diff --git a/src/conductor/client/adapters/models/workflow_tag_adapter.py b/src/conductor/client/adapters/models/workflow_tag_adapter.py new file mode 100644 index 00000000..af507e37 --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_tag_adapter.py @@ -0,0 +1,5 @@ +from conductor.client.codegen.models.workflow_tag import WorkflowTag + + +class WorkflowTagAdapter(WorkflowTag): + pass diff --git a/src/conductor/client/adapters/models/workflow_task_adapter.py b/src/conductor/client/adapters/models/workflow_task_adapter.py new file mode 100644 index 00000000..3f7d4543 --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_task_adapter.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from typing import ClassVar, Dict, Optional + +from conductor.client.codegen.models.workflow_task import WorkflowTask + + +class WorkflowTaskAdapter(WorkflowTask): + @WorkflowTask.workflow_task_type.setter + def workflow_task_type(self, workflow_task_type): + """Sets the workflow_task_type of this WorkflowTask. + + + :param workflow_task_type: The workflow_task_type of this WorkflowTask. # noqa: E501 + :type: str + """ + self._workflow_task_type = workflow_task_type + + @WorkflowTask.on_state_change.setter + def on_state_change(self, state_change): + """Sets the on_state_change of this WorkflowTask. + + + :param state_change: The on_state_change of this WorkflowTask. # noqa: E501 + :type: StateChangeConfig or dict + """ + if isinstance(state_change, dict): + # If it's already a dictionary, use it as-is + self._on_state_change = state_change + else: + # If it's a StateChangeConfig object, convert it to the expected format + self._on_state_change = {state_change.type: state_change.events} + + +class CacheConfig: + swagger_types: ClassVar[Dict[str, str]] = {"key": "str", "ttl_in_second": "int"} + + attribute_map: ClassVar[Dict[str, str]] = { + "key": "key", + "ttl_in_second": "ttlInSecond", + } + + def __init__(self, key: Optional[str] = None, ttl_in_second: Optional[int] = None): + self._key = key + self._ttl_in_second = ttl_in_second + + @property + def key(self): + return self._key + + @key.setter + def key(self, key): + self._key = key + + @property + def ttl_in_second(self): + return self._ttl_in_second + + @ttl_in_second.setter + def ttl_in_second(self, ttl_in_second): + self._ttl_in_second = ttl_in_second diff --git a/src/conductor/client/adapters/models/workflow_test_request_adapter.py b/src/conductor/client/adapters/models/workflow_test_request_adapter.py new file mode 100644 index 00000000..353fe7a3 --- /dev/null +++ b/src/conductor/client/adapters/models/workflow_test_request_adapter.py @@ -0,0 +1,6 @@ +from conductor.client.codegen.models.workflow_test_request import \ + WorkflowTestRequest + + +class WorkflowTestRequestAdapter(WorkflowTestRequest): + pass diff --git a/src/conductor/client/adapters/rest_adapter.py b/src/conductor/client/adapters/rest_adapter.py new file mode 100644 index 00000000..46eafa88 --- /dev/null +++ b/src/conductor/client/adapters/rest_adapter.py @@ -0,0 +1,350 @@ +import io +import logging +from typing import Optional, Dict, Any, Union, Tuple + +import httpx +from httpx import Response, RequestError, HTTPStatusError, TimeoutException + +from conductor.client.codegen.rest import ( + ApiException, + AuthorizationException, + RESTClientObject, +) +from conductor.client.configuration.configuration import Configuration + +logger = logging.getLogger(Configuration.get_logging_formatted_name(__name__)) + + +class RESTResponse(io.IOBase): + """HTTP response wrapper for httpx responses.""" + + def __init__(self, response: Response): + self.status = response.status_code + self.reason = response.reason_phrase + self.resp = response + self.headers = response.headers + + # Log HTTP protocol version + http_version = getattr(response, 'http_version', 'Unknown') + logger.debug(f"HTTP response received - Status: {self.status}, Protocol: {http_version}") + + # Log HTTP/2 usage + if http_version == "HTTP/2": + logger.info(f"HTTP/2 connection established - URL: {response.url}") + elif http_version == "HTTP/1.1": + logger.debug(f"HTTP/1.1 connection used - URL: {response.url}") + else: + logger.debug(f"HTTP protocol version: {http_version} - URL: {response.url}") + + def getheaders(self): + """Get response headers.""" + return self.headers + + def getheader(self, name: str, default: Optional[str] = None) -> Optional[str]: + """Get a specific response header.""" + return self.headers.get(name, default) + + @property + def data(self) -> bytes: + """Get response data as bytes.""" + return self.resp.content + + @property + def text(self) -> str: + """Get response data as text.""" + return self.resp.text + + @property + def http_version(self) -> str: + """Get the HTTP protocol version used.""" + return getattr(self.resp, 'http_version', 'Unknown') + + def is_http2(self) -> bool: + """Check if HTTP/2 was used for this response.""" + return self.http_version == "HTTP/2" + + +class RESTClientObjectAdapter(RESTClientObject): + """HTTP client adapter using httpx instead of requests.""" + + def __init__(self, connection: Optional[httpx.Client] = None): + """Initialize the REST client with httpx.""" + # Don't call super().__init__() to avoid requests initialization + self.connection = connection or httpx.Client( + timeout=httpx.Timeout(120.0), + follow_redirects=True, + limits=httpx.Limits(max_keepalive_connections=20, max_connections=100), + ) + + def close(self): + """Close the HTTP client connection.""" + if hasattr(self, "connection") and self.connection: + self.connection.close() + + def check_http2_support(self, url: str) -> bool: + """Check if the server supports HTTP/2 by making a test request.""" + try: + logger.info(f"Checking HTTP/2 support for: {url}") + response = self.GET(url) + is_http2 = response.is_http2() + + if is_http2: + logger.info(f"✓ HTTP/2 supported by {url}") + else: + logger.info(f"✗ HTTP/2 not supported by {url}, using {response.http_version}") + + return is_http2 + except Exception as e: + logger.error(f"Failed to check HTTP/2 support for {url}: {e}") + return False + + def request( + self, + method: str, + url: str, + query_params: Optional[Dict[str, Any]] = None, + headers: Optional[Dict[str, str]] = None, + body: Optional[Union[str, bytes, Dict[str, Any]]] = None, + post_params: Optional[Dict[str, Any]] = None, + _preload_content: bool = True, + _request_timeout: Optional[Union[float, Tuple[float, float]]] = None, + ) -> RESTResponse: + """Perform HTTP request using httpx. + + :param method: HTTP request method + :param url: HTTP request URL + :param query_params: Query parameters in the URL + :param headers: HTTP request headers + :param body: Request JSON body for `application/json` + :param post_params: Request post parameters for + `application/x-www-form-urlencoded` and `multipart/form-data` + :param _preload_content: If False, return raw response without reading content + :param _request_timeout: Timeout setting for this request + """ + method = method.upper() + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + # Set default timeout + if _request_timeout is not None: + if isinstance(_request_timeout, (int, float)): + timeout = httpx.Timeout(_request_timeout) + else: + # Tuple format: (connect_timeout, read_timeout) + timeout = httpx.Timeout(_request_timeout) + else: + timeout = httpx.Timeout(120.0) + + # Set default content type + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + + try: + # Log the request attempt + logger.debug(f"Making HTTP request - Method: {method}, URL: {url}") + + # Prepare request parameters + request_kwargs = { + "method": method, + "url": url, + "headers": headers, + "timeout": timeout, + } + + # Handle query parameters + if query_params: + request_kwargs["params"] = query_params + + # Handle request body + if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: + if body is not None: + if isinstance(body, (dict, list)): + # JSON body + request_kwargs["json"] = body + elif isinstance(body, str): + # String body + request_kwargs["content"] = body.encode("utf-8") + elif isinstance(body, bytes): + # Bytes body + request_kwargs["content"] = body + else: + # Try to serialize as JSON + request_kwargs["json"] = body + elif post_params: + # Form data + request_kwargs["data"] = post_params + + # Make the request + response = self.connection.request(**request_kwargs) + + # Create RESTResponse wrapper + rest_response = RESTResponse(response) + + # Handle authentication errors + if rest_response.status in [401, 403]: + raise AuthorizationException(http_resp=rest_response) + + # Handle other HTTP errors + if not 200 <= rest_response.status <= 299: + raise ApiException(http_resp=rest_response) + + return rest_response + + except HTTPStatusError as e: + rest_response = RESTResponse(e.response) + if rest_response.status in [401, 403]: + raise AuthorizationException(http_resp=rest_response) from e + raise ApiException(http_resp=rest_response) from e + except (RequestError, TimeoutException) as e: + raise ApiException(status=0, reason=str(e)) from e + + def GET( + self, + url: str, + headers: Optional[Dict[str, str]] = None, + query_params: Optional[Dict[str, Any]] = None, + _preload_content: bool = True, + _request_timeout: Optional[Union[float, Tuple[float, float]]] = None, + ) -> RESTResponse: + """Perform GET request.""" + return self.request( + "GET", + url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) + + def HEAD( + self, + url: str, + headers: Optional[Dict[str, str]] = None, + query_params: Optional[Dict[str, Any]] = None, + _preload_content: bool = True, + _request_timeout: Optional[Union[float, Tuple[float, float]]] = None, + ) -> RESTResponse: + """Perform HEAD request.""" + return self.request( + "HEAD", + url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) + + def OPTIONS( + self, + url: str, + headers: Optional[Dict[str, str]] = None, + query_params: Optional[Dict[str, Any]] = None, + post_params: Optional[Dict[str, Any]] = None, + body: Optional[Union[str, bytes, Dict[str, Any]]] = None, + _preload_content: bool = True, + _request_timeout: Optional[Union[float, Tuple[float, float]]] = None, + ) -> RESTResponse: + """Perform OPTIONS request.""" + return self.request( + "OPTIONS", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) + + def DELETE( + self, + url: str, + headers: Optional[Dict[str, str]] = None, + query_params: Optional[Dict[str, Any]] = None, + body: Optional[Union[str, bytes, Dict[str, Any]]] = None, + _preload_content: bool = True, + _request_timeout: Optional[Union[float, Tuple[float, float]]] = None, + ) -> RESTResponse: + """Perform DELETE request.""" + return self.request( + "DELETE", + url, + headers=headers, + query_params=query_params, + body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) + + def POST( + self, + url: str, + headers: Optional[Dict[str, str]] = None, + query_params: Optional[Dict[str, Any]] = None, + post_params: Optional[Dict[str, Any]] = None, + body: Optional[Union[str, bytes, Dict[str, Any]]] = None, + _preload_content: bool = True, + _request_timeout: Optional[Union[float, Tuple[float, float]]] = None, + ) -> RESTResponse: + """Perform POST request.""" + return self.request( + "POST", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) + + def PUT( + self, + url: str, + headers: Optional[Dict[str, str]] = None, + query_params: Optional[Dict[str, Any]] = None, + post_params: Optional[Dict[str, Any]] = None, + body: Optional[Union[str, bytes, Dict[str, Any]]] = None, + _preload_content: bool = True, + _request_timeout: Optional[Union[float, Tuple[float, float]]] = None, + ) -> RESTResponse: + """Perform PUT request.""" + return self.request( + "PUT", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) + + def PATCH( + self, + url: str, + headers: Optional[Dict[str, str]] = None, + query_params: Optional[Dict[str, Any]] = None, + post_params: Optional[Dict[str, Any]] = None, + body: Optional[Union[str, bytes, Dict[str, Any]]] = None, + _preload_content: bool = True, + _request_timeout: Optional[Union[float, Tuple[float, float]]] = None, + ) -> RESTResponse: + """Perform PATCH request.""" + return self.request( + "PATCH", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) diff --git a/src/conductor/client/ai/orchestrator.py b/src/conductor/client/ai/orchestrator.py index 7b09ac7a..a5ea8019 100644 --- a/src/conductor/client/ai/orchestrator.py +++ b/src/conductor/client/ai/orchestrator.py @@ -5,13 +5,12 @@ from typing_extensions import Self -from conductor.client.http.models.integration_api_update import IntegrationApiUpdate -from conductor.client.http.models.integration_update import IntegrationUpdate -from conductor.client.http.rest import ApiException +from conductor.client.http.models import IntegrationApiUpdate, IntegrationUpdate +from conductor.client.codegen.rest import ApiException from conductor.client.orkes_clients import OrkesClients if TYPE_CHECKING: - from conductor.client.http.models.prompt_template import PromptTemplate + from conductor.client.http.models import PromptTemplate from conductor.client.configuration.configuration import Configuration from conductor.shared.ai.configuration.interfaces.integration_config import IntegrationConfig from conductor.shared.ai.enums import VectorDB diff --git a/src/conductor/client/automator/task_handler.py b/src/conductor/client/automator/task_handler.py index f496933a..70521156 100644 --- a/src/conductor/client/automator/task_handler.py +++ b/src/conductor/client/automator/task_handler.py @@ -1,23 +1,20 @@ from __future__ import annotations + import importlib import logging import os -from multiprocessing import Process, freeze_support, Queue, set_start_method +from multiprocessing import Process, Queue, freeze_support, set_start_method from sys import platform from typing import List, Optional from conductor.client.automator.task_runner import TaskRunner from conductor.client.configuration.configuration import Configuration -from conductor.shared.configuration.settings.metrics_settings import MetricsSettings from conductor.client.telemetry.metrics_collector import MetricsCollector from conductor.client.worker.worker import Worker from conductor.client.worker.worker_interface import WorkerInterface +from conductor.shared.configuration.settings.metrics_settings import MetricsSettings -logger = logging.getLogger( - Configuration.get_logging_formatted_name( - __name__ - ) -) +logger = logging.getLogger(Configuration.get_logging_formatted_name(__name__)) _decorated_functions = {} _mp_fork_set = False @@ -29,28 +26,34 @@ set_start_method("fork") _mp_fork_set = True except Exception as e: - logger.info("error when setting multiprocessing.set_start_method - maybe the context is set %s", e.args) + logger.error( + "Error when setting multiprocessing.set_start_method - maybe the context is set %s", + e.args, + ) if platform == "darwin": os.environ["no_proxy"] = "*" -def register_decorated_fn(name: str, poll_interval: int, domain: str, worker_id: str, func): - logger.info("decorated %s", name) + +def register_decorated_fn( + name: str, poll_interval: int, domain: str, worker_id: str, func +): + logger.info("Registering decorated function %s", name) _decorated_functions[(name, domain)] = { "func": func, "poll_interval": poll_interval, "domain": domain, - "worker_id": worker_id + "worker_id": worker_id, } class TaskHandler: def __init__( - self, - workers: Optional[List[WorkerInterface]] = None, - configuration: Optional[Configuration] = None, - metrics_settings: Optional[MetricsSettings] = None, - scan_for_annotated_workers: bool = True, - import_modules: Optional[List[str]] = None + self, + workers: Optional[List[WorkerInterface]] = None, + configuration: Optional[Configuration] = None, + metrics_settings: Optional[MetricsSettings] = None, + scan_for_annotated_workers: bool = True, + import_modules: Optional[List[str]] = None, ): workers = workers or [] self.logger_process, self.queue = _setup_logging_queue(configuration) @@ -60,7 +63,7 @@ def __init__( importlib.import_module("conductor.client.worker.worker_task") if import_modules is not None: for module in import_modules: - logger.info("loading module %s", module) + logger.debug("Loading module %s", module) importlib.import_module(module) elif not isinstance(workers, list): @@ -76,8 +79,11 @@ def __init__( execute_function=fn, worker_id=worker_id, domain=domain, - poll_interval=poll_interval) - logger.info("created worker with name=%s and domain=%s", task_def_name, domain) + poll_interval=poll_interval, + ) + logger.info( + "Created worker with name=%s and domain=%s", task_def_name, domain + ) workers.append(worker) self.__create_task_runner_processes(workers, configuration, metrics_settings) @@ -93,53 +99,54 @@ def __exit__(self, exc_type, exc_value, traceback): def stop_processes(self) -> None: self.__stop_task_runner_processes() self.__stop_metrics_provider_process() - logger.info("Stopped worker processes...") + logger.info("Stopped worker processes") self.queue.put(None) self.logger_process.terminate() def start_processes(self) -> None: - logger.info("Starting worker processes...") + logger.info("Starting worker processes") freeze_support() self.__start_task_runner_processes() self.__start_metrics_provider_process() - logger.info("Started all processes") + logger.info("Started task_runner and metrics_provider processes") def join_processes(self) -> None: try: self.__join_task_runner_processes() self.__join_metrics_provider_process() - logger.info("Joined all processes") + logger.info("Joined task_runner and metrics_provider processes") except KeyboardInterrupt: logger.info("KeyboardInterrupt: Stopping all processes") self.stop_processes() - def __create_metrics_provider_process(self, metrics_settings: MetricsSettings) -> None: + def __create_metrics_provider_process( + self, metrics_settings: MetricsSettings + ) -> None: if metrics_settings is None: self.metrics_provider_process = None return self.metrics_provider_process = Process( - target=MetricsCollector.provide_metrics, - args=(metrics_settings,) + target=MetricsCollector.provide_metrics, args=(metrics_settings,) + ) + logger.info( + "Created MetricsProvider process pid: %s", self.metrics_provider_process.pid ) - logger.info("Created MetricsProvider process") def __create_task_runner_processes( - self, - workers: List[WorkerInterface], - configuration: Configuration, - metrics_settings: MetricsSettings + self, + workers: List[WorkerInterface], + configuration: Configuration, + metrics_settings: MetricsSettings, ) -> None: self.task_runner_processes = [] for worker in workers: - self.__create_task_runner_process( - worker, configuration, metrics_settings - ) + self.__create_task_runner_process(worker, configuration, metrics_settings) def __create_task_runner_process( - self, - worker: WorkerInterface, - configuration: Configuration, - metrics_settings: MetricsSettings + self, + worker: WorkerInterface, + configuration: Configuration, + metrics_settings: MetricsSettings, ) -> None: task_runner = TaskRunner(worker, configuration, metrics_settings) process = Process(target=task_runner.run) @@ -149,32 +156,43 @@ def __start_metrics_provider_process(self): if self.metrics_provider_process is None: return self.metrics_provider_process.start() - logger.info("Started MetricsProvider process") + logger.info( + "Started MetricsProvider process with pid: %s", + self.metrics_provider_process.pid, + ) def __start_task_runner_processes(self): - n = 0 for task_runner_process in self.task_runner_processes: task_runner_process.start() - n = n + 1 - logger.info("Started %s TaskRunner process", n) + logger.debug( + "Started TaskRunner process with pid: %s", task_runner_process.pid + ) + logger.info("Started %s TaskRunner processes", len(self.task_runner_processes)) def __join_metrics_provider_process(self): if self.metrics_provider_process is None: return self.metrics_provider_process.join() - logger.info("Joined MetricsProvider processes") + logger.info( + "Joined MetricsProvider process with pid: %s", + self.metrics_provider_process.pid, + ) def __join_task_runner_processes(self): for task_runner_process in self.task_runner_processes: task_runner_process.join() - logger.info("Joined TaskRunner processes") + logger.info("Joined %s TaskRunner processes", len(self.task_runner_processes)) def __stop_metrics_provider_process(self): self.__stop_process(self.metrics_provider_process) + logger.info( + "Stopped MetricsProvider process", + ) def __stop_task_runner_processes(self): for task_runner_process in self.task_runner_processes: self.__stop_process(task_runner_process) + logger.info("Stopped %s TaskRunner processes", len(self.task_runner_processes)) def __stop_process(self, process: Process): if process is None: @@ -183,7 +201,7 @@ def __stop_process(self, process: Process): logger.debug("Terminating process: %s", process.pid) process.terminate() except Exception as e: - logger.debug("Failed to terminate process: %s, reason: %s", process.pid, e) + logger.debug("Failed to terminate process: %s; reason: %s", process.pid, e) process.kill() logger.debug("Killed process: %s", process.pid) @@ -209,11 +227,7 @@ def _setup_logging_queue(configuration: Configuration): # This process performs the centralized logging def __logger_process(queue, log_level, logger_format=None): - c_logger = logging.getLogger( - Configuration.get_logging_formatted_name( - __name__ - ) - ) + c_logger = logging.getLogger(Configuration.get_logging_formatted_name(__name__)) c_logger.setLevel(log_level) diff --git a/src/conductor/client/automator/task_runner.py b/src/conductor/client/automator/task_runner.py index 4b4d4fdf..248573f3 100644 --- a/src/conductor/client/automator/task_runner.py +++ b/src/conductor/client/automator/task_runner.py @@ -4,30 +4,26 @@ import time import traceback +from conductor.client.codegen.rest import AuthorizationException, ApiException from conductor.client.configuration.configuration import Configuration -from conductor.shared.configuration.settings.metrics_settings import MetricsSettings from conductor.client.http.api.task_resource_api import TaskResourceApi from conductor.client.http.api_client import ApiClient from conductor.client.http.models.task import Task from conductor.client.http.models.task_exec_log import TaskExecLog from conductor.client.http.models.task_result import TaskResult -from conductor.client.http.rest import AuthorizationException from conductor.client.telemetry.metrics_collector import MetricsCollector from conductor.client.worker.worker_interface import WorkerInterface +from conductor.shared.configuration.settings.metrics_settings import MetricsSettings -logger = logging.getLogger( - Configuration.get_logging_formatted_name( - __name__ - ) -) +logger = logging.getLogger(Configuration.get_logging_formatted_name(__name__)) class TaskRunner: def __init__( - self, - worker: WorkerInterface, - configuration: Configuration = None, - metrics_settings: MetricsSettings = None + self, + worker: WorkerInterface, + configuration: Configuration = None, + metrics_settings: MetricsSettings = None, ): if not isinstance(worker, WorkerInterface): raise Exception("Invalid worker") @@ -38,14 +34,8 @@ def __init__( self.configuration = configuration self.metrics_collector = None if metrics_settings is not None: - self.metrics_collector = MetricsCollector( - metrics_settings - ) - self.task_client = TaskResourceApi( - ApiClient( - configuration=self.configuration - ) - ) + self.metrics_collector = MetricsCollector(metrics_settings) + self.task_client = TaskResourceApi(ApiClient(configuration=self.configuration)) def run(self) -> None: if self.configuration is not None: @@ -55,10 +45,10 @@ def run(self) -> None: task_names = ",".join(self.worker.task_definition_names) logger.info( - "Polling task %s with domain %s with polling interval %s", + "Polling task %s; domain: %s; polling_interval: %s", task_names, self.worker.get_domain(), - self.worker.get_polling_interval_in_seconds() + self.worker.get_polling_interval_in_seconds(), ) while True: @@ -81,9 +71,7 @@ def __poll_task(self) -> Task: logger.debug("Stop polling task for: %s", task_definition_name) return None if self.metrics_collector is not None: - self.metrics_collector.increment_task_poll( - task_definition_name - ) + self.metrics_collector.increment_task_poll(task_definition_name) try: start_time = time.time() @@ -95,30 +83,53 @@ def __poll_task(self) -> Task: finish_time = time.time() time_spent = finish_time - start_time if self.metrics_collector is not None: - self.metrics_collector.record_task_poll_time(task_definition_name, time_spent) + self.metrics_collector.record_task_poll_time( + task_definition_name, time_spent + ) except AuthorizationException as auth_exception: if self.metrics_collector is not None: - self.metrics_collector.increment_task_poll_error(task_definition_name, type(auth_exception)) + self.metrics_collector.increment_task_poll_error( + task_definition_name, type(auth_exception) + ) if auth_exception.invalid_token: - logger.fatal(f"failed to poll task {task_definition_name} due to invalid auth token") + logger.error( + "Failed to poll task: %s; reason: invalid auth token", + task_definition_name, + ) else: - logger.fatal(f"failed to poll task {task_definition_name} error: {auth_exception.status} - {auth_exception.error_code}") + logger.error( + "Failed to poll task: %s; status: %s - %s", + task_definition_name, + auth_exception.status, + auth_exception.error_code, + ) return None - except Exception as e: + except ApiException as e: if self.metrics_collector is not None: - self.metrics_collector.increment_task_poll_error(task_definition_name, type(e)) + self.metrics_collector.increment_task_poll_error( + task_definition_name, type(e) + ) logger.error( - "Failed to poll task for: %s, reason: %s", + "Failed to poll task: %s, reason: %s, code: %s", task_definition_name, - traceback.format_exc() + e.reason, + e.code, ) return None + except Exception as e: + if self.metrics_collector is not None: + self.metrics_collector.increment_task_poll_error( + task_definition_name, type(e) + ) + logger.error("Failed to poll task: %s; reason: %s", task_definition_name, e) + return None + if task is not None: logger.debug( - "Polled task: %s, worker_id: %s, domain: %s", + "Polled task: %s; worker_id: %s; domain: %s", task_definition_name, self.worker.get_identity(), - self.worker.get_domain() + self.worker.get_domain(), ) return task @@ -127,10 +138,10 @@ def __execute_task(self, task: Task) -> TaskResult: return None task_definition_name = self.worker.get_task_definition_name() logger.debug( - "Executing task, id: %s, workflow_instance_id: %s, task_definition_name: %s", + "Executing task id: %s; workflow_instance_id: %s; task_definition_name: %s", task.task_id, task.workflow_instance_id, - task_definition_name + task_definition_name, ) try: start_time = time.time() @@ -139,18 +150,16 @@ def __execute_task(self, task: Task) -> TaskResult: time_spent = finish_time - start_time if self.metrics_collector is not None: self.metrics_collector.record_task_execute_time( - task_definition_name, - time_spent + task_definition_name, time_spent ) self.metrics_collector.record_task_result_payload_size( - task_definition_name, - sys.getsizeof(task_result) + task_definition_name, sys.getsizeof(task_result) ) logger.debug( - "Executed task, id: %s, workflow_instance_id: %s, task_definition_name: %s", + "Executed task id: %s; workflow_instance_id: %s; task_definition_name: %s", task.task_id, task.workflow_instance_id, - task_definition_name + task_definition_name, ) except Exception as e: if self.metrics_collector is not None: @@ -160,19 +169,22 @@ def __execute_task(self, task: Task) -> TaskResult: task_result = TaskResult( task_id=task.task_id, workflow_instance_id=task.workflow_instance_id, - worker_id=self.worker.get_identity() + worker_id=self.worker.get_identity(), ) task_result.status = "FAILED" task_result.reason_for_incompletion = str(e) - task_result.logs = [TaskExecLog( - traceback.format_exc(), task_result.task_id, int(time.time()))] + task_result.logs = [ + TaskExecLog( + traceback.format_exc(), task_result.task_id, int(time.time()) + ) + ] logger.error( - "Failed to execute task, id: %s, workflow_instance_id: %s, " - "task_definition_name: %s, reason: %s", + "Failed to execute task id: %s; workflow_instance_id: %s; " + "task_definition_name: %s; reason: %s", task.task_id, task.workflow_instance_id, task_definition_name, - traceback.format_exc() + traceback.format_exc(), ) return task_result @@ -181,10 +193,10 @@ def __update_task(self, task_result: TaskResult): return None task_definition_name = self.worker.get_task_definition_name() logger.debug( - "Updating task, id: %s, workflow_instance_id: %s, task_definition_name: %s", + "Updating task id: %s; workflow_instance_id: %s; task_definition_name: %s", task_result.task_id, task_result.workflow_instance_id, - task_definition_name + task_definition_name, ) for attempt in range(4): if attempt > 0: @@ -193,11 +205,11 @@ def __update_task(self, task_result: TaskResult): try: response = self.task_client.update_task(body=task_result) logger.debug( - "Updated task, id: %s, workflow_instance_id: %s, task_definition_name: %s, response: %s", + "Updated task id: %s; workflow_instance_id: %s; task_definition_name: %s; response: %s", task_result.task_id, task_result.workflow_instance_id, task_definition_name, - response + response, ) return response except Exception as e: @@ -206,11 +218,11 @@ def __update_task(self, task_result: TaskResult): task_definition_name, type(e) ) logger.error( - "Failed to update task, id: %s, workflow_instance_id: %s, task_definition_name: %s, reason: %s", + "Failed to update task id: %s; workflow_instance_id: %s; task_definition_name: %s; reason: %s", task_result.task_id, task_result.workflow_instance_id, task_definition_name, - traceback.format_exc() + traceback.format_exc(), ) return None @@ -229,19 +241,22 @@ def __set_worker_properties(self) -> None: else: self.worker.domain = self.worker.get_domain() - polling_interval = self.__get_property_value_from_env("polling_interval", task_type) - if polling_interval: - try: - self.worker.poll_interval = float(polling_interval) - except Exception: - logger.error("error reading and parsing the polling interval value %s", polling_interval) - self.worker.poll_interval = self.worker.get_polling_interval_in_seconds() + polling_interval = self.__get_property_value_from_env( + "polling_interval", task_type + ) if polling_interval: try: self.worker.poll_interval = float(polling_interval) except Exception as e: - logger.error("Exception in reading polling interval from environment variable: %s", e) + logger.error( + "Error converting polling_interval to float value: %s, exception: %s", + polling_interval, + e, + ) + self.worker.poll_interval = ( + self.worker.get_polling_interval_in_seconds() + ) def __get_property_value_from_env(self, prop, task_type): """ diff --git a/src/conductor/client/codegen/__init__.py b/src/conductor/client/codegen/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/conductor/client/codegen/api/__init__.py b/src/conductor/client/codegen/api/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/conductor/client/codegen/api/admin_resource_api.py b/src/conductor/client/codegen/api/admin_resource_api.py new file mode 100644 index 00000000..2577ae0d --- /dev/null +++ b/src/conductor/client/codegen/api/admin_resource_api.py @@ -0,0 +1,482 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class AdminResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def clear_task_execution_cache(self, task_def_name, **kwargs): # noqa: E501 + """Remove execution cached values for the task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.clear_task_execution_cache(task_def_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_def_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.clear_task_execution_cache_with_http_info(task_def_name, **kwargs) # noqa: E501 + else: + (data) = self.clear_task_execution_cache_with_http_info(task_def_name, **kwargs) # noqa: E501 + return data + + def clear_task_execution_cache_with_http_info(self, task_def_name, **kwargs): # noqa: E501 + """Remove execution cached values for the task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.clear_task_execution_cache_with_http_info(task_def_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_def_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_def_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method clear_task_execution_cache" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_def_name' is set + if ('task_def_name' not in params or + params['task_def_name'] is None): + raise ValueError("Missing the required parameter `task_def_name` when calling `clear_task_execution_cache`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_def_name' in params: + path_params['taskDefName'] = params['task_def_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/admin/cache/clear/{taskDefName}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_redis_usage(self, **kwargs): # noqa: E501 + """Get details of redis usage # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_redis_usage(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_redis_usage_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_redis_usage_with_http_info(**kwargs) # noqa: E501 + return data + + def get_redis_usage_with_http_info(self, **kwargs): # noqa: E501 + """Get details of redis usage # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_redis_usage_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_redis_usage" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/admin/redisUsage', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, object)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def requeue_sweep(self, workflow_id, **kwargs): # noqa: E501 + """Queue up all the running workflows for sweep # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.requeue_sweep(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.requeue_sweep_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.requeue_sweep_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def requeue_sweep_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Queue up all the running workflows for sweep # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.requeue_sweep_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method requeue_sweep" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `requeue_sweep`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/plain']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/admin/sweep/requeue/{workflowId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def verify_and_repair_workflow_consistency(self, workflow_id, **kwargs): # noqa: E501 + """Verify and repair workflow consistency # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.verify_and_repair_workflow_consistency(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.verify_and_repair_workflow_consistency_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.verify_and_repair_workflow_consistency_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def verify_and_repair_workflow_consistency_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Verify and repair workflow consistency # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.verify_and_repair_workflow_consistency_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method verify_and_repair_workflow_consistency" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `verify_and_repair_workflow_consistency`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/plain']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/admin/consistency/verifyAndRepair/{workflowId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def view(self, tasktype, **kwargs): # noqa: E501 + """Get the list of pending tasks for a given task type # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.view(tasktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tasktype: (required) + :param int start: + :param int count: + :return: list[Task] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.view_with_http_info(tasktype, **kwargs) # noqa: E501 + else: + (data) = self.view_with_http_info(tasktype, **kwargs) # noqa: E501 + return data + + def view_with_http_info(self, tasktype, **kwargs): # noqa: E501 + """Get the list of pending tasks for a given task type # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.view_with_http_info(tasktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tasktype: (required) + :param int start: + :param int count: + :return: list[Task] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tasktype', 'start', 'count'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method view" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tasktype' is set + if ('tasktype' not in params or + params['tasktype'] is None): + raise ValueError("Missing the required parameter `tasktype` when calling `view`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tasktype' in params: + path_params['tasktype'] = params['tasktype'] # noqa: E501 + + query_params = [] + if 'start' in params: + query_params.append(('start', params['start'])) # noqa: E501 + if 'count' in params: + query_params.append(('count', params['count'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/admin/task/{tasktype}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Task]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/application_resource_api.py b/src/conductor/client/codegen/api/application_resource_api.py new file mode 100644 index 00000000..a0c6da94 --- /dev/null +++ b/src/conductor/client/codegen/api/application_resource_api.py @@ -0,0 +1,1472 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class ApplicationResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def add_role_to_application_user(self, application_id, role, **kwargs): # noqa: E501 + """add_role_to_application_user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_role_to_application_user(application_id, role, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str role: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_role_to_application_user_with_http_info(application_id, role, **kwargs) # noqa: E501 + else: + (data) = self.add_role_to_application_user_with_http_info(application_id, role, **kwargs) # noqa: E501 + return data + + def add_role_to_application_user_with_http_info(self, application_id, role, **kwargs): # noqa: E501 + """add_role_to_application_user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_role_to_application_user_with_http_info(application_id, role, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str role: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['application_id', 'role'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_role_to_application_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'application_id' is set + if ('application_id' not in params or + params['application_id'] is None): + raise ValueError("Missing the required parameter `application_id` when calling `add_role_to_application_user`") # noqa: E501 + # verify the required parameter 'role' is set + if ('role' not in params or + params['role'] is None): + raise ValueError("Missing the required parameter `role` when calling `add_role_to_application_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'application_id' in params: + path_params['applicationId'] = params['application_id'] # noqa: E501 + if 'role' in params: + path_params['role'] = params['role'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{applicationId}/roles/{role}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_access_key(self, id, **kwargs): # noqa: E501 + """Create an access key for an application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_access_key(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_access_key_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.create_access_key_with_http_info(id, **kwargs) # noqa: E501 + return data + + def create_access_key_with_http_info(self, id, **kwargs): # noqa: E501 + """Create an access key for an application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_access_key_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_access_key" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `create_access_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{id}/accessKeys', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_application(self, body, **kwargs): # noqa: E501 + """Create an application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_application(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param CreateOrUpdateApplicationRequest body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_application_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_application_with_http_info(body, **kwargs) # noqa: E501 + return data + + def create_application_with_http_info(self, body, **kwargs): # noqa: E501 + """Create an application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_application_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param CreateOrUpdateApplicationRequest body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_application" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_application`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_access_key(self, application_id, key_id, **kwargs): # noqa: E501 + """Delete an access key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_access_key(application_id, key_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str key_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_access_key_with_http_info(application_id, key_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_access_key_with_http_info(application_id, key_id, **kwargs) # noqa: E501 + return data + + def delete_access_key_with_http_info(self, application_id, key_id, **kwargs): # noqa: E501 + """Delete an access key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_access_key_with_http_info(application_id, key_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str key_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['application_id', 'key_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_access_key" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'application_id' is set + if ('application_id' not in params or + params['application_id'] is None): + raise ValueError("Missing the required parameter `application_id` when calling `delete_access_key`") # noqa: E501 + # verify the required parameter 'key_id' is set + if ('key_id' not in params or + params['key_id'] is None): + raise ValueError("Missing the required parameter `key_id` when calling `delete_access_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'application_id' in params: + path_params['applicationId'] = params['application_id'] # noqa: E501 + if 'key_id' in params: + path_params['keyId'] = params['key_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{applicationId}/accessKeys/{keyId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_application(self, id, **kwargs): # noqa: E501 + """Delete an application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_application(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_application_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.delete_application_with_http_info(id, **kwargs) # noqa: E501 + return data + + def delete_application_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete an application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_application_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_application" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `delete_application`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_tag_for_application(self, body, id, **kwargs): # noqa: E501 + """Delete a tag for application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_application(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_tag_for_application_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.delete_tag_for_application_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def delete_tag_for_application_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Delete a tag for application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_application_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tag_for_application" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `delete_tag_for_application`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `delete_tag_for_application`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{id}/tags', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_access_keys(self, id, **kwargs): # noqa: E501 + """Get application's access keys # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_access_keys(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_access_keys_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_access_keys_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_access_keys_with_http_info(self, id, **kwargs): # noqa: E501 + """Get application's access keys # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_access_keys_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_access_keys" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_access_keys`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{id}/accessKeys', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_app_by_access_key_id(self, access_key_id, **kwargs): # noqa: E501 + """Get application id by access key id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_app_by_access_key_id(access_key_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str access_key_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_app_by_access_key_id_with_http_info(access_key_id, **kwargs) # noqa: E501 + else: + (data) = self.get_app_by_access_key_id_with_http_info(access_key_id, **kwargs) # noqa: E501 + return data + + def get_app_by_access_key_id_with_http_info(self, access_key_id, **kwargs): # noqa: E501 + """Get application id by access key id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_app_by_access_key_id_with_http_info(access_key_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str access_key_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['access_key_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_app_by_access_key_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'access_key_id' is set + if ('access_key_id' not in params or + params['access_key_id'] is None): + raise ValueError("Missing the required parameter `access_key_id` when calling `get_app_by_access_key_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'access_key_id' in params: + path_params['accessKeyId'] = params['access_key_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/key/{accessKeyId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_application(self, id, **kwargs): # noqa: E501 + """Get an application by id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_application(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_application_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_application_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_application_with_http_info(self, id, **kwargs): # noqa: E501 + """Get an application by id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_application_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_application" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_application`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_tags_for_application(self, id, **kwargs): # noqa: E501 + """Get tags by application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_application(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_tags_for_application_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_for_application_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_tags_for_application_with_http_info(self, id, **kwargs): # noqa: E501 + """Get tags by application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_application_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags_for_application" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_tags_for_application`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{id}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Tag]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_applications(self, **kwargs): # noqa: E501 + """Get all applications # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_applications(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[ExtendedConductorApplication] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_applications_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_applications_with_http_info(**kwargs) # noqa: E501 + return data + + def list_applications_with_http_info(self, **kwargs): # noqa: E501 + """Get all applications # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_applications_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[ExtendedConductorApplication] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_applications" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ExtendedConductorApplication]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_tag_for_application(self, body, id, **kwargs): # noqa: E501 + """Put a tag to application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_application(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_tag_for_application_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.put_tag_for_application_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def put_tag_for_application_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Put a tag to application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_application_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_tag_for_application" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_tag_for_application`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `put_tag_for_application`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{id}/tags', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def remove_role_from_application_user(self, application_id, role, **kwargs): # noqa: E501 + """remove_role_from_application_user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_role_from_application_user(application_id, role, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str role: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.remove_role_from_application_user_with_http_info(application_id, role, **kwargs) # noqa: E501 + else: + (data) = self.remove_role_from_application_user_with_http_info(application_id, role, **kwargs) # noqa: E501 + return data + + def remove_role_from_application_user_with_http_info(self, application_id, role, **kwargs): # noqa: E501 + """remove_role_from_application_user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_role_from_application_user_with_http_info(application_id, role, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str role: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['application_id', 'role'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_role_from_application_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'application_id' is set + if ('application_id' not in params or + params['application_id'] is None): + raise ValueError("Missing the required parameter `application_id` when calling `remove_role_from_application_user`") # noqa: E501 + # verify the required parameter 'role' is set + if ('role' not in params or + params['role'] is None): + raise ValueError("Missing the required parameter `role` when calling `remove_role_from_application_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'application_id' in params: + path_params['applicationId'] = params['application_id'] # noqa: E501 + if 'role' in params: + path_params['role'] = params['role'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{applicationId}/roles/{role}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def toggle_access_key_status(self, application_id, key_id, **kwargs): # noqa: E501 + """Toggle the status of an access key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.toggle_access_key_status(application_id, key_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str key_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.toggle_access_key_status_with_http_info(application_id, key_id, **kwargs) # noqa: E501 + else: + (data) = self.toggle_access_key_status_with_http_info(application_id, key_id, **kwargs) # noqa: E501 + return data + + def toggle_access_key_status_with_http_info(self, application_id, key_id, **kwargs): # noqa: E501 + """Toggle the status of an access key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.toggle_access_key_status_with_http_info(application_id, key_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str key_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['application_id', 'key_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method toggle_access_key_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'application_id' is set + if ('application_id' not in params or + params['application_id'] is None): + raise ValueError("Missing the required parameter `application_id` when calling `toggle_access_key_status`") # noqa: E501 + # verify the required parameter 'key_id' is set + if ('key_id' not in params or + params['key_id'] is None): + raise ValueError("Missing the required parameter `key_id` when calling `toggle_access_key_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'application_id' in params: + path_params['applicationId'] = params['application_id'] # noqa: E501 + if 'key_id' in params: + path_params['keyId'] = params['key_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{applicationId}/accessKeys/{keyId}/status', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_application(self, body, id, **kwargs): # noqa: E501 + """Update an application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_application(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param CreateOrUpdateApplicationRequest body: (required) + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_application_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.update_application_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def update_application_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Update an application # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_application_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param CreateOrUpdateApplicationRequest body: (required) + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_application" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_application`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `update_application`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/authorization_resource_api.py b/src/conductor/client/codegen/api/authorization_resource_api.py new file mode 100644 index 00000000..5b22645a --- /dev/null +++ b/src/conductor/client/codegen/api/authorization_resource_api.py @@ -0,0 +1,316 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class AuthorizationResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_permissions(self, type, id, **kwargs): # noqa: E501 + """Get the access that have been granted over the given object # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_permissions(type, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str type: (required) + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_permissions_with_http_info(type, id, **kwargs) # noqa: E501 + else: + (data) = self.get_permissions_with_http_info(type, id, **kwargs) # noqa: E501 + return data + + def get_permissions_with_http_info(self, type, id, **kwargs): # noqa: E501 + """Get the access that have been granted over the given object # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_permissions_with_http_info(type, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str type: (required) + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['type', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_permissions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'type' is set + if ('type' not in params or + params['type'] is None): + raise ValueError("Missing the required parameter `type` when calling `get_permissions`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_permissions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'type' in params: + path_params['type'] = params['type'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/auth/authorization/{type}/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def grant_permissions(self, body, **kwargs): # noqa: E501 + """Grant access to a user over the target # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.grant_permissions(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param AuthorizationRequest body: (required) + :return: Response + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.grant_permissions_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.grant_permissions_with_http_info(body, **kwargs) # noqa: E501 + return data + + def grant_permissions_with_http_info(self, body, **kwargs): # noqa: E501 + """Grant access to a user over the target # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.grant_permissions_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param AuthorizationRequest body: (required) + :return: Response + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method grant_permissions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `grant_permissions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/auth/authorization', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Response', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def remove_permissions(self, body, **kwargs): # noqa: E501 + """Remove user's access over the target # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_permissions(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param AuthorizationRequest body: (required) + :return: Response + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.remove_permissions_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.remove_permissions_with_http_info(body, **kwargs) # noqa: E501 + return data + + def remove_permissions_with_http_info(self, body, **kwargs): # noqa: E501 + """Remove user's access over the target # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_permissions_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param AuthorizationRequest body: (required) + :return: Response + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_permissions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_permissions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/auth/authorization', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Response', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/environment_resource_api.py b/src/conductor/client/codegen/api/environment_resource_api.py new file mode 100644 index 00000000..9c819fb1 --- /dev/null +++ b/src/conductor/client/codegen/api/environment_resource_api.py @@ -0,0 +1,688 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class EnvironmentResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_or_update_env_variable(self, body, key, **kwargs): # noqa: E501 + """Create or update an environment variable (requires metadata or admin role) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_or_update_env_variable(body, key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param str key: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_or_update_env_variable_with_http_info(body, key, **kwargs) # noqa: E501 + else: + (data) = self.create_or_update_env_variable_with_http_info(body, key, **kwargs) # noqa: E501 + return data + + def create_or_update_env_variable_with_http_info(self, body, key, **kwargs): # noqa: E501 + """Create or update an environment variable (requires metadata or admin role) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_or_update_env_variable_with_http_info(body, key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param str key: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_or_update_env_variable" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_or_update_env_variable`") # noqa: E501 + # verify the required parameter 'key' is set + if ('key' not in params or + params['key'] is None): + raise ValueError("Missing the required parameter `key` when calling `create_or_update_env_variable`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'key' in params: + path_params['key'] = params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['text/plain']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/environment/{key}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_env_variable(self, key, **kwargs): # noqa: E501 + """Delete an environment variable (requires metadata or admin role) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_env_variable(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_env_variable_with_http_info(key, **kwargs) # noqa: E501 + else: + (data) = self.delete_env_variable_with_http_info(key, **kwargs) # noqa: E501 + return data + + def delete_env_variable_with_http_info(self, key, **kwargs): # noqa: E501 + """Delete an environment variable (requires metadata or admin role) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_env_variable_with_http_info(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_env_variable" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'key' is set + if ('key' not in params or + params['key'] is None): + raise ValueError("Missing the required parameter `key` when calling `delete_env_variable`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'key' in params: + path_params['key'] = params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'text/plain']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/environment/{key}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_tag_for_env_var(self, body, name, **kwargs): # noqa: E501 + """Delete a tag for environment variable name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_env_var(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_tag_for_env_var_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.delete_tag_for_env_var_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def delete_tag_for_env_var_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Delete a tag for environment variable name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_env_var_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tag_for_env_var" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `delete_tag_for_env_var`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_tag_for_env_var`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/environment/{name}/tags', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get(self, key, **kwargs): # noqa: E501 + """Get the environment value by key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_with_http_info(key, **kwargs) # noqa: E501 + else: + (data) = self.get_with_http_info(key, **kwargs) # noqa: E501 + return data + + def get_with_http_info(self, key, **kwargs): # noqa: E501 + """Get the environment value by key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_with_http_info(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'key' is set + if ('key' not in params or + params['key'] is None): + raise ValueError("Missing the required parameter `key` when calling `get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'key' in params: + path_params['key'] = params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'text/plain']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/environment/{key}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_all(self, **kwargs): # noqa: E501 + """List all the environment variables # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[EnvironmentVariable] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_all_with_http_info(**kwargs) # noqa: E501 + return data + + def get_all_with_http_info(self, **kwargs): # noqa: E501 + """List all the environment variables # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[EnvironmentVariable] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/environment', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[EnvironmentVariable]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_tags_for_env_var(self, name, **kwargs): # noqa: E501 + """Get tags by environment variable name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_env_var(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_tags_for_env_var_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_for_env_var_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_tags_for_env_var_with_http_info(self, name, **kwargs): # noqa: E501 + """Get tags by environment variable name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_env_var_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags_for_env_var" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_tags_for_env_var`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/environment/{name}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Tag]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_tag_for_env_var(self, body, name, **kwargs): # noqa: E501 + """Put a tag to environment variable name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_env_var(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_tag_for_env_var_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.put_tag_for_env_var_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def put_tag_for_env_var_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Put a tag to environment variable name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_env_var_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_tag_for_env_var" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_tag_for_env_var`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `put_tag_for_env_var`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/environment/{name}/tags', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/event_execution_resource_api.py b/src/conductor/client/codegen/api/event_execution_resource_api.py new file mode 100644 index 00000000..25e0666b --- /dev/null +++ b/src/conductor/client/codegen/api/event_execution_resource_api.py @@ -0,0 +1,207 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class EventExecutionResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_event_handlers_for_event1(self, **kwargs): # noqa: E501 + """Get All active Event Handlers for the last 24 hours # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_event_handlers_for_event1(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: SearchResultHandledEventResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_event_handlers_for_event1_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_event_handlers_for_event1_with_http_info(**kwargs) # noqa: E501 + return data + + def get_event_handlers_for_event1_with_http_info(self, **kwargs): # noqa: E501 + """Get All active Event Handlers for the last 24 hours # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_event_handlers_for_event1_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: SearchResultHandledEventResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_event_handlers_for_event1" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/execution', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SearchResultHandledEventResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_event_handlers_for_event2(self, event, _from, **kwargs): # noqa: E501 + """Get event handlers for a given event # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_event_handlers_for_event2(event, _from, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str event: (required) + :param int _from: (required) + :return: list[ExtendedEventExecution] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_event_handlers_for_event2_with_http_info(event, _from, **kwargs) # noqa: E501 + else: + (data) = self.get_event_handlers_for_event2_with_http_info(event, _from, **kwargs) # noqa: E501 + return data + + def get_event_handlers_for_event2_with_http_info(self, event, _from, **kwargs): # noqa: E501 + """Get event handlers for a given event # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_event_handlers_for_event2_with_http_info(event, _from, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str event: (required) + :param int _from: (required) + :return: list[ExtendedEventExecution] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['event', '_from'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_event_handlers_for_event2" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'event' is set + if ('event' not in params or + params['event'] is None): + raise ValueError("Missing the required parameter `event` when calling `get_event_handlers_for_event2`") # noqa: E501 + # verify the required parameter '_from' is set + if ('_from' not in params or + params['_from'] is None): + raise ValueError("Missing the required parameter `_from` when calling `get_event_handlers_for_event2`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'event' in params: + path_params['event'] = params['event'] # noqa: E501 + + query_params = [] + if '_from' in params: + query_params.append(('from', params['_from'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/execution/{event}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ExtendedEventExecution]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/event_message_resource_api.py b/src/conductor/client/codegen/api/event_message_resource_api.py new file mode 100644 index 00000000..0f80d8a8 --- /dev/null +++ b/src/conductor/client/codegen/api/event_message_resource_api.py @@ -0,0 +1,207 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class EventMessageResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_events(self, **kwargs): # noqa: E501 + """Get all event handlers with statistics # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_events(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int _from: + :return: SearchResultHandledEventResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_events_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_events_with_http_info(**kwargs) # noqa: E501 + return data + + def get_events_with_http_info(self, **kwargs): # noqa: E501 + """Get all event handlers with statistics # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_events_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int _from: + :return: SearchResultHandledEventResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['_from'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_events" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if '_from' in params: + query_params.append(('from', params['_from'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/message', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SearchResultHandledEventResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_messages(self, event, **kwargs): # noqa: E501 + """Get event messages for a given event # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_messages(event, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str event: (required) + :param int _from: + :return: list[EventMessage] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_messages_with_http_info(event, **kwargs) # noqa: E501 + else: + (data) = self.get_messages_with_http_info(event, **kwargs) # noqa: E501 + return data + + def get_messages_with_http_info(self, event, **kwargs): # noqa: E501 + """Get event messages for a given event # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_messages_with_http_info(event, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str event: (required) + :param int _from: + :return: list[EventMessage] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['event', '_from'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_messages" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'event' is set + if ('event' not in params or + params['event'] is None): + raise ValueError("Missing the required parameter `event` when calling `get_messages`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'event' in params: + path_params['event'] = params['event'] # noqa: E501 + + query_params = [] + if '_from' in params: + query_params.append(('from', params['_from'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/message/{event}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[EventMessage]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/event_resource_api.py b/src/conductor/client/codegen/api/event_resource_api.py new file mode 100644 index 00000000..4fd0586b --- /dev/null +++ b/src/conductor/client/codegen/api/event_resource_api.py @@ -0,0 +1,1533 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class EventResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def add_event_handler(self, body, **kwargs): # noqa: E501 + """Add a new event handler. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_event_handler(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[EventHandler] body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_event_handler_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.add_event_handler_with_http_info(body, **kwargs) # noqa: E501 + return data + + def add_event_handler_with_http_info(self, body, **kwargs): # noqa: E501 + """Add a new event handler. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_event_handler_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[EventHandler] body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_event_handler" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_event_handler`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_queue_config(self, queue_type, queue_name, **kwargs): # noqa: E501 + """Delete queue config by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_queue_config(queue_type, queue_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str queue_type: (required) + :param str queue_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_queue_config_with_http_info(queue_type, queue_name, **kwargs) # noqa: E501 + else: + (data) = self.delete_queue_config_with_http_info(queue_type, queue_name, **kwargs) # noqa: E501 + return data + + def delete_queue_config_with_http_info(self, queue_type, queue_name, **kwargs): # noqa: E501 + """Delete queue config by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_queue_config_with_http_info(queue_type, queue_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str queue_type: (required) + :param str queue_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['queue_type', 'queue_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_queue_config" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'queue_type' is set + if ('queue_type' not in params or + params['queue_type'] is None): + raise ValueError("Missing the required parameter `queue_type` when calling `delete_queue_config`") # noqa: E501 + # verify the required parameter 'queue_name' is set + if ('queue_name' not in params or + params['queue_name'] is None): + raise ValueError("Missing the required parameter `queue_name` when calling `delete_queue_config`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'queue_type' in params: + path_params['queueType'] = params['queue_type'] # noqa: E501 + if 'queue_name' in params: + path_params['queueName'] = params['queue_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/queue/config/{queueType}/{queueName}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_tag_for_event_handler(self, body, name, **kwargs): # noqa: E501 + """Delete a tag for event handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_event_handler(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_tag_for_event_handler_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.delete_tag_for_event_handler_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def delete_tag_for_event_handler_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Delete a tag for event handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_event_handler_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tag_for_event_handler" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `delete_tag_for_event_handler`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_tag_for_event_handler`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/{name}/tags', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_event_handler_by_name(self, name, **kwargs): # noqa: E501 + """Get event handler by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_event_handler_by_name(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: EventHandler + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_event_handler_by_name_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_event_handler_by_name_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_event_handler_by_name_with_http_info(self, name, **kwargs): # noqa: E501 + """Get event handler by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_event_handler_by_name_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: EventHandler + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_event_handler_by_name" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_event_handler_by_name`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/handler/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EventHandler', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_event_handlers(self, **kwargs): # noqa: E501 + """Get all the event handlers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_event_handlers(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[EventHandler] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_event_handlers_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_event_handlers_with_http_info(**kwargs) # noqa: E501 + return data + + def get_event_handlers_with_http_info(self, **kwargs): # noqa: E501 + """Get all the event handlers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_event_handlers_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[EventHandler] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_event_handlers" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[EventHandler]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_event_handlers_for_event(self, event, **kwargs): # noqa: E501 + """Get event handlers for a given event # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_event_handlers_for_event(event, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str event: (required) + :param bool active_only: + :return: list[EventHandler] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_event_handlers_for_event_with_http_info(event, **kwargs) # noqa: E501 + else: + (data) = self.get_event_handlers_for_event_with_http_info(event, **kwargs) # noqa: E501 + return data + + def get_event_handlers_for_event_with_http_info(self, event, **kwargs): # noqa: E501 + """Get event handlers for a given event # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_event_handlers_for_event_with_http_info(event, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str event: (required) + :param bool active_only: + :return: list[EventHandler] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['event', 'active_only'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_event_handlers_for_event" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'event' is set + if ('event' not in params or + params['event'] is None): + raise ValueError("Missing the required parameter `event` when calling `get_event_handlers_for_event`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'event' in params: + path_params['event'] = params['event'] # noqa: E501 + + query_params = [] + if 'active_only' in params: + query_params.append(('activeOnly', params['active_only'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/{event}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[EventHandler]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_queue_config(self, queue_type, queue_name, **kwargs): # noqa: E501 + """Get queue config by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_queue_config(queue_type, queue_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str queue_type: (required) + :param str queue_name: (required) + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_queue_config_with_http_info(queue_type, queue_name, **kwargs) # noqa: E501 + else: + (data) = self.get_queue_config_with_http_info(queue_type, queue_name, **kwargs) # noqa: E501 + return data + + def get_queue_config_with_http_info(self, queue_type, queue_name, **kwargs): # noqa: E501 + """Get queue config by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_queue_config_with_http_info(queue_type, queue_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str queue_type: (required) + :param str queue_name: (required) + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['queue_type', 'queue_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_queue_config" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'queue_type' is set + if ('queue_type' not in params or + params['queue_type'] is None): + raise ValueError("Missing the required parameter `queue_type` when calling `get_queue_config`") # noqa: E501 + # verify the required parameter 'queue_name' is set + if ('queue_name' not in params or + params['queue_name'] is None): + raise ValueError("Missing the required parameter `queue_name` when calling `get_queue_config`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'queue_type' in params: + path_params['queueType'] = params['queue_type'] # noqa: E501 + if 'queue_name' in params: + path_params['queueName'] = params['queue_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/queue/config/{queueType}/{queueName}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, object)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_queue_names(self, **kwargs): # noqa: E501 + """Get all queue configs # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_queue_names(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, str) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_queue_names_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_queue_names_with_http_info(**kwargs) # noqa: E501 + return data + + def get_queue_names_with_http_info(self, **kwargs): # noqa: E501 + """Get all queue configs # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_queue_names_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, str) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_queue_names" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/queue/config', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, str)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_tags_for_event_handler(self, name, **kwargs): # noqa: E501 + """Get tags by event handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_event_handler(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_tags_for_event_handler_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_for_event_handler_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_tags_for_event_handler_with_http_info(self, name, **kwargs): # noqa: E501 + """Get tags by event handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_event_handler_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags_for_event_handler" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_tags_for_event_handler`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/{name}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Tag]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def handle_incoming_event(self, body, **kwargs): # noqa: E501 + """Handle an incoming event # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.handle_incoming_event(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.handle_incoming_event_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.handle_incoming_event_with_http_info(body, **kwargs) # noqa: E501 + return data + + def handle_incoming_event_with_http_info(self, body, **kwargs): # noqa: E501 + """Handle an incoming event # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.handle_incoming_event_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method handle_incoming_event" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `handle_incoming_event`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/handleIncomingEvent', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_queue_config(self, body, queue_type, queue_name, **kwargs): # noqa: E501 + """Create or update queue config by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_queue_config(body, queue_type, queue_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param str queue_type: (required) + :param str queue_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_queue_config_with_http_info(body, queue_type, queue_name, **kwargs) # noqa: E501 + else: + (data) = self.put_queue_config_with_http_info(body, queue_type, queue_name, **kwargs) # noqa: E501 + return data + + def put_queue_config_with_http_info(self, body, queue_type, queue_name, **kwargs): # noqa: E501 + """Create or update queue config by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_queue_config_with_http_info(body, queue_type, queue_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param str queue_type: (required) + :param str queue_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'queue_type', 'queue_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_queue_config" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_queue_config`") # noqa: E501 + # verify the required parameter 'queue_type' is set + if ('queue_type' not in params or + params['queue_type'] is None): + raise ValueError("Missing the required parameter `queue_type` when calling `put_queue_config`") # noqa: E501 + # verify the required parameter 'queue_name' is set + if ('queue_name' not in params or + params['queue_name'] is None): + raise ValueError("Missing the required parameter `queue_name` when calling `put_queue_config`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'queue_type' in params: + path_params['queueType'] = params['queue_type'] # noqa: E501 + if 'queue_name' in params: + path_params['queueName'] = params['queue_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/queue/config/{queueType}/{queueName}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_tag_for_event_handler(self, body, name, **kwargs): # noqa: E501 + """Put a tag to event handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_event_handler(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_tag_for_event_handler_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.put_tag_for_event_handler_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def put_tag_for_event_handler_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Put a tag to event handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_event_handler_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_tag_for_event_handler" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_tag_for_event_handler`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `put_tag_for_event_handler`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/{name}/tags', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def remove_event_handler_status(self, name, **kwargs): # noqa: E501 + """Remove an event handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_event_handler_status(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.remove_event_handler_status_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.remove_event_handler_status_with_http_info(name, **kwargs) # noqa: E501 + return data + + def remove_event_handler_status_with_http_info(self, name, **kwargs): # noqa: E501 + """Remove an event handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_event_handler_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_event_handler_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `remove_event_handler_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test(self, **kwargs): # noqa: E501 + """Get event handler by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: EventHandler + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.test_with_http_info(**kwargs) # noqa: E501 + return data + + def test_with_http_info(self, **kwargs): # noqa: E501 + """Get event handler by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: EventHandler + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/handler/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EventHandler', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_connectivity(self, body, **kwargs): # noqa: E501 + """Test connectivity for a given queue using a workflow with EVENT task and an EventHandler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_connectivity(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ConnectivityTestInput body: (required) + :return: ConnectivityTestResult + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_connectivity_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_connectivity_with_http_info(body, **kwargs) # noqa: E501 + return data + + def test_connectivity_with_http_info(self, body, **kwargs): # noqa: E501 + """Test connectivity for a given queue using a workflow with EVENT task and an EventHandler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_connectivity_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ConnectivityTestInput body: (required) + :return: ConnectivityTestResult + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_connectivity" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_connectivity`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event/queue/connectivity', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectivityTestResult', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_event_handler(self, body, **kwargs): # noqa: E501 + """Update an existing event handler. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_event_handler(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param EventHandler body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_event_handler_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.update_event_handler_with_http_info(body, **kwargs) # noqa: E501 + return data + + def update_event_handler_with_http_info(self, body, **kwargs): # noqa: E501 + """Update an existing event handler. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_event_handler_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param EventHandler body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_event_handler" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_event_handler`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/event', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/group_resource_api.py b/src/conductor/client/codegen/api/group_resource_api.py new file mode 100644 index 00000000..9d15422f --- /dev/null +++ b/src/conductor/client/codegen/api/group_resource_api.py @@ -0,0 +1,987 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class GroupResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def add_user_to_group(self, group_id, user_id, **kwargs): # noqa: E501 + """Add user to group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_user_to_group(group_id, user_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: (required) + :param str user_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_user_to_group_with_http_info(group_id, user_id, **kwargs) # noqa: E501 + else: + (data) = self.add_user_to_group_with_http_info(group_id, user_id, **kwargs) # noqa: E501 + return data + + def add_user_to_group_with_http_info(self, group_id, user_id, **kwargs): # noqa: E501 + """Add user to group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_user_to_group_with_http_info(group_id, user_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: (required) + :param str user_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'user_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_user_to_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `add_user_to_group`") # noqa: E501 + # verify the required parameter 'user_id' is set + if ('user_id' not in params or + params['user_id'] is None): + raise ValueError("Missing the required parameter `user_id` when calling `add_user_to_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['groupId'] = params['group_id'] # noqa: E501 + if 'user_id' in params: + path_params['userId'] = params['user_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/groups/{groupId}/users/{userId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def add_users_to_group(self, body, group_id, **kwargs): # noqa: E501 + """Add users to group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_users_to_group(body, group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :param str group_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_users_to_group_with_http_info(body, group_id, **kwargs) # noqa: E501 + else: + (data) = self.add_users_to_group_with_http_info(body, group_id, **kwargs) # noqa: E501 + return data + + def add_users_to_group_with_http_info(self, body, group_id, **kwargs): # noqa: E501 + """Add users to group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_users_to_group_with_http_info(body, group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :param str group_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'group_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_users_to_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_users_to_group`") # noqa: E501 + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `add_users_to_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['groupId'] = params['group_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/groups/{groupId}/users', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_group(self, id, **kwargs): # noqa: E501 + """Delete a group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_group(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: Response + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_group_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.delete_group_with_http_info(id, **kwargs) # noqa: E501 + return data + + def delete_group_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete a group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_group_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: Response + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `delete_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/groups/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Response', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_granted_permissions1(self, group_id, **kwargs): # noqa: E501 + """Get the permissions this group has over workflows and tasks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_granted_permissions1(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: (required) + :return: GrantedAccessResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_granted_permissions1_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.get_granted_permissions1_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def get_granted_permissions1_with_http_info(self, group_id, **kwargs): # noqa: E501 + """Get the permissions this group has over workflows and tasks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_granted_permissions1_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: (required) + :return: GrantedAccessResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_granted_permissions1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `get_granted_permissions1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['groupId'] = params['group_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/groups/{groupId}/permissions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GrantedAccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_group(self, id, **kwargs): # noqa: E501 + """Get a group by id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_group(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_group_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_group_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_group_with_http_info(self, id, **kwargs): # noqa: E501 + """Get a group by id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_group_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/groups/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_users_in_group(self, id, **kwargs): # noqa: E501 + """Get all users in group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_users_in_group(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_users_in_group_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_users_in_group_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_users_in_group_with_http_info(self, id, **kwargs): # noqa: E501 + """Get all users in group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_users_in_group_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_users_in_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_users_in_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/groups/{id}/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_groups(self, **kwargs): # noqa: E501 + """Get all groups # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_groups(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Group] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_groups_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_groups_with_http_info(**kwargs) # noqa: E501 + return data + + def list_groups_with_http_info(self, **kwargs): # noqa: E501 + """Get all groups # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_groups_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Group] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_groups" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/groups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Group]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def remove_user_from_group(self, group_id, user_id, **kwargs): # noqa: E501 + """Remove user from group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_user_from_group(group_id, user_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: (required) + :param str user_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.remove_user_from_group_with_http_info(group_id, user_id, **kwargs) # noqa: E501 + else: + (data) = self.remove_user_from_group_with_http_info(group_id, user_id, **kwargs) # noqa: E501 + return data + + def remove_user_from_group_with_http_info(self, group_id, user_id, **kwargs): # noqa: E501 + """Remove user from group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_user_from_group_with_http_info(group_id, user_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: (required) + :param str user_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'user_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_user_from_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `remove_user_from_group`") # noqa: E501 + # verify the required parameter 'user_id' is set + if ('user_id' not in params or + params['user_id'] is None): + raise ValueError("Missing the required parameter `user_id` when calling `remove_user_from_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['groupId'] = params['group_id'] # noqa: E501 + if 'user_id' in params: + path_params['userId'] = params['user_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/groups/{groupId}/users/{userId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def remove_users_from_group(self, body, group_id, **kwargs): # noqa: E501 + """Remove users from group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_users_from_group(body, group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :param str group_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.remove_users_from_group_with_http_info(body, group_id, **kwargs) # noqa: E501 + else: + (data) = self.remove_users_from_group_with_http_info(body, group_id, **kwargs) # noqa: E501 + return data + + def remove_users_from_group_with_http_info(self, body, group_id, **kwargs): # noqa: E501 + """Remove users from group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_users_from_group_with_http_info(body, group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :param str group_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'group_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_users_from_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_users_from_group`") # noqa: E501 + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `remove_users_from_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['groupId'] = params['group_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/groups/{groupId}/users', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def upsert_group(self, body, id, **kwargs): # noqa: E501 + """Create or update a group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upsert_group(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UpsertGroupRequest body: (required) + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.upsert_group_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.upsert_group_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def upsert_group_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Create or update a group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upsert_group_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UpsertGroupRequest body: (required) + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method upsert_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `upsert_group`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `upsert_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/groups/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/incoming_webhook_resource_api.py b/src/conductor/client/codegen/api/incoming_webhook_resource_api.py new file mode 100644 index 00000000..c8537e79 --- /dev/null +++ b/src/conductor/client/codegen/api/incoming_webhook_resource_api.py @@ -0,0 +1,235 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class IncomingWebhookResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def handle_webhook(self, id, request_params, **kwargs): # noqa: E501 + """handle_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.handle_webhook(id, request_params, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param dict(str, object) request_params: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.handle_webhook_with_http_info(id, request_params, **kwargs) # noqa: E501 + else: + (data) = self.handle_webhook_with_http_info(id, request_params, **kwargs) # noqa: E501 + return data + + def handle_webhook_with_http_info(self, id, request_params, **kwargs): # noqa: E501 + """handle_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.handle_webhook_with_http_info(id, request_params, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param dict(str, object) request_params: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'request_params'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method handle_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `handle_webhook`") # noqa: E501 + # verify the required parameter 'request_params' is set + if ('request_params' not in params or + params['request_params'] is None): + raise ValueError("Missing the required parameter `request_params` when calling `handle_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'request_params' in params: + query_params.append(('requestParams', params['request_params'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/webhook/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def handle_webhook1(self, body, request_params, id, **kwargs): # noqa: E501 + """handle_webhook1 # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.handle_webhook1(body, request_params, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param dict(str, object) request_params: (required) + :param str id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.handle_webhook1_with_http_info(body, request_params, id, **kwargs) # noqa: E501 + else: + (data) = self.handle_webhook1_with_http_info(body, request_params, id, **kwargs) # noqa: E501 + return data + + def handle_webhook1_with_http_info(self, body, request_params, id, **kwargs): # noqa: E501 + """handle_webhook1 # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.handle_webhook1_with_http_info(body, request_params, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param dict(str, object) request_params: (required) + :param str id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'request_params', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method handle_webhook1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `handle_webhook1`") # noqa: E501 + # verify the required parameter 'request_params' is set + if ('request_params' not in params or + params['request_params'] is None): + raise ValueError("Missing the required parameter `request_params` when calling `handle_webhook1`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `handle_webhook1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'request_params' in params: + query_params.append(('requestParams', params['request_params'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/webhook/{id}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/integration_resource_api.py b/src/conductor/client/codegen/api/integration_resource_api.py new file mode 100644 index 00000000..5cb96923 --- /dev/null +++ b/src/conductor/client/codegen/api/integration_resource_api.py @@ -0,0 +1,2482 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class IntegrationResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def associate_prompt_with_integration(self, integration_provider, integration_name, prompt_name, **kwargs): # noqa: E501 + """Associate a Prompt Template with an Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.associate_prompt_with_integration(integration_provider, integration_name, prompt_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str integration_provider: (required) + :param str integration_name: (required) + :param str prompt_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.associate_prompt_with_integration_with_http_info(integration_provider, integration_name, prompt_name, **kwargs) # noqa: E501 + else: + (data) = self.associate_prompt_with_integration_with_http_info(integration_provider, integration_name, prompt_name, **kwargs) # noqa: E501 + return data + + def associate_prompt_with_integration_with_http_info(self, integration_provider, integration_name, prompt_name, **kwargs): # noqa: E501 + """Associate a Prompt Template with an Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.associate_prompt_with_integration_with_http_info(integration_provider, integration_name, prompt_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str integration_provider: (required) + :param str integration_name: (required) + :param str prompt_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['integration_provider', 'integration_name', 'prompt_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method associate_prompt_with_integration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'integration_provider' is set + if ('integration_provider' not in params or + params['integration_provider'] is None): + raise ValueError("Missing the required parameter `integration_provider` when calling `associate_prompt_with_integration`") # noqa: E501 + # verify the required parameter 'integration_name' is set + if ('integration_name' not in params or + params['integration_name'] is None): + raise ValueError("Missing the required parameter `integration_name` when calling `associate_prompt_with_integration`") # noqa: E501 + # verify the required parameter 'prompt_name' is set + if ('prompt_name' not in params or + params['prompt_name'] is None): + raise ValueError("Missing the required parameter `prompt_name` when calling `associate_prompt_with_integration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'integration_provider' in params: + path_params['integration_provider'] = params['integration_provider'] # noqa: E501 + if 'integration_name' in params: + path_params['integration_name'] = params['integration_name'] # noqa: E501 + if 'prompt_name' in params: + path_params['prompt_name'] = params['prompt_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{integration_provider}/integration/{integration_name}/prompt/{prompt_name}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_integration_api(self, name, integration_name, **kwargs): # noqa: E501 + """Delete an Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_integration_api(name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param str integration_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_integration_api_with_http_info(name, integration_name, **kwargs) # noqa: E501 + else: + (data) = self.delete_integration_api_with_http_info(name, integration_name, **kwargs) # noqa: E501 + return data + + def delete_integration_api_with_http_info(self, name, integration_name, **kwargs): # noqa: E501 + """Delete an Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_integration_api_with_http_info(name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param str integration_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'integration_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_integration_api" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_integration_api`") # noqa: E501 + # verify the required parameter 'integration_name' is set + if ('integration_name' not in params or + params['integration_name'] is None): + raise ValueError("Missing the required parameter `integration_name` when calling `delete_integration_api`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'integration_name' in params: + path_params['integration_name'] = params['integration_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/integration/{integration_name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_integration_provider(self, name, **kwargs): # noqa: E501 + """Delete an Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_integration_provider(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_integration_provider_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.delete_integration_provider_with_http_info(name, **kwargs) # noqa: E501 + return data + + def delete_integration_provider_with_http_info(self, name, **kwargs): # noqa: E501 + """Delete an Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_integration_provider_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_integration_provider" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_integration_provider`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_tag_for_integration(self, body, name, integration_name, **kwargs): # noqa: E501 + """Delete a tag for Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_integration(body, name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :param str integration_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_tag_for_integration_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 + else: + (data) = self.delete_tag_for_integration_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 + return data + + def delete_tag_for_integration_with_http_info(self, body, name, integration_name, **kwargs): # noqa: E501 + """Delete a tag for Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_integration_with_http_info(body, name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :param str integration_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name', 'integration_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tag_for_integration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `delete_tag_for_integration`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_tag_for_integration`") # noqa: E501 + # verify the required parameter 'integration_name' is set + if ('integration_name' not in params or + params['integration_name'] is None): + raise ValueError("Missing the required parameter `integration_name` when calling `delete_tag_for_integration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'integration_name' in params: + path_params['integration_name'] = params['integration_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/integration/{integration_name}/tags', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_tag_for_integration_provider(self, body, name, **kwargs): # noqa: E501 + """Delete a tag for Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_integration_provider(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_tag_for_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.delete_tag_for_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def delete_tag_for_integration_provider_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Delete a tag for Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_integration_provider_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tag_for_integration_provider" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `delete_tag_for_integration_provider`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_tag_for_integration_provider`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/tags', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_all_integrations(self, **kwargs): # noqa: E501 + """Get all Integrations # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_integrations(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str category: + :param bool active_only: + :return: list[Integration] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all_integrations_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_all_integrations_with_http_info(**kwargs) # noqa: E501 + return data + + def get_all_integrations_with_http_info(self, **kwargs): # noqa: E501 + """Get all Integrations # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_integrations_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str category: + :param bool active_only: + :return: list[Integration] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['category', 'active_only'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all_integrations" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'category' in params: + query_params.append(('category', params['category'])) # noqa: E501 + if 'active_only' in params: + query_params.append(('activeOnly', params['active_only'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Integration]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_integration_api(self, name, integration_name, **kwargs): # noqa: E501 + """Get Integration details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_api(name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param str integration_name: (required) + :return: IntegrationApi + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_integration_api_with_http_info(name, integration_name, **kwargs) # noqa: E501 + else: + (data) = self.get_integration_api_with_http_info(name, integration_name, **kwargs) # noqa: E501 + return data + + def get_integration_api_with_http_info(self, name, integration_name, **kwargs): # noqa: E501 + """Get Integration details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_api_with_http_info(name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param str integration_name: (required) + :return: IntegrationApi + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'integration_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_integration_api" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_integration_api`") # noqa: E501 + # verify the required parameter 'integration_name' is set + if ('integration_name' not in params or + params['integration_name'] is None): + raise ValueError("Missing the required parameter `integration_name` when calling `get_integration_api`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'integration_name' in params: + path_params['integration_name'] = params['integration_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/integration/{integration_name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IntegrationApi', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_integration_apis(self, name, **kwargs): # noqa: E501 + """Get Integrations of an Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_apis(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param bool active_only: + :return: list[IntegrationApi] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_integration_apis_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_integration_apis_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_integration_apis_with_http_info(self, name, **kwargs): # noqa: E501 + """Get Integrations of an Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_apis_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param bool active_only: + :return: list[IntegrationApi] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'active_only'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_integration_apis" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_integration_apis`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + if 'active_only' in params: + query_params.append(('activeOnly', params['active_only'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/integration', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[IntegrationApi]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_integration_available_apis(self, name, **kwargs): # noqa: E501 + """Get Integrations Available for an Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_available_apis(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[str] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_integration_available_apis_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_integration_available_apis_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_integration_available_apis_with_http_info(self, name, **kwargs): # noqa: E501 + """Get Integrations Available for an Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_available_apis_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[str] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_integration_available_apis" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_integration_available_apis`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/integration/all', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[str]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_integration_provider(self, name, **kwargs): # noqa: E501 + """Get Integration provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_provider(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: Integration + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_integration_provider_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_integration_provider_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_integration_provider_with_http_info(self, name, **kwargs): # noqa: E501 + """Get Integration provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_provider_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: Integration + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_integration_provider" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_integration_provider`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Integration', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_integration_provider_defs(self, **kwargs): # noqa: E501 + """Get Integration provider definitions # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_provider_defs(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[IntegrationDef] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_integration_provider_defs_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_integration_provider_defs_with_http_info(**kwargs) # noqa: E501 + return data + + def get_integration_provider_defs_with_http_info(self, **kwargs): # noqa: E501 + """Get Integration provider definitions # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_provider_defs_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[IntegrationDef] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_integration_provider_defs" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/def', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[IntegrationDef]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_integration_providers(self, **kwargs): # noqa: E501 + """Get all Integrations Providers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_providers(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str category: + :param bool active_only: + :return: list[Integration] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_integration_providers_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_integration_providers_with_http_info(**kwargs) # noqa: E501 + return data + + def get_integration_providers_with_http_info(self, **kwargs): # noqa: E501 + """Get all Integrations Providers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_integration_providers_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str category: + :param bool active_only: + :return: list[Integration] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['category', 'active_only'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_integration_providers" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'category' in params: + query_params.append(('category', params['category'])) # noqa: E501 + if 'active_only' in params: + query_params.append(('activeOnly', params['active_only'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Integration]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_prompts_with_integration(self, integration_provider, integration_name, **kwargs): # noqa: E501 + """Get the list of prompt templates associated with an integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_prompts_with_integration(integration_provider, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str integration_provider: (required) + :param str integration_name: (required) + :return: list[MessageTemplate] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_prompts_with_integration_with_http_info(integration_provider, integration_name, **kwargs) # noqa: E501 + else: + (data) = self.get_prompts_with_integration_with_http_info(integration_provider, integration_name, **kwargs) # noqa: E501 + return data + + def get_prompts_with_integration_with_http_info(self, integration_provider, integration_name, **kwargs): # noqa: E501 + """Get the list of prompt templates associated with an integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_prompts_with_integration_with_http_info(integration_provider, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str integration_provider: (required) + :param str integration_name: (required) + :return: list[MessageTemplate] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['integration_provider', 'integration_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_prompts_with_integration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'integration_provider' is set + if ('integration_provider' not in params or + params['integration_provider'] is None): + raise ValueError("Missing the required parameter `integration_provider` when calling `get_prompts_with_integration`") # noqa: E501 + # verify the required parameter 'integration_name' is set + if ('integration_name' not in params or + params['integration_name'] is None): + raise ValueError("Missing the required parameter `integration_name` when calling `get_prompts_with_integration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'integration_provider' in params: + path_params['integration_provider'] = params['integration_provider'] # noqa: E501 + if 'integration_name' in params: + path_params['integration_name'] = params['integration_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{integration_provider}/integration/{integration_name}/prompt', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[MessageTemplate]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_providers_and_integrations(self, **kwargs): # noqa: E501 + """Get Integrations Providers and Integrations combo # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_providers_and_integrations(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str type: + :param bool active_only: + :return: list[str] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_providers_and_integrations_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_providers_and_integrations_with_http_info(**kwargs) # noqa: E501 + return data + + def get_providers_and_integrations_with_http_info(self, **kwargs): # noqa: E501 + """Get Integrations Providers and Integrations combo # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_providers_and_integrations_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str type: + :param bool active_only: + :return: list[str] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['type', 'active_only'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_providers_and_integrations" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + if 'active_only' in params: + query_params.append(('activeOnly', params['active_only'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/all', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[str]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_tags_for_integration(self, name, integration_name, **kwargs): # noqa: E501 + """Get tags by Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_integration(name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param str integration_name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_tags_for_integration_with_http_info(name, integration_name, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_for_integration_with_http_info(name, integration_name, **kwargs) # noqa: E501 + return data + + def get_tags_for_integration_with_http_info(self, name, integration_name, **kwargs): # noqa: E501 + """Get tags by Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_integration_with_http_info(name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param str integration_name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'integration_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags_for_integration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_tags_for_integration`") # noqa: E501 + # verify the required parameter 'integration_name' is set + if ('integration_name' not in params or + params['integration_name'] is None): + raise ValueError("Missing the required parameter `integration_name` when calling `get_tags_for_integration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'integration_name' in params: + path_params['integration_name'] = params['integration_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/integration/{integration_name}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Tag]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_tags_for_integration_provider(self, name, **kwargs): # noqa: E501 + """Get tags by Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_integration_provider(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_tags_for_integration_provider_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_for_integration_provider_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_tags_for_integration_provider_with_http_info(self, name, **kwargs): # noqa: E501 + """Get tags by Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_integration_provider_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags_for_integration_provider" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_tags_for_integration_provider`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Tag]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_token_usage_for_integration(self, name, integration_name, **kwargs): # noqa: E501 + """Get Token Usage by Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_token_usage_for_integration(name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param str integration_name: (required) + :return: int + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_token_usage_for_integration_with_http_info(name, integration_name, **kwargs) # noqa: E501 + else: + (data) = self.get_token_usage_for_integration_with_http_info(name, integration_name, **kwargs) # noqa: E501 + return data + + def get_token_usage_for_integration_with_http_info(self, name, integration_name, **kwargs): # noqa: E501 + """Get Token Usage by Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_token_usage_for_integration_with_http_info(name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param str integration_name: (required) + :return: int + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'integration_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_token_usage_for_integration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_token_usage_for_integration`") # noqa: E501 + # verify the required parameter 'integration_name' is set + if ('integration_name' not in params or + params['integration_name'] is None): + raise ValueError("Missing the required parameter `integration_name` when calling `get_token_usage_for_integration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'integration_name' in params: + path_params['integration_name'] = params['integration_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/integration/{integration_name}/metrics', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='int', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_token_usage_for_integration_provider(self, name, **kwargs): # noqa: E501 + """Get Token Usage by Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_token_usage_for_integration_provider(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: dict(str, str) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_token_usage_for_integration_provider_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_token_usage_for_integration_provider_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_token_usage_for_integration_provider_with_http_info(self, name, **kwargs): # noqa: E501 + """Get Token Usage by Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_token_usage_for_integration_provider_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: dict(str, str) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_token_usage_for_integration_provider" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_token_usage_for_integration_provider`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/metrics', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, str)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_tag_for_integration(self, body, name, integration_name, **kwargs): # noqa: E501 + """Put a tag to Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_integration(body, name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :param str integration_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_tag_for_integration_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 + else: + (data) = self.put_tag_for_integration_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 + return data + + def put_tag_for_integration_with_http_info(self, body, name, integration_name, **kwargs): # noqa: E501 + """Put a tag to Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_integration_with_http_info(body, name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :param str integration_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name', 'integration_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_tag_for_integration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_tag_for_integration`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `put_tag_for_integration`") # noqa: E501 + # verify the required parameter 'integration_name' is set + if ('integration_name' not in params or + params['integration_name'] is None): + raise ValueError("Missing the required parameter `integration_name` when calling `put_tag_for_integration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'integration_name' in params: + path_params['integration_name'] = params['integration_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/integration/{integration_name}/tags', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_tag_for_integration_provider(self, body, name, **kwargs): # noqa: E501 + """Put a tag to Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_integration_provider(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_tag_for_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.put_tag_for_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def put_tag_for_integration_provider_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Put a tag to Integration Provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_integration_provider_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_tag_for_integration_provider" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_tag_for_integration_provider`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `put_tag_for_integration_provider`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/tags', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def record_event_stats(self, body, type, **kwargs): # noqa: E501 + """Record Event Stats # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.record_event_stats(body, type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[EventLog] body: (required) + :param str type: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.record_event_stats_with_http_info(body, type, **kwargs) # noqa: E501 + else: + (data) = self.record_event_stats_with_http_info(body, type, **kwargs) # noqa: E501 + return data + + def record_event_stats_with_http_info(self, body, type, **kwargs): # noqa: E501 + """Record Event Stats # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.record_event_stats_with_http_info(body, type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[EventLog] body: (required) + :param str type: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'type'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method record_event_stats" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `record_event_stats`") # noqa: E501 + # verify the required parameter 'type' is set + if ('type' not in params or + params['type'] is None): + raise ValueError("Missing the required parameter `type` when calling `record_event_stats`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/eventStats/{type}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def register_token_usage(self, body, name, integration_name, **kwargs): # noqa: E501 + """Register Token usage # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.register_token_usage(body, name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int body: (required) + :param str name: (required) + :param str integration_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.register_token_usage_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 + else: + (data) = self.register_token_usage_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 + return data + + def register_token_usage_with_http_info(self, body, name, integration_name, **kwargs): # noqa: E501 + """Register Token usage # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.register_token_usage_with_http_info(body, name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int body: (required) + :param str name: (required) + :param str integration_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name', 'integration_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method register_token_usage" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `register_token_usage`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `register_token_usage`") # noqa: E501 + # verify the required parameter 'integration_name' is set + if ('integration_name' not in params or + params['integration_name'] is None): + raise ValueError("Missing the required parameter `integration_name` when calling `register_token_usage`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'integration_name' in params: + path_params['integration_name'] = params['integration_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/integration/{integration_name}/metrics', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def save_all_integrations(self, body, **kwargs): # noqa: E501 + """Save all Integrations # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_all_integrations(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Integration] body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.save_all_integrations_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.save_all_integrations_with_http_info(body, **kwargs) # noqa: E501 + return data + + def save_all_integrations_with_http_info(self, body, **kwargs): # noqa: E501 + """Save all Integrations # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_all_integrations_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Integration] body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method save_all_integrations" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `save_all_integrations`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def save_integration_api(self, body, name, integration_name, **kwargs): # noqa: E501 + """Create or Update Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_integration_api(body, name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IntegrationApiUpdate body: (required) + :param str name: (required) + :param str integration_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.save_integration_api_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 + else: + (data) = self.save_integration_api_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 + return data + + def save_integration_api_with_http_info(self, body, name, integration_name, **kwargs): # noqa: E501 + """Create or Update Integration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_integration_api_with_http_info(body, name, integration_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IntegrationApiUpdate body: (required) + :param str name: (required) + :param str integration_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name', 'integration_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method save_integration_api" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `save_integration_api`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `save_integration_api`") # noqa: E501 + # verify the required parameter 'integration_name' is set + if ('integration_name' not in params or + params['integration_name'] is None): + raise ValueError("Missing the required parameter `integration_name` when calling `save_integration_api`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'integration_name' in params: + path_params['integration_name'] = params['integration_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}/integration/{integration_name}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def save_integration_provider(self, body, name, **kwargs): # noqa: E501 + """Create or Update Integration provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_integration_provider(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IntegrationUpdate body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.save_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.save_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def save_integration_provider_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Create or Update Integration provider # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_integration_provider_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IntegrationUpdate body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method save_integration_provider" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `save_integration_provider`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `save_integration_provider`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/provider/{name}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/limits_resource_api.py b/src/conductor/client/codegen/api/limits_resource_api.py new file mode 100644 index 00000000..77de9841 --- /dev/null +++ b/src/conductor/client/codegen/api/limits_resource_api.py @@ -0,0 +1,106 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class LimitsResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get2(self, **kwargs): # noqa: E501 + """get2 # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get2(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get2_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get2_with_http_info(**kwargs) # noqa: E501 + return data + + def get2_with_http_info(self, **kwargs): # noqa: E501 + """get2 # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get2_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get2" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/limits', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, object)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/metadata_resource_api.py b/src/conductor/client/codegen/api/metadata_resource_api.py new file mode 100644 index 00000000..286925ed --- /dev/null +++ b/src/conductor/client/codegen/api/metadata_resource_api.py @@ -0,0 +1,1201 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class MetadataResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create(self, body, **kwargs): # noqa: E501 + """Create a new workflow definition # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ExtendedWorkflowDef body: (required) + :param bool overwrite: + :param bool new_version: + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_with_http_info(body, **kwargs) # noqa: E501 + return data + + def create_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a new workflow definition # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ExtendedWorkflowDef body: (required) + :param bool overwrite: + :param bool new_version: + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'overwrite', 'new_version'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'overwrite' in params: + query_params.append(('overwrite', params['overwrite'])) # noqa: E501 + if 'new_version' in params: + query_params.append(('newVersion', params['new_version'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/workflow', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get1(self, name, **kwargs): # noqa: E501 + """Retrieves workflow definition along with blueprint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get1(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: + :param bool metadata: + :return: WorkflowDef + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get1_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get1_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get1_with_http_info(self, name, **kwargs): # noqa: E501 + """Retrieves workflow definition along with blueprint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get1_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: + :param bool metadata: + :return: WorkflowDef + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'version', 'metadata'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + if 'version' in params: + query_params.append(('version', params['version'])) # noqa: E501 + if 'metadata' in params: + query_params.append(('metadata', params['metadata'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/workflow/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkflowDef', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_task_def(self, tasktype, **kwargs): # noqa: E501 + """Gets the task definition # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task_def(tasktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tasktype: (required) + :param bool metadata: + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_task_def_with_http_info(tasktype, **kwargs) # noqa: E501 + else: + (data) = self.get_task_def_with_http_info(tasktype, **kwargs) # noqa: E501 + return data + + def get_task_def_with_http_info(self, tasktype, **kwargs): # noqa: E501 + """Gets the task definition # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task_def_with_http_info(tasktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tasktype: (required) + :param bool metadata: + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tasktype', 'metadata'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_task_def" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tasktype' is set + if ('tasktype' not in params or + params['tasktype'] is None): + raise ValueError("Missing the required parameter `tasktype` when calling `get_task_def`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tasktype' in params: + path_params['tasktype'] = params['tasktype'] # noqa: E501 + + query_params = [] + if 'metadata' in params: + query_params.append(('metadata', params['metadata'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/taskdefs/{tasktype}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_task_defs(self, **kwargs): # noqa: E501 + """Gets all task definition # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task_defs(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str access: + :param bool metadata: + :param str tag_key: + :param str tag_value: + :return: list[TaskDef] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_task_defs_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_task_defs_with_http_info(**kwargs) # noqa: E501 + return data + + def get_task_defs_with_http_info(self, **kwargs): # noqa: E501 + """Gets all task definition # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task_defs_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str access: + :param bool metadata: + :param str tag_key: + :param str tag_value: + :return: list[TaskDef] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['access', 'metadata', 'tag_key', 'tag_value'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_task_defs" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'access' in params: + query_params.append(('access', params['access'])) # noqa: E501 + if 'metadata' in params: + query_params.append(('metadata', params['metadata'])) # noqa: E501 + if 'tag_key' in params: + query_params.append(('tagKey', params['tag_key'])) # noqa: E501 + if 'tag_value' in params: + query_params.append(('tagValue', params['tag_value'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/taskdefs', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[TaskDef]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_workflow_defs(self, **kwargs): # noqa: E501 + """Retrieves all workflow definition along with blueprint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workflow_defs(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str access: + :param bool metadata: + :param str tag_key: + :param str tag_value: + :param str name: + :param bool short: + :return: list[WorkflowDef] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_workflow_defs_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_workflow_defs_with_http_info(**kwargs) # noqa: E501 + return data + + def get_workflow_defs_with_http_info(self, **kwargs): # noqa: E501 + """Retrieves all workflow definition along with blueprint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workflow_defs_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str access: + :param bool metadata: + :param str tag_key: + :param str tag_value: + :param str name: + :param bool short: + :return: list[WorkflowDef] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['access', 'metadata', 'tag_key', 'tag_value', 'name', 'short'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_workflow_defs" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'access' in params: + query_params.append(('access', params['access'])) # noqa: E501 + if 'metadata' in params: + query_params.append(('metadata', params['metadata'])) # noqa: E501 + if 'tag_key' in params: + query_params.append(('tagKey', params['tag_key'])) # noqa: E501 + if 'tag_value' in params: + query_params.append(('tagValue', params['tag_value'])) # noqa: E501 + if 'name' in params: + query_params.append(('name', params['name'])) # noqa: E501 + if 'short' in params: + query_params.append(('short', params['short'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/workflow', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[WorkflowDef]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def register_task_def(self, body, **kwargs): # noqa: E501 + """Create or update task definition(s) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.register_task_def(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[ExtendedTaskDef] body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.register_task_def_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.register_task_def_with_http_info(body, **kwargs) # noqa: E501 + return data + + def register_task_def_with_http_info(self, body, **kwargs): # noqa: E501 + """Create or update task definition(s) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.register_task_def_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[ExtendedTaskDef] body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method register_task_def" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `register_task_def`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/taskdefs', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def unregister_task_def(self, tasktype, **kwargs): # noqa: E501 + """Remove a task definition # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.unregister_task_def(tasktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tasktype: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.unregister_task_def_with_http_info(tasktype, **kwargs) # noqa: E501 + else: + (data) = self.unregister_task_def_with_http_info(tasktype, **kwargs) # noqa: E501 + return data + + def unregister_task_def_with_http_info(self, tasktype, **kwargs): # noqa: E501 + """Remove a task definition # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.unregister_task_def_with_http_info(tasktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tasktype: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tasktype'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method unregister_task_def" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tasktype' is set + if ('tasktype' not in params or + params['tasktype'] is None): + raise ValueError("Missing the required parameter `tasktype` when calling `unregister_task_def`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tasktype' in params: + path_params['tasktype'] = params['tasktype'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/taskdefs/{tasktype}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def unregister_workflow_def(self, name, version, **kwargs): # noqa: E501 + """Removes workflow definition. It does not remove workflows associated with the definition. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.unregister_workflow_def(name, version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.unregister_workflow_def_with_http_info(name, version, **kwargs) # noqa: E501 + else: + (data) = self.unregister_workflow_def_with_http_info(name, version, **kwargs) # noqa: E501 + return data + + def unregister_workflow_def_with_http_info(self, name, version, **kwargs): # noqa: E501 + """Removes workflow definition. It does not remove workflows associated with the definition. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.unregister_workflow_def_with_http_info(name, version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'version'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method unregister_workflow_def" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `unregister_workflow_def`") # noqa: E501 + # verify the required parameter 'version' is set + if ('version' not in params or + params['version'] is None): + raise ValueError("Missing the required parameter `version` when calling `unregister_workflow_def`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'version' in params: + path_params['version'] = params['version'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/workflow/{name}/{version}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update(self, body, **kwargs): # noqa: E501 + """Create or update workflow definition(s) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[ExtendedWorkflowDef] body: (required) + :param bool overwrite: + :param bool new_version: + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.update_with_http_info(body, **kwargs) # noqa: E501 + return data + + def update_with_http_info(self, body, **kwargs): # noqa: E501 + """Create or update workflow definition(s) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[ExtendedWorkflowDef] body: (required) + :param bool overwrite: + :param bool new_version: + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'overwrite', 'new_version'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'overwrite' in params: + query_params.append(('overwrite', params['overwrite'])) # noqa: E501 + if 'new_version' in params: + query_params.append(('newVersion', params['new_version'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/workflow', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_task_def(self, body, **kwargs): # noqa: E501 + """Update an existing task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_task_def(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ExtendedTaskDef body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_task_def_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.update_task_def_with_http_info(body, **kwargs) # noqa: E501 + return data + + def update_task_def_with_http_info(self, body, **kwargs): # noqa: E501 + """Update an existing task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_task_def_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ExtendedTaskDef body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_task_def" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_task_def`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/taskdefs', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def upload_bpmn_file(self, body, **kwargs): # noqa: E501 + """Imports bpmn workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_bpmn_file(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IncomingBpmnFile body: (required) + :param bool overwrite: + :return: list[ExtendedWorkflowDef] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.upload_bpmn_file_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.upload_bpmn_file_with_http_info(body, **kwargs) # noqa: E501 + return data + + def upload_bpmn_file_with_http_info(self, body, **kwargs): # noqa: E501 + """Imports bpmn workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_bpmn_file_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IncomingBpmnFile body: (required) + :param bool overwrite: + :return: list[ExtendedWorkflowDef] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'overwrite'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method upload_bpmn_file" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `upload_bpmn_file`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'overwrite' in params: + query_params.append(('overwrite', params['overwrite'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/workflow-importer/import-bpm', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ExtendedWorkflowDef]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def upload_workflows_and_tasks_definitions_to_s3(self, **kwargs): # noqa: E501 + """Upload all workflows and tasks definitions to Object storage if configured # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_workflows_and_tasks_definitions_to_s3(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.upload_workflows_and_tasks_definitions_to_s3_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.upload_workflows_and_tasks_definitions_to_s3_with_http_info(**kwargs) # noqa: E501 + return data + + def upload_workflows_and_tasks_definitions_to_s3_with_http_info(self, **kwargs): # noqa: E501 + """Upload all workflows and tasks definitions to Object storage if configured # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_workflows_and_tasks_definitions_to_s3_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method upload_workflows_and_tasks_definitions_to_s3" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/workflow-task-defs/upload', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/metrics_resource_api.py b/src/conductor/client/codegen/api/metrics_resource_api.py new file mode 100644 index 00000000..573308a0 --- /dev/null +++ b/src/conductor/client/codegen/api/metrics_resource_api.py @@ -0,0 +1,140 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class MetricsResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def prometheus_task_metrics(self, task_name, start, end, step, **kwargs): # noqa: E501 + """Returns prometheus task metrics # noqa: E501 + + Proxy call of task metrics to prometheus # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.prometheus_task_metrics(task_name, start, end, step, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_name: (required) + :param str start: (required) + :param str end: (required) + :param str step: (required) + :return: dict(str, JsonNode) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.prometheus_task_metrics_with_http_info(task_name, start, end, step, **kwargs) # noqa: E501 + else: + (data) = self.prometheus_task_metrics_with_http_info(task_name, start, end, step, **kwargs) # noqa: E501 + return data + + def prometheus_task_metrics_with_http_info(self, task_name, start, end, step, **kwargs): # noqa: E501 + """Returns prometheus task metrics # noqa: E501 + + Proxy call of task metrics to prometheus # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.prometheus_task_metrics_with_http_info(task_name, start, end, step, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_name: (required) + :param str start: (required) + :param str end: (required) + :param str step: (required) + :return: dict(str, JsonNode) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_name', 'start', 'end', 'step'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method prometheus_task_metrics" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_name' is set + if ('task_name' not in params or + params['task_name'] is None): + raise ValueError("Missing the required parameter `task_name` when calling `prometheus_task_metrics`") # noqa: E501 + # verify the required parameter 'start' is set + if ('start' not in params or + params['start'] is None): + raise ValueError("Missing the required parameter `start` when calling `prometheus_task_metrics`") # noqa: E501 + # verify the required parameter 'end' is set + if ('end' not in params or + params['end'] is None): + raise ValueError("Missing the required parameter `end` when calling `prometheus_task_metrics`") # noqa: E501 + # verify the required parameter 'step' is set + if ('step' not in params or + params['step'] is None): + raise ValueError("Missing the required parameter `step` when calling `prometheus_task_metrics`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_name' in params: + path_params['taskName'] = params['task_name'] # noqa: E501 + + query_params = [] + if 'start' in params: + query_params.append(('start', params['start'])) # noqa: E501 + if 'end' in params: + query_params.append(('end', params['end'])) # noqa: E501 + if 'step' in params: + query_params.append(('step', params['step'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metrics/task/{taskName}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, JsonNode)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/metrics_token_resource_api.py b/src/conductor/client/codegen/api/metrics_token_resource_api.py new file mode 100644 index 00000000..21878c21 --- /dev/null +++ b/src/conductor/client/codegen/api/metrics_token_resource_api.py @@ -0,0 +1,106 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class MetricsTokenResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def token(self, **kwargs): # noqa: E501 + """token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.token(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: MetricsToken + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.token_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.token_with_http_info(**kwargs) # noqa: E501 + return data + + def token_with_http_info(self, **kwargs): # noqa: E501 + """token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.token_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: MetricsToken + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method token" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metrics/token', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MetricsToken', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/prompt_resource_api.py b/src/conductor/client/codegen/api/prompt_resource_api.py new file mode 100644 index 00000000..fda5b56b --- /dev/null +++ b/src/conductor/client/codegen/api/prompt_resource_api.py @@ -0,0 +1,887 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class PromptResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_message_templates(self, body, **kwargs): # noqa: E501 + """Create message templates in bulk # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_message_templates(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[MessageTemplate] body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_message_templates_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_message_templates_with_http_info(body, **kwargs) # noqa: E501 + return data + + def create_message_templates_with_http_info(self, body, **kwargs): # noqa: E501 + """Create message templates in bulk # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_message_templates_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[MessageTemplate] body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_message_templates" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_message_templates`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/prompts/', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_message_template(self, name, **kwargs): # noqa: E501 + """Delete Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_message_template(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_message_template_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.delete_message_template_with_http_info(name, **kwargs) # noqa: E501 + return data + + def delete_message_template_with_http_info(self, name, **kwargs): # noqa: E501 + """Delete Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_message_template_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_message_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_message_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/prompts/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_tag_for_prompt_template(self, body, name, **kwargs): # noqa: E501 + """Delete a tag for Prompt Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_prompt_template(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_tag_for_prompt_template_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.delete_tag_for_prompt_template_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def delete_tag_for_prompt_template_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Delete a tag for Prompt Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_prompt_template_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tag_for_prompt_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `delete_tag_for_prompt_template`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_tag_for_prompt_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/prompts/{name}/tags', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_message_template(self, name, **kwargs): # noqa: E501 + """Get Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_message_template(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: MessageTemplate + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_message_template_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_message_template_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_message_template_with_http_info(self, name, **kwargs): # noqa: E501 + """Get Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_message_template_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: MessageTemplate + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_message_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_message_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/prompts/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MessageTemplate', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_message_templates(self, **kwargs): # noqa: E501 + """Get Templates # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_message_templates(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[MessageTemplate] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_message_templates_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_message_templates_with_http_info(**kwargs) # noqa: E501 + return data + + def get_message_templates_with_http_info(self, **kwargs): # noqa: E501 + """Get Templates # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_message_templates_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[MessageTemplate] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_message_templates" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/prompts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[MessageTemplate]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_tags_for_prompt_template(self, name, **kwargs): # noqa: E501 + """Get tags by Prompt Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_prompt_template(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_tags_for_prompt_template_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_for_prompt_template_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_tags_for_prompt_template_with_http_info(self, name, **kwargs): # noqa: E501 + """Get tags by Prompt Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_prompt_template_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags_for_prompt_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_tags_for_prompt_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/prompts/{name}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Tag]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_tag_for_prompt_template(self, body, name, **kwargs): # noqa: E501 + """Put a tag to Prompt Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_prompt_template(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_tag_for_prompt_template_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.put_tag_for_prompt_template_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def put_tag_for_prompt_template_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Put a tag to Prompt Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_prompt_template_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_tag_for_prompt_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_tag_for_prompt_template`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `put_tag_for_prompt_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/prompts/{name}/tags', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def save_message_template(self, body, description, name, **kwargs): # noqa: E501 + """Create or Update a template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_message_template(body, description, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param str description: (required) + :param str name: (required) + :param list[str] models: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.save_message_template_with_http_info(body, description, name, **kwargs) # noqa: E501 + else: + (data) = self.save_message_template_with_http_info(body, description, name, **kwargs) # noqa: E501 + return data + + def save_message_template_with_http_info(self, body, description, name, **kwargs): # noqa: E501 + """Create or Update a template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_message_template_with_http_info(body, description, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param str description: (required) + :param str name: (required) + :param list[str] models: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'description', 'name', 'models'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method save_message_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `save_message_template`") # noqa: E501 + # verify the required parameter 'description' is set + if ('description' not in params or + params['description'] is None): + raise ValueError("Missing the required parameter `description` when calling `save_message_template`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `save_message_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + if 'description' in params: + query_params.append(('description', params['description'])) # noqa: E501 + if 'models' in params: + query_params.append(('models', params['models'])) # noqa: E501 + collection_formats['models'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/prompts/{name}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_message_template(self, body, **kwargs): # noqa: E501 + """Test Prompt Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_message_template(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PromptTemplateTestRequest body: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_message_template_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_message_template_with_http_info(body, **kwargs) # noqa: E501 + return data + + def test_message_template_with_http_info(self, body, **kwargs): # noqa: E501 + """Test Prompt Template # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_message_template_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PromptTemplateTestRequest body: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_message_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_message_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'text/plain']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/prompts/test', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/queue_admin_resource_api.py b/src/conductor/client/codegen/api/queue_admin_resource_api.py new file mode 100644 index 00000000..165fd9e3 --- /dev/null +++ b/src/conductor/client/codegen/api/queue_admin_resource_api.py @@ -0,0 +1,191 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class QueueAdminResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def names(self, **kwargs): # noqa: E501 + """Get Queue Names # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.names(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, str) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.names_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.names_with_http_info(**kwargs) # noqa: E501 + return data + + def names_with_http_info(self, **kwargs): # noqa: E501 + """Get Queue Names # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.names_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, str) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method names" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/queue/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, str)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def size1(self, **kwargs): # noqa: E501 + """Get the queue length # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.size1(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, dict(str, int)) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.size1_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.size1_with_http_info(**kwargs) # noqa: E501 + return data + + def size1_with_http_info(self, **kwargs): # noqa: E501 + """Get the queue length # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.size1_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, dict(str, int)) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method size1" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/queue/size', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, dict(str, int))', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/scheduler_bulk_resource_api.py b/src/conductor/client/codegen/api/scheduler_bulk_resource_api.py new file mode 100644 index 00000000..276648fe --- /dev/null +++ b/src/conductor/client/codegen/api/scheduler_bulk_resource_api.py @@ -0,0 +1,215 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class SchedulerBulkResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def pause_schedules(self, body, **kwargs): # noqa: E501 + """Pause the list of schedules # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.pause_schedules(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.pause_schedules_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.pause_schedules_with_http_info(body, **kwargs) # noqa: E501 + return data + + def pause_schedules_with_http_info(self, body, **kwargs): # noqa: E501 + """Pause the list of schedules # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.pause_schedules_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method pause_schedules" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `pause_schedules`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/bulk/pause', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BulkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def resume_schedules(self, body, **kwargs): # noqa: E501 + """Resume the list of schedules # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resume_schedules(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.resume_schedules_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.resume_schedules_with_http_info(body, **kwargs) # noqa: E501 + return data + + def resume_schedules_with_http_info(self, body, **kwargs): # noqa: E501 + """Resume the list of schedules # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resume_schedules_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method resume_schedules" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `resume_schedules`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/bulk/resume', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BulkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/scheduler_resource_api.py b/src/conductor/client/codegen/api/scheduler_resource_api.py new file mode 100644 index 00000000..c19c9080 --- /dev/null +++ b/src/conductor/client/codegen/api/scheduler_resource_api.py @@ -0,0 +1,1434 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class SchedulerResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def delete_schedule(self, name, **kwargs): # noqa: E501 + """Deletes an existing workflow schedule by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_schedule(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_schedule_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.delete_schedule_with_http_info(name, **kwargs) # noqa: E501 + return data + + def delete_schedule_with_http_info(self, name, **kwargs): # noqa: E501 + """Deletes an existing workflow schedule by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_schedule_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_schedule" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_schedule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/schedules/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_tag_for_schedule(self, body, name, **kwargs): # noqa: E501 + """Delete a tag for schedule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_schedule(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_tag_for_schedule_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.delete_tag_for_schedule_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def delete_tag_for_schedule_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Delete a tag for schedule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_schedule_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tag_for_schedule" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `delete_tag_for_schedule`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_tag_for_schedule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/schedules/{name}/tags', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_all_schedules(self, **kwargs): # noqa: E501 + """Get all existing workflow schedules and optionally filter by workflow name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_schedules(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_name: + :return: list[WorkflowScheduleModel] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all_schedules_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_all_schedules_with_http_info(**kwargs) # noqa: E501 + return data + + def get_all_schedules_with_http_info(self, **kwargs): # noqa: E501 + """Get all existing workflow schedules and optionally filter by workflow name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_schedules_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_name: + :return: list[WorkflowScheduleModel] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all_schedules" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'workflow_name' in params: + query_params.append(('workflowName', params['workflow_name'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/schedules', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[WorkflowScheduleModel]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_next_few_schedules(self, cron_expression, **kwargs): # noqa: E501 + """Get list of the next x (default 3, max 5) execution times for a scheduler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_next_few_schedules(cron_expression, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str cron_expression: (required) + :param int schedule_start_time: + :param int schedule_end_time: + :param int limit: + :return: list[int] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_next_few_schedules_with_http_info(cron_expression, **kwargs) # noqa: E501 + else: + (data) = self.get_next_few_schedules_with_http_info(cron_expression, **kwargs) # noqa: E501 + return data + + def get_next_few_schedules_with_http_info(self, cron_expression, **kwargs): # noqa: E501 + """Get list of the next x (default 3, max 5) execution times for a scheduler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_next_few_schedules_with_http_info(cron_expression, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str cron_expression: (required) + :param int schedule_start_time: + :param int schedule_end_time: + :param int limit: + :return: list[int] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['cron_expression', 'schedule_start_time', 'schedule_end_time', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_next_few_schedules" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'cron_expression' is set + if ('cron_expression' not in params or + params['cron_expression'] is None): + raise ValueError("Missing the required parameter `cron_expression` when calling `get_next_few_schedules`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'cron_expression' in params: + query_params.append(('cronExpression', params['cron_expression'])) # noqa: E501 + if 'schedule_start_time' in params: + query_params.append(('scheduleStartTime', params['schedule_start_time'])) # noqa: E501 + if 'schedule_end_time' in params: + query_params.append(('scheduleEndTime', params['schedule_end_time'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/nextFewSchedules', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[int]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_schedule(self, name, **kwargs): # noqa: E501 + """Get an existing workflow schedule by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_schedule(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: WorkflowSchedule + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_schedule_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_schedule_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_schedule_with_http_info(self, name, **kwargs): # noqa: E501 + """Get an existing workflow schedule by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_schedule_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: WorkflowSchedule + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_schedule" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_schedule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/schedules/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkflowSchedule', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_schedules_by_tag(self, tag, **kwargs): # noqa: E501 + """Get schedules by tag # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_schedules_by_tag(tag, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tag: (required) + :return: list[WorkflowScheduleModel] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_schedules_by_tag_with_http_info(tag, **kwargs) # noqa: E501 + else: + (data) = self.get_schedules_by_tag_with_http_info(tag, **kwargs) # noqa: E501 + return data + + def get_schedules_by_tag_with_http_info(self, tag, **kwargs): # noqa: E501 + """Get schedules by tag # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_schedules_by_tag_with_http_info(tag, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tag: (required) + :return: list[WorkflowScheduleModel] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tag'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_schedules_by_tag" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tag' is set + if ('tag' not in params or + params['tag'] is None): + raise ValueError("Missing the required parameter `tag` when calling `get_schedules_by_tag`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'tag' in params: + query_params.append(('tag', params['tag'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/schedules/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[WorkflowScheduleModel]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_tags_for_schedule(self, name, **kwargs): # noqa: E501 + """Get tags by schedule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_schedule(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_tags_for_schedule_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_for_schedule_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_tags_for_schedule_with_http_info(self, name, **kwargs): # noqa: E501 + """Get tags by schedule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_schedule_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags_for_schedule" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_tags_for_schedule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/schedules/{name}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Tag]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def pause_all_schedules(self, **kwargs): # noqa: E501 + """Pause all scheduling in a single conductor server instance (for debugging only) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.pause_all_schedules(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.pause_all_schedules_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.pause_all_schedules_with_http_info(**kwargs) # noqa: E501 + return data + + def pause_all_schedules_with_http_info(self, **kwargs): # noqa: E501 + """Pause all scheduling in a single conductor server instance (for debugging only) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.pause_all_schedules_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method pause_all_schedules" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/admin/pause', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, object)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def pause_schedule(self, name, **kwargs): # noqa: E501 + """Pauses an existing schedule by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.pause_schedule(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.pause_schedule_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.pause_schedule_with_http_info(name, **kwargs) # noqa: E501 + return data + + def pause_schedule_with_http_info(self, name, **kwargs): # noqa: E501 + """Pauses an existing schedule by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.pause_schedule_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method pause_schedule" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `pause_schedule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/schedules/{name}/pause', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_tag_for_schedule(self, body, name, **kwargs): # noqa: E501 + """Put a tag to schedule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_schedule(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_tag_for_schedule_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.put_tag_for_schedule_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def put_tag_for_schedule_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Put a tag to schedule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_schedule_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_tag_for_schedule" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_tag_for_schedule`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `put_tag_for_schedule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/schedules/{name}/tags', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def requeue_all_execution_records(self, **kwargs): # noqa: E501 + """Requeue all execution records # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.requeue_all_execution_records(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.requeue_all_execution_records_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.requeue_all_execution_records_with_http_info(**kwargs) # noqa: E501 + return data + + def requeue_all_execution_records_with_http_info(self, **kwargs): # noqa: E501 + """Requeue all execution records # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.requeue_all_execution_records_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method requeue_all_execution_records" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/admin/requeue', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, object)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def resume_all_schedules(self, **kwargs): # noqa: E501 + """Resume all scheduling # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resume_all_schedules(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.resume_all_schedules_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.resume_all_schedules_with_http_info(**kwargs) # noqa: E501 + return data + + def resume_all_schedules_with_http_info(self, **kwargs): # noqa: E501 + """Resume all scheduling # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resume_all_schedules_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method resume_all_schedules" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/admin/resume', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, object)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def resume_schedule(self, name, **kwargs): # noqa: E501 + """Resume a paused schedule by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resume_schedule(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.resume_schedule_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.resume_schedule_with_http_info(name, **kwargs) # noqa: E501 + return data + + def resume_schedule_with_http_info(self, name, **kwargs): # noqa: E501 + """Resume a paused schedule by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resume_schedule_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method resume_schedule" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `resume_schedule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/schedules/{name}/resume', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def save_schedule(self, body, **kwargs): # noqa: E501 + """Create or update a schedule for a specified workflow with a corresponding start workflow request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_schedule(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveScheduleRequest body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.save_schedule_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.save_schedule_with_http_info(body, **kwargs) # noqa: E501 + return data + + def save_schedule_with_http_info(self, body, **kwargs): # noqa: E501 + """Create or update a schedule for a specified workflow with a corresponding start workflow request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_schedule_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveScheduleRequest body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method save_schedule" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `save_schedule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/schedules', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def search_v2(self, **kwargs): # noqa: E501 + """Search for workflows based on payload and other parameters # noqa: E501 + + use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_v2(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int start: + :param int size: + :param str sort: + :param str free_text: + :param str query: + :return: SearchResultWorkflowScheduleExecutionModel + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.search_v2_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.search_v2_with_http_info(**kwargs) # noqa: E501 + return data + + def search_v2_with_http_info(self, **kwargs): # noqa: E501 + """Search for workflows based on payload and other parameters # noqa: E501 + + use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_v2_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int start: + :param int size: + :param str sort: + :param str free_text: + :param str query: + :return: SearchResultWorkflowScheduleExecutionModel + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['start', 'size', 'sort', 'free_text', 'query'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method search_v2" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'start' in params: + query_params.append(('start', params['start'])) # noqa: E501 + if 'size' in params: + query_params.append(('size', params['size'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + if 'free_text' in params: + query_params.append(('freeText', params['free_text'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/scheduler/search/executions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SearchResultWorkflowScheduleExecutionModel', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/schema_resource_api.py b/src/conductor/client/codegen/api/schema_resource_api.py new file mode 100644 index 00000000..26119a62 --- /dev/null +++ b/src/conductor/client/codegen/api/schema_resource_api.py @@ -0,0 +1,490 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class SchemaResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def delete_schema_by_name(self, name, **kwargs): # noqa: E501 + """Delete all versions of schema by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_schema_by_name(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_schema_by_name_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.delete_schema_by_name_with_http_info(name, **kwargs) # noqa: E501 + return data + + def delete_schema_by_name_with_http_info(self, name, **kwargs): # noqa: E501 + """Delete all versions of schema by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_schema_by_name_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_schema_by_name" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_schema_by_name`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/schema/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_schema_by_name_and_version(self, name, version, **kwargs): # noqa: E501 + """Delete a version of schema by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_schema_by_name_and_version(name, version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_schema_by_name_and_version_with_http_info(name, version, **kwargs) # noqa: E501 + else: + (data) = self.delete_schema_by_name_and_version_with_http_info(name, version, **kwargs) # noqa: E501 + return data + + def delete_schema_by_name_and_version_with_http_info(self, name, version, **kwargs): # noqa: E501 + """Delete a version of schema by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_schema_by_name_and_version_with_http_info(name, version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'version'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_schema_by_name_and_version" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `delete_schema_by_name_and_version`") # noqa: E501 + # verify the required parameter 'version' is set + if ('version' not in params or + params['version'] is None): + raise ValueError("Missing the required parameter `version` when calling `delete_schema_by_name_and_version`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'version' in params: + path_params['version'] = params['version'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/schema/{name}/{version}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_all_schemas(self, **kwargs): # noqa: E501 + """Get all schemas # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_schemas(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[SchemaDef] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all_schemas_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_all_schemas_with_http_info(**kwargs) # noqa: E501 + return data + + def get_all_schemas_with_http_info(self, **kwargs): # noqa: E501 + """Get all schemas # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_schemas_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[SchemaDef] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all_schemas" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/schema', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SchemaDef]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_schema_by_name_and_version(self, name, version, **kwargs): # noqa: E501 + """Get schema by name and version # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_schema_by_name_and_version(name, version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: (required) + :return: SchemaDef + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_schema_by_name_and_version_with_http_info(name, version, **kwargs) # noqa: E501 + else: + (data) = self.get_schema_by_name_and_version_with_http_info(name, version, **kwargs) # noqa: E501 + return data + + def get_schema_by_name_and_version_with_http_info(self, name, version, **kwargs): # noqa: E501 + """Get schema by name and version # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_schema_by_name_and_version_with_http_info(name, version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: (required) + :return: SchemaDef + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'version'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_schema_by_name_and_version" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_schema_by_name_and_version`") # noqa: E501 + # verify the required parameter 'version' is set + if ('version' not in params or + params['version'] is None): + raise ValueError("Missing the required parameter `version` when calling `get_schema_by_name_and_version`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'version' in params: + path_params['version'] = params['version'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/schema/{name}/{version}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SchemaDef', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def save(self, body, **kwargs): # noqa: E501 + """Save schema # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[SchemaDef] body: (required) + :param bool new_version: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.save_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.save_with_http_info(body, **kwargs) # noqa: E501 + return data + + def save_with_http_info(self, body, **kwargs): # noqa: E501 + """Save schema # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.save_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[SchemaDef] body: (required) + :param bool new_version: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'new_version'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method save" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `save`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'new_version' in params: + query_params.append(('newVersion', params['new_version'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/schema', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/secret_resource_api.py b/src/conductor/client/codegen/api/secret_resource_api.py new file mode 100644 index 00000000..871cf3f2 --- /dev/null +++ b/src/conductor/client/codegen/api/secret_resource_api.py @@ -0,0 +1,1125 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class SecretResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def clear_local_cache(self, **kwargs): # noqa: E501 + """Clear local cache # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.clear_local_cache(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, str) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.clear_local_cache_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.clear_local_cache_with_http_info(**kwargs) # noqa: E501 + return data + + def clear_local_cache_with_http_info(self, **kwargs): # noqa: E501 + """Clear local cache # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.clear_local_cache_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, str) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method clear_local_cache" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets/clearLocalCache', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, str)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def clear_redis_cache(self, **kwargs): # noqa: E501 + """Clear redis cache # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.clear_redis_cache(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, str) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.clear_redis_cache_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.clear_redis_cache_with_http_info(**kwargs) # noqa: E501 + return data + + def clear_redis_cache_with_http_info(self, **kwargs): # noqa: E501 + """Clear redis cache # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.clear_redis_cache_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, str) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method clear_redis_cache" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets/clearRedisCache', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, str)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_secret(self, key, **kwargs): # noqa: E501 + """Delete a secret value by key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_secret(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_secret_with_http_info(key, **kwargs) # noqa: E501 + else: + (data) = self.delete_secret_with_http_info(key, **kwargs) # noqa: E501 + return data + + def delete_secret_with_http_info(self, key, **kwargs): # noqa: E501 + """Delete a secret value by key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_secret_with_http_info(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_secret" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'key' is set + if ('key' not in params or + params['key'] is None): + raise ValueError("Missing the required parameter `key` when calling `delete_secret`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'key' in params: + path_params['key'] = params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets/{key}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_tag_for_secret(self, body, key, **kwargs): # noqa: E501 + """Delete tags of the secret # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_secret(body, key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str key: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_tag_for_secret_with_http_info(body, key, **kwargs) # noqa: E501 + else: + (data) = self.delete_tag_for_secret_with_http_info(body, key, **kwargs) # noqa: E501 + return data + + def delete_tag_for_secret_with_http_info(self, body, key, **kwargs): # noqa: E501 + """Delete tags of the secret # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_secret_with_http_info(body, key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str key: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tag_for_secret" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `delete_tag_for_secret`") # noqa: E501 + # verify the required parameter 'key' is set + if ('key' not in params or + params['key'] is None): + raise ValueError("Missing the required parameter `key` when calling `delete_tag_for_secret`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'key' in params: + path_params['key'] = params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets/{key}/tags', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_secret(self, key, **kwargs): # noqa: E501 + """Get secret value by key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_secret(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_secret_with_http_info(key, **kwargs) # noqa: E501 + else: + (data) = self.get_secret_with_http_info(key, **kwargs) # noqa: E501 + return data + + def get_secret_with_http_info(self, key, **kwargs): # noqa: E501 + """Get secret value by key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_secret_with_http_info(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_secret" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'key' is set + if ('key' not in params or + params['key'] is None): + raise ValueError("Missing the required parameter `key` when calling `get_secret`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'key' in params: + path_params['key'] = params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'text/plain']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets/{key}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_tags(self, key, **kwargs): # noqa: E501 + """Get tags by secret # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_tags_with_http_info(key, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_with_http_info(key, **kwargs) # noqa: E501 + return data + + def get_tags_with_http_info(self, key, **kwargs): # noqa: E501 + """Get tags by secret # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_with_http_info(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'key' is set + if ('key' not in params or + params['key'] is None): + raise ValueError("Missing the required parameter `key` when calling `get_tags`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'key' in params: + path_params['key'] = params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets/{key}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Tag]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_all_secret_names(self, **kwargs): # noqa: E501 + """List all secret names # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_all_secret_names(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[str] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_all_secret_names_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_all_secret_names_with_http_info(**kwargs) # noqa: E501 + return data + + def list_all_secret_names_with_http_info(self, **kwargs): # noqa: E501 + """List all secret names # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_all_secret_names_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[str] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_all_secret_names" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[str]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_secrets_that_user_can_grant_access_to(self, **kwargs): # noqa: E501 + """List all secret names user can grant access to # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_secrets_that_user_can_grant_access_to(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[str] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_secrets_that_user_can_grant_access_to_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_secrets_that_user_can_grant_access_to_with_http_info(**kwargs) # noqa: E501 + return data + + def list_secrets_that_user_can_grant_access_to_with_http_info(self, **kwargs): # noqa: E501 + """List all secret names user can grant access to # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_secrets_that_user_can_grant_access_to_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[str] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_secrets_that_user_can_grant_access_to" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[str]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_secrets_with_tags_that_user_can_grant_access_to(self, **kwargs): # noqa: E501 + """List all secret names along with tags user can grant access to # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_secrets_with_tags_that_user_can_grant_access_to(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[ExtendedSecret] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_secrets_with_tags_that_user_can_grant_access_to_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_secrets_with_tags_that_user_can_grant_access_to_with_http_info(**kwargs) # noqa: E501 + return data + + def list_secrets_with_tags_that_user_can_grant_access_to_with_http_info(self, **kwargs): # noqa: E501 + """List all secret names along with tags user can grant access to # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_secrets_with_tags_that_user_can_grant_access_to_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[ExtendedSecret] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_secrets_with_tags_that_user_can_grant_access_to" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets-v2', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ExtendedSecret]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_secret(self, body, key, **kwargs): # noqa: E501 + """Put a secret value by key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_secret(body, key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param str key: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_secret_with_http_info(body, key, **kwargs) # noqa: E501 + else: + (data) = self.put_secret_with_http_info(body, key, **kwargs) # noqa: E501 + return data + + def put_secret_with_http_info(self, body, key, **kwargs): # noqa: E501 + """Put a secret value by key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_secret_with_http_info(body, key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param str key: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_secret" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_secret`") # noqa: E501 + # verify the required parameter 'key' is set + if ('key' not in params or + params['key'] is None): + raise ValueError("Missing the required parameter `key` when calling `put_secret`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'key' in params: + path_params['key'] = params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets/{key}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_tag_for_secret(self, body, key, **kwargs): # noqa: E501 + """Tag a secret # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_secret(body, key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str key: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_tag_for_secret_with_http_info(body, key, **kwargs) # noqa: E501 + else: + (data) = self.put_tag_for_secret_with_http_info(body, key, **kwargs) # noqa: E501 + return data + + def put_tag_for_secret_with_http_info(self, body, key, **kwargs): # noqa: E501 + """Tag a secret # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_secret_with_http_info(body, key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str key: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_tag_for_secret" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_tag_for_secret`") # noqa: E501 + # verify the required parameter 'key' is set + if ('key' not in params or + params['key'] is None): + raise ValueError("Missing the required parameter `key` when calling `put_tag_for_secret`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'key' in params: + path_params['key'] = params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets/{key}/tags', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def secret_exists(self, key, **kwargs): # noqa: E501 + """Check if secret exists # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.secret_exists(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.secret_exists_with_http_info(key, **kwargs) # noqa: E501 + else: + (data) = self.secret_exists_with_http_info(key, **kwargs) # noqa: E501 + return data + + def secret_exists_with_http_info(self, key, **kwargs): # noqa: E501 + """Check if secret exists # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.secret_exists_with_http_info(key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str key: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method secret_exists" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'key' is set + if ('key' not in params or + params['key'] is None): + raise ValueError("Missing the required parameter `key` when calling `secret_exists`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'key' in params: + path_params['key'] = params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/secrets/{key}/exists', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/service_registry_resource_api.py b/src/conductor/client/codegen/api/service_registry_resource_api.py new file mode 100644 index 00000000..81678523 --- /dev/null +++ b/src/conductor/client/codegen/api/service_registry_resource_api.py @@ -0,0 +1,1384 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class ServiceRegistryResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_registered_services(self, **kwargs): # noqa: E501 + """Get all registered services # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_registered_services(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[ServiceRegistry] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_registered_services_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_registered_services_with_http_info(**kwargs) # noqa: E501 + return data + + def get_registered_services_with_http_info(self, **kwargs): # noqa: E501 + """Get all registered services # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_registered_services_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[ServiceRegistry] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_registered_services" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ServiceRegistry]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def remove_service(self, name, **kwargs): # noqa: E501 + """Remove a service from the registry # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_service(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.remove_service_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.remove_service_with_http_info(name, **kwargs) # noqa: E501 + return data + + def remove_service_with_http_info(self, name, **kwargs): # noqa: E501 + """Remove a service from the registry # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_service_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_service" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `remove_service`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_service(self, name, **kwargs): # noqa: E501 + """Get a specific service by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_service(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: ServiceRegistry + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_service_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_service_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_service_with_http_info(self, name, **kwargs): # noqa: E501 + """Get a specific service by name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_service_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: ServiceRegistry + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_service" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_service`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ServiceRegistry', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def open_circuit_breaker(self, name, **kwargs): # noqa: E501 + """Open the circuit breaker for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.open_circuit_breaker(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: CircuitBreakerTransitionResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.open_circuit_breaker_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.open_circuit_breaker_with_http_info(name, **kwargs) # noqa: E501 + return data + + def open_circuit_breaker_with_http_info(self, name, **kwargs): # noqa: E501 + """Open the circuit breaker for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.open_circuit_breaker_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: CircuitBreakerTransitionResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method open_circuit_breaker" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `open_circuit_breaker`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/{name}/circuit-breaker/open', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CircuitBreakerTransitionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def close_circuit_breaker(self, name, **kwargs): # noqa: E501 + """Close the circuit breaker for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.close_circuit_breaker(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: CircuitBreakerTransitionResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.close_circuit_breaker_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.close_circuit_breaker_with_http_info(name, **kwargs) # noqa: E501 + return data + + def close_circuit_breaker_with_http_info(self, name, **kwargs): # noqa: E501 + """Close the circuit breaker for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.close_circuit_breaker_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: CircuitBreakerTransitionResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method close_circuit_breaker" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `close_circuit_breaker`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/{name}/circuit-breaker/close', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CircuitBreakerTransitionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_circuit_breaker_status(self, name, **kwargs): # noqa: E501 + """Get the circuit breaker status for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_circuit_breaker_status(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: CircuitBreakerTransitionResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_circuit_breaker_status_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_circuit_breaker_status_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_circuit_breaker_status_with_http_info(self, name, **kwargs): # noqa: E501 + """Get the circuit breaker status for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_circuit_breaker_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: CircuitBreakerTransitionResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_circuit_breaker_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError( + "Missing the required parameter `name` when calling `get_circuit_breaker_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/{name}/circuit-breaker/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CircuitBreakerTransitionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def add_or_update_service(self, body, **kwargs): # noqa: E501 + """Add or update a service registry entry # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_or_update_service(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ServiceRegistry body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_or_update_service_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.add_or_update_service_with_http_info(body, **kwargs) # noqa: E501 + return data + + def add_or_update_service_with_http_info(self, body, **kwargs): # noqa: E501 + """Add or update a service registry entry # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_or_update_service_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ServiceRegistry body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_or_update_service" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_or_update_service`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def add_or_update_method(self, registry_name, body, **kwargs): # noqa: E501 + """Add or update a service method # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_or_update_method(registry_name, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :param ServiceMethod body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_or_update_method_with_http_info(registry_name, body, **kwargs) # noqa: E501 + else: + (data) = self.add_or_update_method_with_http_info(registry_name, body, **kwargs) # noqa: E501 + return data + + def add_or_update_method_with_http_info(self, registry_name, body, **kwargs): # noqa: E501 + """Add or update a service method # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_or_update_method_with_http_info(registry_name, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :param ServiceMethod body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['registry_name', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_or_update_method" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'registry_name' is set + if ('registry_name' not in params or + params['registry_name'] is None): + raise ValueError( + "Missing the required parameter `registry_name` when calling `add_or_update_method`") # noqa: E501 + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError( + "Missing the required parameter `body` when calling `add_or_update_method`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'registry_name' in params: + path_params['registryName'] = params['registry_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/{registryName}/methods', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def remove_method(self, registry_name, service_name, method, method_type, **kwargs): # noqa: E501 + """Remove a method from a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_method(registry_name, service_name, method, method_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :param str service_name: (required) + :param str method: (required) + :param str method_type: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.remove_method_with_http_info(registry_name, service_name, method, method_type, + **kwargs) # noqa: E501 + else: + (data) = self.remove_method_with_http_info(registry_name, service_name, method, method_type, + **kwargs) # noqa: E501 + return data + + def remove_method_with_http_info(self, registry_name, service_name, method, method_type, **kwargs): # noqa: E501 + """Remove a method from a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_method_with_http_info(registry_name, service_name, method, method_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :param str service_name: (required) + :param str method: (required) + :param str method_type: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['registry_name', 'service_name', 'method', 'method_type'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_method" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'registry_name' is set + if ('registry_name' not in params or + params['registry_name'] is None): + raise ValueError( + "Missing the required parameter `registry_name` when calling `remove_method`") # noqa: E501 + # verify the required parameter 'service_name' is set + if ('service_name' not in params or + params['service_name'] is None): + raise ValueError("Missing the required parameter `service_name` when calling `remove_method`") # noqa: E501 + # verify the required parameter 'method' is set + if ('method' not in params or + params['method'] is None): + raise ValueError("Missing the required parameter `method` when calling `remove_method`") # noqa: E501 + # verify the required parameter 'method_type' is set + if ('method_type' not in params or + params['method_type'] is None): + raise ValueError("Missing the required parameter `method_type` when calling `remove_method`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'registry_name' in params: + path_params['registryName'] = params['registry_name'] # noqa: E501 + + query_params = [] + if 'service_name' in params: + query_params.append(('serviceName', params['service_name'])) # noqa: E501 + if 'method' in params: + query_params.append(('method', params['method'])) # noqa: E501 + if 'method_type' in params: + query_params.append(('methodType', params['method_type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/{registryName}/methods', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_proto_data(self, registry_name, filename, **kwargs): # noqa: E501 + """Get proto data for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_proto_data(registry_name, filename, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :param str filename: (required) + :return: bytes + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_proto_data_with_http_info(registry_name, filename, **kwargs) # noqa: E501 + else: + (data) = self.get_proto_data_with_http_info(registry_name, filename, **kwargs) # noqa: E501 + return data + + def get_proto_data_with_http_info(self, registry_name, filename, **kwargs): # noqa: E501 + """Get proto data for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_proto_data_with_http_info(registry_name, filename, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :param str filename: (required) + :return: bytes + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['registry_name', 'filename'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_proto_data" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'registry_name' is set + if ('registry_name' not in params or + params['registry_name'] is None): + raise ValueError( + "Missing the required parameter `registry_name` when calling `get_proto_data`") # noqa: E501 + # verify the required parameter 'filename' is set + if ('filename' not in params or + params['filename'] is None): + raise ValueError("Missing the required parameter `filename` when calling `get_proto_data`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'registry_name' in params: + path_params['registryName'] = params['registry_name'] # noqa: E501 + if 'filename' in params: + path_params['filename'] = params['filename'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/octet-stream']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/protos/{registryName}/{filename}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='bytes', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def set_proto_data(self, registry_name, filename, data, **kwargs): # noqa: E501 + """Set proto data for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_proto_data(registry_name, filename, data, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :param str filename: (required) + :param bytes data: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.set_proto_data_with_http_info(registry_name, filename, data, **kwargs) # noqa: E501 + else: + (data) = self.set_proto_data_with_http_info(registry_name, filename, data, **kwargs) # noqa: E501 + return data + + def set_proto_data_with_http_info(self, registry_name, filename, data, **kwargs): # noqa: E501 + """Set proto data for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_proto_data_with_http_info(registry_name, filename, data, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :param str filename: (required) + :param bytes data: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['registry_name', 'filename', 'data'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method set_proto_data" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'registry_name' is set + if ('registry_name' not in params or + params['registry_name'] is None): + raise ValueError( + "Missing the required parameter `registry_name` when calling `set_proto_data`") # noqa: E501 + # verify the required parameter 'filename' is set + if ('filename' not in params or + params['filename'] is None): + raise ValueError("Missing the required parameter `filename` when calling `set_proto_data`") # noqa: E501 + # verify the required parameter 'data' is set + if ('data' not in params or + params['data'] is None): + raise ValueError("Missing the required parameter `data` when calling `set_proto_data`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'registry_name' in params: + path_params['registryName'] = params['registry_name'] # noqa: E501 + if 'filename' in params: + path_params['filename'] = params['filename'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'data' in params: + body_params = params['data'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/octet-stream']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/protos/{registryName}/{filename}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_proto(self, registry_name, filename, **kwargs): # noqa: E501 + """Delete a proto file # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_proto(registry_name, filename, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :param str filename: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_proto_with_http_info(registry_name, filename, **kwargs) # noqa: E501 + else: + (data) = self.delete_proto_with_http_info(registry_name, filename, **kwargs) # noqa: E501 + return data + + def delete_proto_with_http_info(self, registry_name, filename, **kwargs): # noqa: E501 + """Delete a proto file # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_proto_with_http_info(registry_name, filename, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :param str filename: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['registry_name', 'filename'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_proto" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'registry_name' is set + if ('registry_name' not in params or + params['registry_name'] is None): + raise ValueError( + "Missing the required parameter `registry_name` when calling `delete_proto`") # noqa: E501 + # verify the required parameter 'filename' is set + if ('filename' not in params or + params['filename'] is None): + raise ValueError("Missing the required parameter `filename` when calling `delete_proto`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'registry_name' in params: + path_params['registryName'] = params['registry_name'] # noqa: E501 + if 'filename' in params: + path_params['filename'] = params['filename'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/protos/{registryName}/{filename}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_all_protos(self, registry_name, **kwargs): # noqa: E501 + """Get all protos for a registry # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_protos(registry_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :return: list[ProtoRegistryEntry] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all_protos_with_http_info(registry_name, **kwargs) # noqa: E501 + else: + (data) = self.get_all_protos_with_http_info(registry_name, **kwargs) # noqa: E501 + return data + + def get_all_protos_with_http_info(self, registry_name, **kwargs): # noqa: E501 + """Get all protos for a registry # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_protos_with_http_info(registry_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str registry_name: (required) + :return: list[ProtoRegistryEntry] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['registry_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all_protos" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'registry_name' is set + if ('registry_name' not in params or + params['registry_name'] is None): + raise ValueError( + "Missing the required parameter `registry_name` when calling `get_all_protos`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'registry_name' in params: + path_params['registryName'] = params['registry_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/protos/{registryName}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ProtoRegistryEntry]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def discover(self, name, **kwargs): # noqa: E501 + """Discover methods for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.discover(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param bool create: + :return: list[ServiceMethod] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.discover_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.discover_with_http_info(name, **kwargs) # noqa: E501 + return data + + def discover_with_http_info(self, name, **kwargs): # noqa: E501 + """Discover methods for a service # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.discover_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param bool create: + :return: list[ServiceMethod] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'create'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method discover" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `discover`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + if 'create' in params: + query_params.append(('create', params['create'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/registry/service/{name}/discover', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ServiceMethod]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) \ No newline at end of file diff --git a/src/conductor/client/codegen/api/task_resource_api.py b/src/conductor/client/codegen/api/task_resource_api.py new file mode 100644 index 00000000..d65313b4 --- /dev/null +++ b/src/conductor/client/codegen/api/task_resource_api.py @@ -0,0 +1,1866 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class TaskResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def all(self, **kwargs): # noqa: E501 + """Get the details about each queue # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.all(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.all_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.all_with_http_info(**kwargs) # noqa: E501 + return data + + def all_with_http_info(self, **kwargs): # noqa: E501 + """Get the details about each queue # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.all_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method all" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/queue/all', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, int)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def all_verbose(self, **kwargs): # noqa: E501 + """Get the details about each queue # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.all_verbose(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, dict(str, dict(str, int))) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.all_verbose_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.all_verbose_with_http_info(**kwargs) # noqa: E501 + return data + + def all_verbose_with_http_info(self, **kwargs): # noqa: E501 + """Get the details about each queue # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.all_verbose_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, dict(str, dict(str, int))) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method all_verbose" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/queue/all/verbose', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, dict(str, dict(str, int)))', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def batch_poll(self, tasktype, **kwargs): # noqa: E501 + """Batch poll for a task of a certain type # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.batch_poll(tasktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tasktype: (required) + :param str workerid: + :param str domain: + :param int count: + :param int timeout: + :return: list[Task] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.batch_poll_with_http_info(tasktype, **kwargs) # noqa: E501 + else: + (data) = self.batch_poll_with_http_info(tasktype, **kwargs) # noqa: E501 + return data + + def batch_poll_with_http_info(self, tasktype, **kwargs): # noqa: E501 + """Batch poll for a task of a certain type # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.batch_poll_with_http_info(tasktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tasktype: (required) + :param str workerid: + :param str domain: + :param int count: + :param int timeout: + :return: list[Task] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tasktype', 'workerid', 'domain', 'count', 'timeout'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method batch_poll" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tasktype' is set + if ('tasktype' not in params or + params['tasktype'] is None): + raise ValueError("Missing the required parameter `tasktype` when calling `batch_poll`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tasktype' in params: + path_params['tasktype'] = params['tasktype'] # noqa: E501 + + query_params = [] + if 'workerid' in params: + query_params.append(('workerid', params['workerid'])) # noqa: E501 + if 'domain' in params: + query_params.append(('domain', params['domain'])) # noqa: E501 + if 'count' in params: + query_params.append(('count', params['count'])) # noqa: E501 + if 'timeout' in params: + query_params.append(('timeout', params['timeout'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/poll/batch/{tasktype}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Task]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_all_poll_data(self, **kwargs): # noqa: E501 + """Get the last poll data for all task types # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_poll_data(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int worker_size: + :param str worker_opt: + :param int queue_size: + :param str queue_opt: + :param int last_poll_time_size: + :param str last_poll_time_opt: + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all_poll_data_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_all_poll_data_with_http_info(**kwargs) # noqa: E501 + return data + + def get_all_poll_data_with_http_info(self, **kwargs): # noqa: E501 + """Get the last poll data for all task types # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_poll_data_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int worker_size: + :param str worker_opt: + :param int queue_size: + :param str queue_opt: + :param int last_poll_time_size: + :param str last_poll_time_opt: + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['worker_size', 'worker_opt', 'queue_size', 'queue_opt', 'last_poll_time_size', 'last_poll_time_opt'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all_poll_data" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'worker_size' in params: + query_params.append(('workerSize', params['worker_size'])) # noqa: E501 + if 'worker_opt' in params: + query_params.append(('workerOpt', params['worker_opt'])) # noqa: E501 + if 'queue_size' in params: + query_params.append(('queueSize', params['queue_size'])) # noqa: E501 + if 'queue_opt' in params: + query_params.append(('queueOpt', params['queue_opt'])) # noqa: E501 + if 'last_poll_time_size' in params: + query_params.append(('lastPollTimeSize', params['last_poll_time_size'])) # noqa: E501 + if 'last_poll_time_opt' in params: + query_params.append(('lastPollTimeOpt', params['last_poll_time_opt'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/queue/polldata/all', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, object)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_poll_data(self, task_type, **kwargs): # noqa: E501 + """Get the last poll data for a given task type # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_poll_data(task_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_type: (required) + :return: list[PollData] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_poll_data_with_http_info(task_type, **kwargs) # noqa: E501 + else: + (data) = self.get_poll_data_with_http_info(task_type, **kwargs) # noqa: E501 + return data + + def get_poll_data_with_http_info(self, task_type, **kwargs): # noqa: E501 + """Get the last poll data for a given task type # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_poll_data_with_http_info(task_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_type: (required) + :return: list[PollData] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_type'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_poll_data" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_type' is set + if ('task_type' not in params or + params['task_type'] is None): + raise ValueError("Missing the required parameter `task_type` when calling `get_poll_data`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'task_type' in params: + query_params.append(('taskType', params['task_type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/queue/polldata', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[PollData]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_task(self, task_id, **kwargs): # noqa: E501 + """Get task by Id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task(task_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_id: (required) + :return: Task + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_task_with_http_info(task_id, **kwargs) # noqa: E501 + else: + (data) = self.get_task_with_http_info(task_id, **kwargs) # noqa: E501 + return data + + def get_task_with_http_info(self, task_id, **kwargs): # noqa: E501 + """Get task by Id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task_with_http_info(task_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_id: (required) + :return: Task + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_id' is set + if ('task_id' not in params or + params['task_id'] is None): + raise ValueError("Missing the required parameter `task_id` when calling `get_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_id' in params: + path_params['taskId'] = params['task_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{taskId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Task', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_task_logs(self, task_id, **kwargs): # noqa: E501 + """Get Task Execution Logs # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task_logs(task_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_id: (required) + :return: list[TaskExecLog] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_task_logs_with_http_info(task_id, **kwargs) # noqa: E501 + else: + (data) = self.get_task_logs_with_http_info(task_id, **kwargs) # noqa: E501 + return data + + def get_task_logs_with_http_info(self, task_id, **kwargs): # noqa: E501 + """Get Task Execution Logs # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task_logs_with_http_info(task_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_id: (required) + :return: list[TaskExecLog] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_task_logs" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_id' is set + if ('task_id' not in params or + params['task_id'] is None): + raise ValueError("Missing the required parameter `task_id` when calling `get_task_logs`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_id' in params: + path_params['taskId'] = params['task_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{taskId}/log', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[TaskExecLog]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def log(self, body, task_id, **kwargs): # noqa: E501 + """Log Task Execution Details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.log(body, task_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param str task_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.log_with_http_info(body, task_id, **kwargs) # noqa: E501 + else: + (data) = self.log_with_http_info(body, task_id, **kwargs) # noqa: E501 + return data + + def log_with_http_info(self, body, task_id, **kwargs): # noqa: E501 + """Log Task Execution Details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.log_with_http_info(body, task_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: (required) + :param str task_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method log" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `log`") # noqa: E501 + # verify the required parameter 'task_id' is set + if ('task_id' not in params or + params['task_id'] is None): + raise ValueError("Missing the required parameter `task_id` when calling `log`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_id' in params: + path_params['taskId'] = params['task_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{taskId}/log', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def poll(self, tasktype, **kwargs): # noqa: E501 + """Poll for a task of a certain type # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.poll(tasktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tasktype: (required) + :param str workerid: + :param str domain: + :return: Task + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.poll_with_http_info(tasktype, **kwargs) # noqa: E501 + else: + (data) = self.poll_with_http_info(tasktype, **kwargs) # noqa: E501 + return data + + def poll_with_http_info(self, tasktype, **kwargs): # noqa: E501 + """Poll for a task of a certain type # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.poll_with_http_info(tasktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tasktype: (required) + :param str workerid: + :param str domain: + :return: Task + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tasktype', 'workerid', 'domain'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method poll" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tasktype' is set + if ('tasktype' not in params or + params['tasktype'] is None): + raise ValueError("Missing the required parameter `tasktype` when calling `poll`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tasktype' in params: + path_params['tasktype'] = params['tasktype'] # noqa: E501 + + query_params = [] + if 'workerid' in params: + query_params.append(('workerid', params['workerid'])) # noqa: E501 + if 'domain' in params: + query_params.append(('domain', params['domain'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/poll/{tasktype}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Task', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def requeue_pending_task(self, task_type, **kwargs): # noqa: E501 + """Requeue pending tasks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.requeue_pending_task(task_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_type: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.requeue_pending_task_with_http_info(task_type, **kwargs) # noqa: E501 + else: + (data) = self.requeue_pending_task_with_http_info(task_type, **kwargs) # noqa: E501 + return data + + def requeue_pending_task_with_http_info(self, task_type, **kwargs): # noqa: E501 + """Requeue pending tasks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.requeue_pending_task_with_http_info(task_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_type: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_type'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method requeue_pending_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_type' is set + if ('task_type' not in params or + params['task_type'] is None): + raise ValueError("Missing the required parameter `task_type` when calling `requeue_pending_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_type' in params: + path_params['taskType'] = params['task_type'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/plain']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/queue/requeue/{taskType}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def search1(self, **kwargs): # noqa: E501 + """Search for tasks based in payload and other parameters # noqa: E501 + + use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search1(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int start: + :param int size: + :param str sort: + :param str free_text: + :param str query: + :return: SearchResultTaskSummary + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.search1_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.search1_with_http_info(**kwargs) # noqa: E501 + return data + + def search1_with_http_info(self, **kwargs): # noqa: E501 + """Search for tasks based in payload and other parameters # noqa: E501 + + use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search1_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int start: + :param int size: + :param str sort: + :param str free_text: + :param str query: + :return: SearchResultTaskSummary + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['start', 'size', 'sort', 'free_text', 'query'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method search1" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'start' in params: + query_params.append(('start', params['start'])) # noqa: E501 + if 'size' in params: + query_params.append(('size', params['size'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + if 'free_text' in params: + query_params.append(('freeText', params['free_text'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/search', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SearchResultTaskSummary', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def search_v21(self, **kwargs): # noqa: E501 + """Search for tasks based in payload and other parameters # noqa: E501 + + use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_v21(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int start: + :param int size: + :param str sort: + :param str free_text: + :param str query: + :return: SearchResultTask + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.search_v21_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.search_v21_with_http_info(**kwargs) # noqa: E501 + return data + + def search_v21_with_http_info(self, **kwargs): # noqa: E501 + """Search for tasks based in payload and other parameters # noqa: E501 + + use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_v21_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int start: + :param int size: + :param str sort: + :param str free_text: + :param str query: + :return: SearchResultTask + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['start', 'size', 'sort', 'free_text', 'query'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method search_v21" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'start' in params: + query_params.append(('start', params['start'])) # noqa: E501 + if 'size' in params: + query_params.append(('size', params['size'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + if 'free_text' in params: + query_params.append(('freeText', params['free_text'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/tasks/search-v2', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SearchResultTask', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def size(self, **kwargs): # noqa: E501 + """Get Task type queue sizes # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.size(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] task_type: + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.size_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.size_with_http_info(**kwargs) # noqa: E501 + return data + + def size_with_http_info(self, **kwargs): # noqa: E501 + """Get Task type queue sizes # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.size_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] task_type: + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_type'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method size" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'task_type' in params: + query_params.append(('taskType', params['task_type'])) # noqa: E501 + collection_formats['taskType'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/queue/sizes', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, int)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_task(self, body, **kwargs): # noqa: E501 + """Update a task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_task(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskResult body: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_task_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.update_task_with_http_info(body, **kwargs) # noqa: E501 + return data + + def update_task_with_http_info(self, body, **kwargs): # noqa: E501 + """Update a task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_task_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskResult body: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/plain']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_task1(self, body, workflow_id, task_ref_name, status, **kwargs): # noqa: E501 + """Update a task By Ref Name. The output data is merged if data from a previous API call already exists. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_task1(body, workflow_id, task_ref_name, status, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str workflow_id: (required) + :param str task_ref_name: (required) + :param str status: (required) + :param str workerid: + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_task1_with_http_info(body, workflow_id, task_ref_name, status, **kwargs) # noqa: E501 + else: + (data) = self.update_task1_with_http_info(body, workflow_id, task_ref_name, status, **kwargs) # noqa: E501 + return data + + def update_task1_with_http_info(self, body, workflow_id, task_ref_name, status, **kwargs): # noqa: E501 + """Update a task By Ref Name. The output data is merged if data from a previous API call already exists. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_task1_with_http_info(body, workflow_id, task_ref_name, status, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str workflow_id: (required) + :param str task_ref_name: (required) + :param str status: (required) + :param str workerid: + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workflow_id', 'task_ref_name', 'status', 'workerid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_task1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_task1`") # noqa: E501 + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `update_task1`") # noqa: E501 + # verify the required parameter 'task_ref_name' is set + if ('task_ref_name' not in params or + params['task_ref_name'] is None): + raise ValueError("Missing the required parameter `task_ref_name` when calling `update_task1`") # noqa: E501 + # verify the required parameter 'status' is set + if ('status' not in params or + params['status'] is None): + raise ValueError("Missing the required parameter `status` when calling `update_task1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + if 'task_ref_name' in params: + path_params['taskRefName'] = params['task_ref_name'] # noqa: E501 + if 'status' in params: + path_params['status'] = params['status'] # noqa: E501 + + query_params = [] + if 'workerid' in params: + query_params.append(('workerid', params['workerid'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/plain']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{workflowId}/{taskRefName}/{status}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_task_sync(self, body, workflow_id, task_ref_name, status, **kwargs): # noqa: E501 + """Update a task By Ref Name synchronously. The output data is merged if data from a previous API call already exists. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_task_sync(body, workflow_id, task_ref_name, status, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str workflow_id: (required) + :param str task_ref_name: (required) + :param str status: (required) + :param str workerid: + :return: Workflow + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_task_sync_with_http_info(body, workflow_id, task_ref_name, status, **kwargs) # noqa: E501 + else: + (data) = self.update_task_sync_with_http_info(body, workflow_id, task_ref_name, status, **kwargs) # noqa: E501 + return data + + def update_task_sync_with_http_info(self, body, workflow_id, task_ref_name, status, **kwargs): # noqa: E501 + """Update a task By Ref Name synchronously. The output data is merged if data from a previous API call already exists. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_task_sync_with_http_info(body, workflow_id, task_ref_name, status, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str workflow_id: (required) + :param str task_ref_name: (required) + :param str status: (required) + :param str workerid: + :return: Workflow + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workflow_id', 'task_ref_name', 'status', 'workerid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_task_sync" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_task_sync`") # noqa: E501 + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `update_task_sync`") # noqa: E501 + # verify the required parameter 'task_ref_name' is set + if ('task_ref_name' not in params or + params['task_ref_name'] is None): + raise ValueError("Missing the required parameter `task_ref_name` when calling `update_task_sync`") # noqa: E501 + # verify the required parameter 'status' is set + if ('status' not in params or + params['status'] is None): + raise ValueError("Missing the required parameter `status` when calling `update_task_sync`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + if 'task_ref_name' in params: + path_params['taskRefName'] = params['task_ref_name'] # noqa: E501 + if 'status' in params: + path_params['status'] = params['status'] # noqa: E501 + + query_params = [] + if 'workerid' in params: + query_params.append(('workerid', params['workerid'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{workflowId}/{taskRefName}/{status}/sync', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Workflow', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def signal_workflow_task_async(self, workflow_id, status, body, **kwargs): # noqa: E501 + """Update running task in the workflow with given status and output asynchronously # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.signal_workflow_task_async(workflow_id, status, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param str status: (required) + :param dict(str, object) body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.signal_workflow_task_async_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501 + else: + (data) = self.signal_workflow_task_async_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501 + return data + + def signal_workflow_task_async_with_http_info(self, workflow_id, status, body, **kwargs): # noqa: E501 + """Update running task in the workflow with given status and output asynchronously # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.signal_workflow_task_async_with_http_info(workflow_id, status, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param str status: (required) + :param dict(str, object) body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id', 'status', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method signal_workflow_task_async" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError( + "Missing the required parameter `workflow_id` when calling `signal_workflow_task_async`") # noqa: E501 + # verify the required parameter 'status' is set + if ('status' not in params or + params['status'] is None): + raise ValueError( + "Missing the required parameter `status` when calling `signal_workflow_task_async`") # noqa: E501 + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError( + "Missing the required parameter `body` when calling `signal_workflow_task_async`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + if 'status' in params: + path_params['status'] = params['status'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{workflowId}/{status}/signal', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def signal_workflow_task_sync(self, workflow_id, status, body, **kwargs): # noqa: E501 + """Update running task in the workflow with given status and output synchronously and return back updated workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.signal_workflow_task_sync(workflow_id, status, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param str status: (required) + :param dict(str, object) body: (required) + :param str return_strategy: + :return: SignalResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.signal_workflow_task_sync_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501 + else: + (data) = self.signal_workflow_task_sync_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501 + return data + + def signal_workflow_task_sync_with_http_info(self, workflow_id, status, body, **kwargs): # noqa: E501 + """Update running task in the workflow with given status and output synchronously and return back updated workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.signal_workflow_task_sync_with_http_info(workflow_id, status, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param str status: (required) + :param dict(str, object) body: (required) + :param str return_strategy: + :return: SignalResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id', 'status', 'body', 'return_strategy'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method signal_workflow_task_sync" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError( + "Missing the required parameter `workflow_id` when calling `signal_workflow_task_sync`") # noqa: E501 + # verify the required parameter 'status' is set + if ('status' not in params or + params['status'] is None): + raise ValueError( + "Missing the required parameter `status` when calling `signal_workflow_task_sync`") # noqa: E501 + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError( + "Missing the required parameter `body` when calling `signal_workflow_task_sync`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + if 'status' in params: + path_params['status'] = params['status'] # noqa: E501 + + query_params = [] + if 'return_strategy' in params and params['return_strategy'] is not None: + query_params.append(('returnStrategy', params['return_strategy'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{workflowId}/{status}/signal/sync', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SignalResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/token_resource_api.py b/src/conductor/client/codegen/api/token_resource_api.py new file mode 100644 index 00000000..33a65384 --- /dev/null +++ b/src/conductor/client/codegen/api/token_resource_api.py @@ -0,0 +1,207 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class TokenResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def generate_token(self, body, **kwargs): # noqa: E501 + """Generate JWT with the given access key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.generate_token(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GenerateTokenRequest body: (required) + :return: Response + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.generate_token_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.generate_token_with_http_info(body, **kwargs) # noqa: E501 + return data + + def generate_token_with_http_info(self, body, **kwargs): # noqa: E501 + """Generate JWT with the given access key # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.generate_token_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GenerateTokenRequest body: (required) + :return: Response + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method generate_token" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `generate_token`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/token', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Response', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_info(self, **kwargs): # noqa: E501 + """Get the user info from the token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param bool claims: + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_user_info_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_user_info_with_http_info(**kwargs) # noqa: E501 + return data + + def get_user_info_with_http_info(self, **kwargs): # noqa: E501 + """Get the user info from the token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_info_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param bool claims: + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['claims'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_info" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'claims' in params: + query_params.append(('claims', params['claims'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/token/userInfo', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/user_resource_api.py b/src/conductor/client/codegen/api/user_resource_api.py new file mode 100644 index 00000000..e4a85f9e --- /dev/null +++ b/src/conductor/client/codegen/api/user_resource_api.py @@ -0,0 +1,603 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class UserResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def check_permissions(self, user_id, type, id, **kwargs): # noqa: E501 + """Get the permissions this user has over workflows and tasks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.check_permissions(user_id, type, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: (required) + :param str type: (required) + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.check_permissions_with_http_info(user_id, type, id, **kwargs) # noqa: E501 + else: + (data) = self.check_permissions_with_http_info(user_id, type, id, **kwargs) # noqa: E501 + return data + + def check_permissions_with_http_info(self, user_id, type, id, **kwargs): # noqa: E501 + """Get the permissions this user has over workflows and tasks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.check_permissions_with_http_info(user_id, type, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: (required) + :param str type: (required) + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_id', 'type', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method check_permissions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_id' is set + if ('user_id' not in params or + params['user_id'] is None): + raise ValueError("Missing the required parameter `user_id` when calling `check_permissions`") # noqa: E501 + # verify the required parameter 'type' is set + if ('type' not in params or + params['type'] is None): + raise ValueError("Missing the required parameter `type` when calling `check_permissions`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `check_permissions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in params: + path_params['userId'] = params['user_id'] # noqa: E501 + + query_params = [] + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + if 'id' in params: + query_params.append(('id', params['id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{userId}/checkPermissions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_user(self, id, **kwargs): # noqa: E501 + """Delete a user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: Response + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_user_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.delete_user_with_http_info(id, **kwargs) # noqa: E501 + return data + + def delete_user_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete a user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: Response + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `delete_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Response', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_granted_permissions(self, user_id, **kwargs): # noqa: E501 + """Get the permissions this user has over workflows and tasks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_granted_permissions(user_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_granted_permissions_with_http_info(user_id, **kwargs) # noqa: E501 + else: + (data) = self.get_granted_permissions_with_http_info(user_id, **kwargs) # noqa: E501 + return data + + def get_granted_permissions_with_http_info(self, user_id, **kwargs): # noqa: E501 + """Get the permissions this user has over workflows and tasks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_granted_permissions_with_http_info(user_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_granted_permissions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_id' is set + if ('user_id' not in params or + params['user_id'] is None): + raise ValueError("Missing the required parameter `user_id` when calling `get_granted_permissions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in params: + path_params['userId'] = params['user_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{userId}/permissions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user(self, id, **kwargs): # noqa: E501 + """Get a user by id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_user_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_user_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_user_with_http_info(self, id, **kwargs): # noqa: E501 + """Get a user by id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_users(self, **kwargs): # noqa: E501 + """Get all users # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_users(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param bool apps: + :return: list[ConductorUser] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_users_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_users_with_http_info(**kwargs) # noqa: E501 + return data + + def list_users_with_http_info(self, **kwargs): # noqa: E501 + """Get all users # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_users_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param bool apps: + :return: list[ConductorUser] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['apps'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_users" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'apps' in params: + query_params.append(('apps', params['apps'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ConductorUser]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def upsert_user(self, body, id, **kwargs): # noqa: E501 + """Create or update a user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upsert_user(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UpsertUserRequest body: (required) + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.upsert_user_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.upsert_user_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def upsert_user_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Create or update a user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upsert_user_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UpsertUserRequest body: (required) + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method upsert_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `upsert_user`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `upsert_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/version_resource_api.py b/src/conductor/client/codegen/api/version_resource_api.py new file mode 100644 index 00000000..14b1480f --- /dev/null +++ b/src/conductor/client/codegen/api/version_resource_api.py @@ -0,0 +1,106 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class VersionResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_version(self, **kwargs): # noqa: E501 + """Get the server's version # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_version(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_version_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_version_with_http_info(**kwargs) # noqa: E501 + return data + + def get_version_with_http_info(self, **kwargs): # noqa: E501 + """Get the server's version # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_version_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_version" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/plain']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/version', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/webhooks_config_resource_api.py b/src/conductor/client/codegen/api/webhooks_config_resource_api.py new file mode 100644 index 00000000..78a64109 --- /dev/null +++ b/src/conductor/client/codegen/api/webhooks_config_resource_api.py @@ -0,0 +1,777 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class WebhooksConfigResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_webhook(self, body, **kwargs): # noqa: E501 + """create_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_webhook(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WebhookConfig body: (required) + :return: WebhookConfig + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_webhook_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_webhook_with_http_info(body, **kwargs) # noqa: E501 + return data + + def create_webhook_with_http_info(self, body, **kwargs): # noqa: E501 + """create_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_webhook_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WebhookConfig body: (required) + :return: WebhookConfig + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/webhook', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WebhookConfig', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_tag_for_webhook(self, body, **kwargs): # noqa: E501 + """Delete a tag for webhook id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_webhook(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_tag_for_webhook_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.delete_tag_for_webhook_with_http_info(body, **kwargs) # noqa: E501 + return data + + def delete_tag_for_webhook_with_http_info(self, body, **kwargs): # noqa: E501 + """Delete a tag for webhook id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_for_webhook_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tag_for_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `delete_tag_for_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/webhook/{id}/tags', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_webhook(self, id, **kwargs): # noqa: E501 + """delete_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_webhook(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_webhook_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.delete_webhook_with_http_info(id, **kwargs) # noqa: E501 + return data + + def delete_webhook_with_http_info(self, id, **kwargs): # noqa: E501 + """delete_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_webhook_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `delete_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/webhook/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_all_webhook(self, **kwargs): # noqa: E501 + """get_all_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_webhook(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[WebhookConfig] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all_webhook_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_all_webhook_with_http_info(**kwargs) # noqa: E501 + return data + + def get_all_webhook_with_http_info(self, **kwargs): # noqa: E501 + """get_all_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_webhook_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[WebhookConfig] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all_webhook" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/webhook', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[WebhookConfig]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_tags_for_webhook(self, id, **kwargs): # noqa: E501 + """Get tags by webhook id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_webhook(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_tags_for_webhook_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_for_webhook_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_tags_for_webhook_with_http_info(self, id, **kwargs): # noqa: E501 + """Get tags by webhook id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_webhook_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: list[Tag] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags_for_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_tags_for_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/webhook/{id}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Tag]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_webhook(self, id, **kwargs): # noqa: E501 + """get_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_webhook(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: WebhookConfig + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_webhook_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_webhook_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_webhook_with_http_info(self, id, **kwargs): # noqa: E501 + """get_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_webhook_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: WebhookConfig + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/webhook/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WebhookConfig', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_tag_for_webhook(self, body, id, **kwargs): # noqa: E501 + """Put a tag to webhook id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_webhook(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_tag_for_webhook_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.put_tag_for_webhook_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def put_tag_for_webhook_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Put a tag to webhook id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_tag_for_webhook_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[Tag] body: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_tag_for_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `put_tag_for_webhook`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `put_tag_for_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/webhook/{id}/tags', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_webhook(self, body, id, **kwargs): # noqa: E501 + """update_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_webhook(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WebhookConfig body: (required) + :param str id: (required) + :return: WebhookConfig + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_webhook_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.update_webhook_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def update_webhook_with_http_info(self, body, id, **kwargs): # noqa: E501 + """update_webhook # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_webhook_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WebhookConfig body: (required) + :param str id: (required) + :return: WebhookConfig + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_webhook`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `update_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/metadata/webhook/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WebhookConfig', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/workflow_bulk_resource_api.py b/src/conductor/client/codegen/api/workflow_bulk_resource_api.py new file mode 100644 index 00000000..41a1d243 --- /dev/null +++ b/src/conductor/client/codegen/api/workflow_bulk_resource_api.py @@ -0,0 +1,615 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class WorkflowBulkResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def delete(self, body, **kwargs): # noqa: E501 + """Permanently remove workflows from the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501 + return data + + def delete_with_http_info(self, body, **kwargs): # noqa: E501 + """Permanently remove workflows from the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/bulk/delete', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BulkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def pause_workflow1(self, body, **kwargs): # noqa: E501 + """Pause the list of workflows # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.pause_workflow1(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.pause_workflow1_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.pause_workflow1_with_http_info(body, **kwargs) # noqa: E501 + return data + + def pause_workflow1_with_http_info(self, body, **kwargs): # noqa: E501 + """Pause the list of workflows # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.pause_workflow1_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method pause_workflow1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `pause_workflow1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/bulk/pause', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BulkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def restart1(self, body, **kwargs): # noqa: E501 + """Restart the list of completed workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.restart1(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :param bool use_latest_definitions: + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.restart1_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.restart1_with_http_info(body, **kwargs) # noqa: E501 + return data + + def restart1_with_http_info(self, body, **kwargs): # noqa: E501 + """Restart the list of completed workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.restart1_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :param bool use_latest_definitions: + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'use_latest_definitions'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method restart1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `restart1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'use_latest_definitions' in params: + query_params.append(('useLatestDefinitions', params['use_latest_definitions'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/bulk/restart', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BulkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def resume_workflow1(self, body, **kwargs): # noqa: E501 + """Resume the list of workflows # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resume_workflow1(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.resume_workflow1_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.resume_workflow1_with_http_info(body, **kwargs) # noqa: E501 + return data + + def resume_workflow1_with_http_info(self, body, **kwargs): # noqa: E501 + """Resume the list of workflows # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resume_workflow1_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method resume_workflow1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `resume_workflow1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/bulk/resume', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BulkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def retry1(self, body, **kwargs): # noqa: E501 + """Retry the last failed task for each workflow from the list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.retry1(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.retry1_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.retry1_with_http_info(body, **kwargs) # noqa: E501 + return data + + def retry1_with_http_info(self, body, **kwargs): # noqa: E501 + """Retry the last failed task for each workflow from the list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.retry1_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method retry1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `retry1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/bulk/retry', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BulkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def terminate(self, body, **kwargs): # noqa: E501 + """Terminate workflows execution # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.terminate(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :param str reason: + :param bool trigger_failure_workflow: + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.terminate_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.terminate_with_http_info(body, **kwargs) # noqa: E501 + return data + + def terminate_with_http_info(self, body, **kwargs): # noqa: E501 + """Terminate workflows execution # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.terminate_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :param str reason: + :param bool trigger_failure_workflow: + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'reason', 'trigger_failure_workflow'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method terminate" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `terminate`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'reason' in params: + query_params.append(('reason', params['reason'])) # noqa: E501 + if 'trigger_failure_workflow' in params: + query_params.append(('triggerFailureWorkflow', params['trigger_failure_workflow'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/bulk/terminate', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BulkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api/workflow_resource_api.py b/src/conductor/client/codegen/api/workflow_resource_api.py new file mode 100644 index 00000000..b8d2a0c9 --- /dev/null +++ b/src/conductor/client/codegen/api/workflow_resource_api.py @@ -0,0 +1,3083 @@ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from conductor.client.codegen.api_client import ApiClient + + +class WorkflowResourceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def decide(self, workflow_id, **kwargs): # noqa: E501 + """Starts the decision task for a workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.decide(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.decide_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.decide_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def decide_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Starts the decision task for a workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.decide_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method decide" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `decide`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/decide/{workflowId}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete1(self, workflow_id, **kwargs): # noqa: E501 + """Removes the workflow from the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete1(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param bool archive_workflow: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete1_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.delete1_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def delete1_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Removes the workflow from the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete1_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param bool archive_workflow: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id', 'archive_workflow'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `delete1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + if 'archive_workflow' in params: + query_params.append(('archiveWorkflow', params['archive_workflow'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/remove', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def execute_workflow(self, body, request_id, name, version, **kwargs): # noqa: E501 + """Execute a workflow synchronously # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.execute_workflow(body, request_id, name, version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param StartWorkflowRequest body: (required) + :param str request_id: (required) + :param str name: (required) + :param int version: (required) + :param str wait_until_task_ref: + :param int wait_for_seconds: + :return: WorkflowRun + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.execute_workflow_with_http_info(body, request_id, name, version, **kwargs) # noqa: E501 + else: + (data) = self.execute_workflow_with_http_info(body, request_id, name, version, **kwargs) # noqa: E501 + return data + + def execute_workflow_with_http_info(self, body, request_id, name, version, **kwargs): # noqa: E501 + """Execute a workflow synchronously # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.execute_workflow_with_http_info(body, request_id, name, version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param StartWorkflowRequest body: (required) + :param str request_id: (required) + :param str name: (required) + :param int version: (required) + :param str wait_until_task_ref: + :param int wait_for_seconds: + :return: WorkflowRun + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'request_id', 'name', 'version', 'wait_until_task_ref', 'wait_for_seconds'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method execute_workflow" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `execute_workflow`") # noqa: E501 + # verify the required parameter 'request_id' is set + if ('request_id' not in params or + params['request_id'] is None): + raise ValueError("Missing the required parameter `request_id` when calling `execute_workflow`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `execute_workflow`") # noqa: E501 + # verify the required parameter 'version' is set + if ('version' not in params or + params['version'] is None): + raise ValueError("Missing the required parameter `version` when calling `execute_workflow`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'version' in params: + path_params['version'] = params['version'] # noqa: E501 + + query_params = [] + if 'request_id' in params: + query_params.append(('requestId', params['request_id'])) # noqa: E501 + if 'wait_until_task_ref' in params: + query_params.append(('waitUntilTaskRef', params['wait_until_task_ref'])) # noqa: E501 + if 'wait_for_seconds' in params: + query_params.append(('waitForSeconds', params['wait_for_seconds'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/execute/{name}/{version}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkflowRun', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def execute_workflow_as_api(self, body, name, **kwargs): # noqa: E501 + """Execute a workflow synchronously with input and outputs # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.execute_workflow_as_api(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str name: (required) + :param str request_id: + :param str wait_until_task_ref: + :param int wait_for_seconds: + :param str x_idempotency_key: + :param str x_on_conflict: + :param int version: + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.execute_workflow_as_api_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.execute_workflow_as_api_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def execute_workflow_as_api_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Execute a workflow synchronously with input and outputs # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.execute_workflow_as_api_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str name: (required) + :param str request_id: + :param str wait_until_task_ref: + :param int wait_for_seconds: + :param str x_idempotency_key: + :param str x_on_conflict: + :param int version: + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name', 'request_id', 'wait_until_task_ref', 'wait_for_seconds', 'x_idempotency_key', 'x_on_conflict', 'version'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method execute_workflow_as_api" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `execute_workflow_as_api`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `execute_workflow_as_api`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + if 'version' in params: + query_params.append(('version', params['version'])) # noqa: E501 + + header_params = {} + if 'request_id' in params: + header_params['requestId'] = params['request_id'] # noqa: E501 + if 'wait_until_task_ref' in params: + header_params['waitUntilTaskRef'] = params['wait_until_task_ref'] # noqa: E501 + if 'wait_for_seconds' in params: + header_params['waitForSeconds'] = params['wait_for_seconds'] # noqa: E501 + if 'x_idempotency_key' in params: + header_params['X-Idempotency-key'] = params['x_idempotency_key'] # noqa: E501 + if 'x_on_conflict' in params: + header_params['X-on-conflict'] = params['x_on_conflict'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/execute/{name}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, object)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def execute_workflow_as_get_api(self, name, **kwargs): # noqa: E501 + """Execute a workflow synchronously with input and outputs using get api # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.execute_workflow_as_get_api(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: + :param str request_id: + :param str wait_until_task_ref: + :param int wait_for_seconds: + :param str x_idempotency_key: + :param str x_on_conflict: + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.execute_workflow_as_get_api_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.execute_workflow_as_get_api_with_http_info(name, **kwargs) # noqa: E501 + return data + + def execute_workflow_as_get_api_with_http_info(self, name, **kwargs): # noqa: E501 + """Execute a workflow synchronously with input and outputs using get api # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.execute_workflow_as_get_api_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: + :param str request_id: + :param str wait_until_task_ref: + :param int wait_for_seconds: + :param str x_idempotency_key: + :param str x_on_conflict: + :return: dict(str, object) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'version', 'request_id', 'wait_until_task_ref', 'wait_for_seconds', 'x_idempotency_key', 'x_on_conflict'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method execute_workflow_as_get_api" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `execute_workflow_as_get_api`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + if 'version' in params: + query_params.append(('version', params['version'])) # noqa: E501 + + header_params = {} + if 'request_id' in params: + header_params['requestId'] = params['request_id'] # noqa: E501 + if 'wait_until_task_ref' in params: + header_params['waitUntilTaskRef'] = params['wait_until_task_ref'] # noqa: E501 + if 'wait_for_seconds' in params: + header_params['waitForSeconds'] = params['wait_for_seconds'] # noqa: E501 + if 'x_idempotency_key' in params: + header_params['X-Idempotency-key'] = params['x_idempotency_key'] # noqa: E501 + if 'x_on_conflict' in params: + header_params['X-on-conflict'] = params['x_on_conflict'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/execute/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, object)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_execution_status(self, workflow_id, **kwargs): # noqa: E501 + """Gets the workflow by workflow id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_execution_status(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param bool include_tasks: + :param bool summarize: + :return: Workflow + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_execution_status_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.get_execution_status_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def get_execution_status_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Gets the workflow by workflow id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_execution_status_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param bool include_tasks: + :param bool summarize: + :return: Workflow + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id', 'include_tasks', 'summarize'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_execution_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `get_execution_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + if 'include_tasks' in params: + query_params.append(('includeTasks', params['include_tasks'])) # noqa: E501 + if 'summarize' in params: + query_params.append(('summarize', params['summarize'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Workflow', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_execution_status_task_list(self, workflow_id, **kwargs): # noqa: E501 + """Gets the workflow tasks by workflow id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_execution_status_task_list(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param int start: + :param int count: + :param list[str] status: + :return: TaskListSearchResultSummary + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_execution_status_task_list_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.get_execution_status_task_list_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def get_execution_status_task_list_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Gets the workflow tasks by workflow id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_execution_status_task_list_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param int start: + :param int count: + :param list[str] status: + :return: TaskListSearchResultSummary + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id', 'start', 'count', 'status'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_execution_status_task_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `get_execution_status_task_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + if 'start' in params: + query_params.append(('start', params['start'])) # noqa: E501 + if 'count' in params: + query_params.append(('count', params['count'])) # noqa: E501 + if 'status' in params: + query_params.append(('status', params['status'])) # noqa: E501 + collection_formats['status'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/tasks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskListSearchResultSummary', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_running_workflow(self, name, **kwargs): # noqa: E501 + """Retrieve all the running workflows # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_running_workflow(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: + :param int start_time: + :param int end_time: + :return: list[str] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_running_workflow_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.get_running_workflow_with_http_info(name, **kwargs) # noqa: E501 + return data + + def get_running_workflow_with_http_info(self, name, **kwargs): # noqa: E501 + """Retrieve all the running workflows # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_running_workflow_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param int version: + :param int start_time: + :param int end_time: + :return: list[str] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'version', 'start_time', 'end_time'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_running_workflow" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_running_workflow`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + if 'version' in params: + query_params.append(('version', params['version'])) # noqa: E501 + if 'start_time' in params: + query_params.append(('startTime', params['start_time'])) # noqa: E501 + if 'end_time' in params: + query_params.append(('endTime', params['end_time'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/running/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[str]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_workflow_status_summary(self, workflow_id, **kwargs): # noqa: E501 + """Gets the workflow by workflow id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workflow_status_summary(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param bool include_output: + :param bool include_variables: + :return: WorkflowStatus + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_workflow_status_summary_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.get_workflow_status_summary_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def get_workflow_status_summary_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Gets the workflow by workflow id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workflow_status_summary_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param bool include_output: + :param bool include_variables: + :return: WorkflowStatus + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id', 'include_output', 'include_variables'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_workflow_status_summary" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `get_workflow_status_summary`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + if 'include_output' in params: + query_params.append(('includeOutput', params['include_output'])) # noqa: E501 + if 'include_variables' in params: + query_params.append(('includeVariables', params['include_variables'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkflowStatus', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_workflows(self, body, name, **kwargs): # noqa: E501 + """Lists workflows for the given correlation id list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workflows(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :param str name: (required) + :param bool include_closed: + :param bool include_tasks: + :return: dict(str, list[Workflow]) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_workflows_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.get_workflows_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def get_workflows_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Lists workflows for the given correlation id list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workflows_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] body: (required) + :param str name: (required) + :param bool include_closed: + :param bool include_tasks: + :return: dict(str, list[Workflow]) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name', 'include_closed', 'include_tasks'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_workflows" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `get_workflows`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_workflows`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + if 'include_closed' in params: + query_params.append(('includeClosed', params['include_closed'])) # noqa: E501 + if 'include_tasks' in params: + query_params.append(('includeTasks', params['include_tasks'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{name}/correlated', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, list[Workflow])', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_workflows1(self, body, **kwargs): # noqa: E501 + """Lists workflows for the given correlation id list and workflow name list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workflows1(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param CorrelationIdsSearchRequest body: (required) + :param bool include_closed: + :param bool include_tasks: + :return: dict(str, list[Workflow]) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_workflows1_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.get_workflows1_with_http_info(body, **kwargs) # noqa: E501 + return data + + def get_workflows1_with_http_info(self, body, **kwargs): # noqa: E501 + """Lists workflows for the given correlation id list and workflow name list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workflows1_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param CorrelationIdsSearchRequest body: (required) + :param bool include_closed: + :param bool include_tasks: + :return: dict(str, list[Workflow]) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'include_closed', 'include_tasks'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_workflows1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `get_workflows1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'include_closed' in params: + query_params.append(('includeClosed', params['include_closed'])) # noqa: E501 + if 'include_tasks' in params: + query_params.append(('includeTasks', params['include_tasks'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/correlated/batch', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, list[Workflow])', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_workflows2(self, name, correlation_id, **kwargs): # noqa: E501 + """Lists workflows for the given correlation id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workflows2(name, correlation_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param str correlation_id: (required) + :param bool include_closed: + :param bool include_tasks: + :return: list[Workflow] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_workflows2_with_http_info(name, correlation_id, **kwargs) # noqa: E501 + else: + (data) = self.get_workflows2_with_http_info(name, correlation_id, **kwargs) # noqa: E501 + return data + + def get_workflows2_with_http_info(self, name, correlation_id, **kwargs): # noqa: E501 + """Lists workflows for the given correlation id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workflows2_with_http_info(name, correlation_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :param str correlation_id: (required) + :param bool include_closed: + :param bool include_tasks: + :return: list[Workflow] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'correlation_id', 'include_closed', 'include_tasks'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_workflows2" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `get_workflows2`") # noqa: E501 + # verify the required parameter 'correlation_id' is set + if ('correlation_id' not in params or + params['correlation_id'] is None): + raise ValueError("Missing the required parameter `correlation_id` when calling `get_workflows2`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'correlation_id' in params: + path_params['correlationId'] = params['correlation_id'] # noqa: E501 + + query_params = [] + if 'include_closed' in params: + query_params.append(('includeClosed', params['include_closed'])) # noqa: E501 + if 'include_tasks' in params: + query_params.append(('includeTasks', params['include_tasks'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{name}/correlated/{correlationId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Workflow]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def jump_to_task(self, body, workflow_id, **kwargs): # noqa: E501 + """Jump workflow execution to given task # noqa: E501 + + Jump workflow execution to given task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.jump_to_task(body, workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str workflow_id: (required) + :param str task_reference_name: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.jump_to_task_with_http_info(body, workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.jump_to_task_with_http_info(body, workflow_id, **kwargs) # noqa: E501 + return data + + def jump_to_task_with_http_info(self, body, workflow_id, **kwargs): # noqa: E501 + """Jump workflow execution to given task # noqa: E501 + + Jump workflow execution to given task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.jump_to_task_with_http_info(body, workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str workflow_id: (required) + :param str task_reference_name: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workflow_id', 'task_reference_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method jump_to_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `jump_to_task`") # noqa: E501 + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `jump_to_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + if 'task_reference_name' in params: + query_params.append(('taskReferenceName', params['task_reference_name'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/jump/{taskReferenceName}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def pause_workflow(self, workflow_id, **kwargs): # noqa: E501 + """Pauses the workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.pause_workflow(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.pause_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.pause_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def pause_workflow_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Pauses the workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.pause_workflow_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method pause_workflow" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `pause_workflow`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/pause', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def rerun(self, body, workflow_id, **kwargs): # noqa: E501 + """Reruns the workflow from a specific task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.rerun(body, workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param RerunWorkflowRequest body: (required) + :param str workflow_id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.rerun_with_http_info(body, workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.rerun_with_http_info(body, workflow_id, **kwargs) # noqa: E501 + return data + + def rerun_with_http_info(self, body, workflow_id, **kwargs): # noqa: E501 + """Reruns the workflow from a specific task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.rerun_with_http_info(body, workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param RerunWorkflowRequest body: (required) + :param str workflow_id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workflow_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method rerun" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `rerun`") # noqa: E501 + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `rerun`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/plain']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/rerun', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def reset_workflow(self, workflow_id, **kwargs): # noqa: E501 + """Resets callback times of all non-terminal SIMPLE tasks to 0 # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.reset_workflow(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.reset_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.reset_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def reset_workflow_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Resets callback times of all non-terminal SIMPLE tasks to 0 # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.reset_workflow_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method reset_workflow" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `reset_workflow`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/resetcallbacks', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def restart(self, workflow_id, **kwargs): # noqa: E501 + """Restarts a completed workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.restart(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param bool use_latest_definitions: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.restart_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.restart_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def restart_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Restarts a completed workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.restart_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param bool use_latest_definitions: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id', 'use_latest_definitions'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method restart" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `restart`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + if 'use_latest_definitions' in params: + query_params.append(('useLatestDefinitions', params['use_latest_definitions'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/restart', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def resume_workflow(self, workflow_id, **kwargs): # noqa: E501 + """Resumes the workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resume_workflow(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.resume_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.resume_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def resume_workflow_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Resumes the workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resume_workflow_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method resume_workflow" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `resume_workflow`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/resume', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def retry(self, workflow_id, **kwargs): # noqa: E501 + """Retries the last failed task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.retry(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param bool resume_subworkflow_tasks: + :param bool retry_if_retried_by_parent: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.retry_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.retry_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def retry_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Retries the last failed task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.retry_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param bool resume_subworkflow_tasks: + :param bool retry_if_retried_by_parent: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id', 'resume_subworkflow_tasks', 'retry_if_retried_by_parent'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method retry" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `retry`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + if 'resume_subworkflow_tasks' in params: + query_params.append(('resumeSubworkflowTasks', params['resume_subworkflow_tasks'])) # noqa: E501 + if 'retry_if_retried_by_parent' in params: + query_params.append(('retryIfRetriedByParent', params['retry_if_retried_by_parent'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/retry', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def search(self, **kwargs): # noqa: E501 + """Search for workflows based on payload and other parameters # noqa: E501 + + Search for workflows based on payload and other parameters. The query parameter accepts exact matches using `=` and `IN` on the following fields: `workflowId`, `correlationId`, `taskId`, `workflowType`, `taskType`, and `status`. Matches using `=` can be written as `taskType = HTTP`. Matches using `IN` are written as `status IN (SCHEDULED, IN_PROGRESS)`. The 'startTime' and 'modifiedTime' field uses unix timestamps and accepts queries using `<` and `>`, for example `startTime < 1696143600000`. Queries can be combined using `AND`, for example `taskType = HTTP AND status = SCHEDULED`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int start: + :param int size: + :param str sort: + :param str free_text: + :param str query: + :param bool skip_cache: + :return: ScrollableSearchResultWorkflowSummary + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.search_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.search_with_http_info(**kwargs) # noqa: E501 + return data + + def search_with_http_info(self, **kwargs): # noqa: E501 + """Search for workflows based on payload and other parameters # noqa: E501 + + Search for workflows based on payload and other parameters. The query parameter accepts exact matches using `=` and `IN` on the following fields: `workflowId`, `correlationId`, `taskId`, `workflowType`, `taskType`, and `status`. Matches using `=` can be written as `taskType = HTTP`. Matches using `IN` are written as `status IN (SCHEDULED, IN_PROGRESS)`. The 'startTime' and 'modifiedTime' field uses unix timestamps and accepts queries using `<` and `>`, for example `startTime < 1696143600000`. Queries can be combined using `AND`, for example `taskType = HTTP AND status = SCHEDULED`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int start: + :param int size: + :param str sort: + :param str free_text: + :param str query: + :param bool skip_cache: + :return: ScrollableSearchResultWorkflowSummary + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['start', 'size', 'sort', 'free_text', 'query', 'skip_cache'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method search" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'start' in params: + query_params.append(('start', params['start'])) # noqa: E501 + if 'size' in params: + query_params.append(('size', params['size'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + if 'free_text' in params: + query_params.append(('freeText', params['free_text'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + if 'skip_cache' in params: + query_params.append(('skipCache', params['skip_cache'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/search', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ScrollableSearchResultWorkflowSummary', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def skip_task_from_workflow(self, body, workflow_id, task_reference_name, **kwargs): # noqa: E501 + """Skips a given task from a current running workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.skip_task_from_workflow(body, workflow_id, task_reference_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SkipTaskRequest body: (required) + :param str workflow_id: (required) + :param str task_reference_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.skip_task_from_workflow_with_http_info(body, workflow_id, task_reference_name, **kwargs) # noqa: E501 + else: + (data) = self.skip_task_from_workflow_with_http_info(body, workflow_id, task_reference_name, **kwargs) # noqa: E501 + return data + + def skip_task_from_workflow_with_http_info(self, body, workflow_id, task_reference_name, **kwargs): # noqa: E501 + """Skips a given task from a current running workflow # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.skip_task_from_workflow_with_http_info(body, workflow_id, task_reference_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SkipTaskRequest body: (required) + :param str workflow_id: (required) + :param str task_reference_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workflow_id', 'task_reference_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method skip_task_from_workflow" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `skip_task_from_workflow`") # noqa: E501 + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `skip_task_from_workflow`") # noqa: E501 + # verify the required parameter 'task_reference_name' is set + if ('task_reference_name' not in params or + params['task_reference_name'] is None): + raise ValueError("Missing the required parameter `task_reference_name` when calling `skip_task_from_workflow`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + if 'task_reference_name' in params: + path_params['taskReferenceName'] = params['task_reference_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/skiptask/{taskReferenceName}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def start_workflow(self, body, **kwargs): # noqa: E501 + """Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.start_workflow(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param StartWorkflowRequest body: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.start_workflow_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.start_workflow_with_http_info(body, **kwargs) # noqa: E501 + return data + + def start_workflow_with_http_info(self, body, **kwargs): # noqa: E501 + """Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.start_workflow_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param StartWorkflowRequest body: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method start_workflow" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `start_workflow`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/plain']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def start_workflow1(self, body, name, **kwargs): # noqa: E501 + """Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.start_workflow1(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str name: (required) + :param str x_idempotency_key: + :param str x_on_conflict: + :param int version: + :param str correlation_id: + :param int priority: + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.start_workflow1_with_http_info(body, name, **kwargs) # noqa: E501 + else: + (data) = self.start_workflow1_with_http_info(body, name, **kwargs) # noqa: E501 + return data + + def start_workflow1_with_http_info(self, body, name, **kwargs): # noqa: E501 + """Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.start_workflow1_with_http_info(body, name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str name: (required) + :param str x_idempotency_key: + :param str x_on_conflict: + :param int version: + :param str correlation_id: + :param int priority: + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name', 'x_idempotency_key', 'x_on_conflict', 'version', 'correlation_id', 'priority'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method start_workflow1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `start_workflow1`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `start_workflow1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + if 'version' in params: + query_params.append(('version', params['version'])) # noqa: E501 + if 'correlation_id' in params: + query_params.append(('correlationId', params['correlation_id'])) # noqa: E501 + if 'priority' in params: + query_params.append(('priority', params['priority'])) # noqa: E501 + + header_params = {} + if 'x_idempotency_key' in params: + header_params['X-Idempotency-key'] = params['x_idempotency_key'] # noqa: E501 + if 'x_on_conflict' in params: + header_params['X-on-conflict'] = params['x_on_conflict'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/plain']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{name}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def terminate1(self, workflow_id, **kwargs): # noqa: E501 + """Terminate workflow execution # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.terminate1(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param str reason: + :param bool trigger_failure_workflow: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.terminate1_with_http_info(workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.terminate1_with_http_info(workflow_id, **kwargs) # noqa: E501 + return data + + def terminate1_with_http_info(self, workflow_id, **kwargs): # noqa: E501 + """Terminate workflow execution # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.terminate1_with_http_info(workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_id: (required) + :param str reason: + :param bool trigger_failure_workflow: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_id', 'reason', 'trigger_failure_workflow'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method terminate1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `terminate1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + if 'reason' in params: + query_params.append(('reason', params['reason'])) # noqa: E501 + if 'trigger_failure_workflow' in params: + query_params.append(('triggerFailureWorkflow', params['trigger_failure_workflow'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_workflow(self, body, **kwargs): # noqa: E501 + """Test workflow execution using mock data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_workflow(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkflowTestRequest body: (required) + :return: Workflow + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_workflow_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_workflow_with_http_info(body, **kwargs) # noqa: E501 + return data + + def test_workflow_with_http_info(self, body, **kwargs): # noqa: E501 + """Test workflow execution using mock data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_workflow_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkflowTestRequest body: (required) + :return: Workflow + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_workflow" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_workflow`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/test', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Workflow', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_workflow_and_task_state(self, body, request_id, workflow_id, **kwargs): # noqa: E501 + """Update a workflow state by updating variables or in progress task # noqa: E501 + + Updates the workflow variables, tasks and triggers evaluation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_workflow_and_task_state(body, request_id, workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkflowStateUpdate body: (required) + :param str request_id: (required) + :param str workflow_id: (required) + :param str wait_until_task_ref: + :param int wait_for_seconds: + :return: WorkflowRun + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_workflow_and_task_state_with_http_info(body, request_id, workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.update_workflow_and_task_state_with_http_info(body, request_id, workflow_id, **kwargs) # noqa: E501 + return data + + def update_workflow_and_task_state_with_http_info(self, body, request_id, workflow_id, **kwargs): # noqa: E501 + """Update a workflow state by updating variables or in progress task # noqa: E501 + + Updates the workflow variables, tasks and triggers evaluation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_workflow_and_task_state_with_http_info(body, request_id, workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkflowStateUpdate body: (required) + :param str request_id: (required) + :param str workflow_id: (required) + :param str wait_until_task_ref: + :param int wait_for_seconds: + :return: WorkflowRun + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'request_id', 'workflow_id', 'wait_until_task_ref', 'wait_for_seconds'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_workflow_and_task_state" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_workflow_and_task_state`") # noqa: E501 + # verify the required parameter 'request_id' is set + if ('request_id' not in params or + params['request_id'] is None): + raise ValueError("Missing the required parameter `request_id` when calling `update_workflow_and_task_state`") # noqa: E501 + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `update_workflow_and_task_state`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + if 'request_id' in params: + query_params.append(('requestId', params['request_id'])) # noqa: E501 + if 'wait_until_task_ref' in params: + query_params.append(('waitUntilTaskRef', params['wait_until_task_ref'])) # noqa: E501 + if 'wait_for_seconds' in params: + query_params.append(('waitForSeconds', params['wait_for_seconds'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/state', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkflowRun', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_workflow_state(self, body, workflow_id, **kwargs): # noqa: E501 + """Update workflow variables # noqa: E501 + + Updates the workflow variables and triggers evaluation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_workflow_state(body, workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str workflow_id: (required) + :return: Workflow + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_workflow_state_with_http_info(body, workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.update_workflow_state_with_http_info(body, workflow_id, **kwargs) # noqa: E501 + return data + + def update_workflow_state_with_http_info(self, body, workflow_id, **kwargs): # noqa: E501 + """Update workflow variables # noqa: E501 + + Updates the workflow variables and triggers evaluation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_workflow_state_with_http_info(body, workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, object) body: (required) + :param str workflow_id: (required) + :return: Workflow + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workflow_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_workflow_state" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_workflow_state`") # noqa: E501 + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `update_workflow_state`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/variables', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Workflow', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def upgrade_running_workflow_to_version(self, body, workflow_id, **kwargs): # noqa: E501 + """Upgrade running workflow to newer version # noqa: E501 + + Upgrade running workflow to newer version # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upgrade_running_workflow_to_version(body, workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UpgradeWorkflowRequest body: (required) + :param str workflow_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.upgrade_running_workflow_to_version_with_http_info(body, workflow_id, **kwargs) # noqa: E501 + else: + (data) = self.upgrade_running_workflow_to_version_with_http_info(body, workflow_id, **kwargs) # noqa: E501 + return data + + def upgrade_running_workflow_to_version_with_http_info(self, body, workflow_id, **kwargs): # noqa: E501 + """Upgrade running workflow to newer version # noqa: E501 + + Upgrade running workflow to newer version # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upgrade_running_workflow_to_version_with_http_info(body, workflow_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UpgradeWorkflowRequest body: (required) + :param str workflow_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workflow_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method upgrade_running_workflow_to_version" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `upgrade_running_workflow_to_version`") # noqa: E501 + # verify the required parameter 'workflow_id' is set + if ('workflow_id' not in params or + params['workflow_id'] is None): + raise ValueError("Missing the required parameter `workflow_id` when calling `upgrade_running_workflow_to_version`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_id' in params: + path_params['workflowId'] = params['workflow_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/{workflowId}/upgrade', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def execute_workflow_with_return_strategy(self, body, name, version, **kwargs): # noqa: E501 + """Execute a workflow synchronously with reactive response # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.execute_workflow_with_return_strategy(body,name,version) + >>> result = thread.get() + :param async_req bool + :param StartWorkflowRequest body: (required) + :param str name: (required) + :param int version: (required) + :param str request_id: + :param str wait_until_task_ref: + :param int wait_for_seconds: + :param str consistency: DURABLE or EVENTUAL + :param str return_strategy: TARGET_WORKFLOW or WAIT_WORKFLOW + :return: WorkflowRun + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.execute_workflow_with_return_strategy_with_http_info(body, name, version, **kwargs) # noqa: E501 + else: + (data) = self.execute_workflow_with_return_strategy_with_http_info(body, name, version, **kwargs) # noqa: E501 + return data + + def execute_workflow_with_return_strategy_with_http_info(self, body, name, version, **kwargs): # noqa: E501 + """Execute a workflow synchronously with reactive response # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.execute_workflow_with_return_strategy_with_http_info(body, name, version, async_req=True) + >>> result = thread.get() + :param async_req bool + :param StartWorkflowRequest body: (required) + :param str name: (required) + :param int version: (required) + :param str request_id: + :param str wait_until_task_ref: + :param int wait_for_seconds: + :param str consistency: DURABLE or EVENTUAL + :param str return_strategy: TARGET_WORKFLOW or WAIT_WORKFLOW + :return: WorkflowRun + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'name', 'version', 'request_id', 'wait_until_task_ref', 'wait_for_seconds', 'consistency', + 'return_strategy', 'async_req', '_return_http_data_only', '_preload_content', + '_request_timeout'] # noqa: E501 + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method execute_workflow" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `execute_workflow`") # noqa: E501 + # verify the required parameter 'name' is set + if ('name' not in params or + params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `execute_workflow`") # noqa: E501 + # verify the required parameter 'version' is set + if ('version' not in params or + params['version'] is None): + raise ValueError("Missing the required parameter `version` when calling `execute_workflow`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + if 'version' in params: + path_params['version'] = params['version'] # noqa: E501 + + query_params = [] + if 'request_id' in params: + query_params.append(('requestId', params['request_id'])) # noqa: E501 + if 'wait_until_task_ref' in params: + query_params.append(('waitUntilTaskRef', params['wait_until_task_ref'])) # noqa: E501 + if 'wait_for_seconds' in params: + query_params.append(('waitForSeconds', params['wait_for_seconds'])) # noqa: E501 + if 'consistency' in params: + query_params.append(('consistency', params['consistency'])) # noqa: E501 + if 'return_strategy' in params: + query_params.append(('returnStrategy', params['return_strategy'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/workflow/execute/{name}/{version}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SignalResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/conductor/client/codegen/api_client.py b/src/conductor/client/codegen/api_client.py new file mode 100644 index 00000000..6b22e6df --- /dev/null +++ b/src/conductor/client/codegen/api_client.py @@ -0,0 +1,737 @@ +import datetime +import logging +import mimetypes +import os +import re +import tempfile +import time +from typing import Dict +import uuid + +import six +import urllib3 +from requests.structures import CaseInsensitiveDict +from six.moves.urllib.parse import quote + +import conductor.client.http.models as http_models +from conductor.client.configuration.configuration import Configuration +from conductor.client.codegen import rest +from conductor.client.codegen.rest import AuthorizationException +from conductor.client.codegen.thread import AwaitableThread + +logger = logging.getLogger( + Configuration.get_logging_formatted_name( + __name__ + ) +) + + +class ApiClient(object): + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(connection=configuration.http_connection) + + self.default_headers = self.__get_default_headers( + header_name, header_value + ) + + self.cookie = cookie + self.__refresh_auth_token() + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + try: + return self.__call_api_no_retry( + resource_path=resource_path, method=method, path_params=path_params, + query_params=query_params, header_params=header_params, body=body, post_params=post_params, + files=files, response_type=response_type, auth_settings=auth_settings, + _return_http_data_only=_return_http_data_only, collection_formats=collection_formats, + _preload_content=_preload_content, _request_timeout=_request_timeout + ) + except AuthorizationException as ae: + if ae.token_expired or ae.invalid_token: + token_status = "expired" if ae.token_expired else "invalid" + logger.warning( + f'authentication token is {token_status}, refreshing the token. request= {method} {resource_path}') + # if the token has expired or is invalid, lets refresh the token + self.__force_refresh_auth_token() + # and now retry the same request + return self.__call_api_no_retry( + resource_path=resource_path, method=method, path_params=path_params, + query_params=query_params, header_params=header_params, body=body, post_params=post_params, + files=files, response_type=response_type, auth_settings=auth_settings, + _return_http_data_only=_return_http_data_only, collection_formats=collection_formats, + _preload_content=_preload_content, _request_timeout=_request_timeout + ) + raise ae + + def __call_api_no_retry( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + auth_headers = None + if self.configuration.authentication_settings is not None and resource_path != '/token': + auth_headers = self.__get_authentication_headers() + self.update_params_for_auth( + header_params, + query_params, + auth_headers + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, uuid.UUID): # needed for compatibility with Python 3.7 + return str(obj) # Convert UUID to string + + if isinstance(obj, dict) or isinstance(obj, CaseInsensitiveDict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'attribute_map') and hasattr(obj, 'swagger_types'): + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + else: + try: + obj_dict = {name: getattr(obj, name) + for name in vars(obj) + if getattr(obj, name) is not None} + except TypeError: + # Fallback to string representation. + return str(obj) + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = response.resp.json() + except Exception: + data = response.resp.text + + try: + return self.__deserialize(data, response_type) + except ValueError as e: + logger.error(f'failed to deserialize data {data} into class {response_type}, reason: {e}') + return None + + def deserialize_class(self, data, klass): + return self.__deserialize(data, klass) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('set['): + sub_kls = re.match(r'set\[(.*)\]', klass).group(1) + return set(self.__deserialize(sub_data, sub_kls) + for sub_data in data) + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(http_models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass is object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + thread = AwaitableThread( + target=self.__call_api, + args=( + resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout + ) + ) + thread.start() + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + if 'header' in auth_settings: + for key, value in auth_settings['header'].items(): + headers[key] = value + if 'query' in auth_settings: + for key, value in auth_settings['query'].items(): + querys[key] = value + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + response_data = response.data + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + else: + f.write(response_data) + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + if klass is str and isinstance(data, bytes): + return self.__deserialize_bytes_to_str(data) + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_bytes_to_str(self, data): + return data.decode('utf-8') + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance + + def __get_authentication_headers(self): + if self.configuration.AUTH_TOKEN is None: + return None + + now = round(time.time() * 1000) + time_since_last_update = now - self.configuration.token_update_time + + if time_since_last_update > self.configuration.auth_token_ttl_msec: + # time to refresh the token + logger.debug('refreshing authentication token') + token = self.__get_new_token() + self.configuration.update_token(token) + + return { + 'header': { + 'X-Authorization': self.configuration.AUTH_TOKEN + } + } + + def __refresh_auth_token(self) -> None: + if self.configuration.AUTH_TOKEN is not None: + return + if self.configuration.authentication_settings is None: + return + token = self.__get_new_token() + self.configuration.update_token(token) + + def __force_refresh_auth_token(self) -> None: + """ + Forces the token refresh. Unlike the __refresh_auth_token method above + """ + if self.configuration.authentication_settings is None: + return + token = self.__get_new_token() + self.configuration.update_token(token) + + def __get_new_token(self) -> str: + try: + if self.configuration.authentication_settings.key_id is None or self.configuration.authentication_settings.key_secret is None: + logger.error('Authentication Key or Secret is not set. Failed to get the auth token') + return None + + logger.debug('Requesting new authentication token from server') + response = self.call_api( + '/token', 'POST', + header_params={ + 'Content-Type': self.select_header_content_type(['*/*']) + }, + body={ + 'keyId': self.configuration.authentication_settings.key_id, + 'keySecret': self.configuration.authentication_settings.key_secret + }, + _return_http_data_only=True, + response_type='Token' + ) + return response.token + except Exception as e: + logger.error(f'Failed to get new token, reason: {e.args}') + return None + + def __get_default_headers(self, header_name: str, header_value: object) -> Dict[str, object]: + headers = { + 'Accept-Encoding': 'gzip', + } + if header_name is not None: + headers[header_name] = header_value + parsed = urllib3.util.parse_url(self.configuration.host) + if parsed.auth is not None: + encrypted_headers = urllib3.util.make_headers( + basic_auth=parsed.auth + ) + for key, value in encrypted_headers.items(): + headers[key] = value + return headers diff --git a/src/conductor/client/codegen/models/__init__.py b/src/conductor/client/codegen/models/__init__.py new file mode 100644 index 00000000..8c5cb8b8 --- /dev/null +++ b/src/conductor/client/codegen/models/__init__.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +# flake8: noqa +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import +from optparse import Option + +# import models into model package +from conductor.client.codegen.models.action import Action +from conductor.client.codegen.models.any import Any +from conductor.client.codegen.models.authorization_request import AuthorizationRequest +from conductor.client.codegen.models.bulk_response import BulkResponse +from conductor.client.codegen.models.byte_string import ByteString +from conductor.client.codegen.models.cache_config import CacheConfig +from conductor.client.codegen.models.conductor_user import ConductorUser +from conductor.client.codegen.models.connectivity_test_input import ConnectivityTestInput +from conductor.client.codegen.models.connectivity_test_result import ConnectivityTestResult +from conductor.client.codegen.models.correlation_ids_search_request import CorrelationIdsSearchRequest +from conductor.client.codegen.models.create_or_update_application_request import CreateOrUpdateApplicationRequest +from conductor.client.codegen.models.declaration import Declaration +from conductor.client.codegen.models.declaration_or_builder import DeclarationOrBuilder +from conductor.client.codegen.models.descriptor import Descriptor +from conductor.client.codegen.models.descriptor_proto import DescriptorProto +from conductor.client.codegen.models.descriptor_proto_or_builder import DescriptorProtoOrBuilder +from conductor.client.codegen.models.edition_default import EditionDefault +from conductor.client.codegen.models.edition_default_or_builder import EditionDefaultOrBuilder +from conductor.client.codegen.models.enum_descriptor import EnumDescriptor +from conductor.client.codegen.models.enum_descriptor_proto import EnumDescriptorProto +from conductor.client.codegen.models.enum_descriptor_proto_or_builder import EnumDescriptorProtoOrBuilder +from conductor.client.codegen.models.enum_options import EnumOptions +from conductor.client.codegen.models.enum_options_or_builder import EnumOptionsOrBuilder +from conductor.client.codegen.models.enum_reserved_range import EnumReservedRange +from conductor.client.codegen.models.enum_reserved_range_or_builder import EnumReservedRangeOrBuilder +from conductor.client.codegen.models.enum_value_descriptor import EnumValueDescriptor +from conductor.client.codegen.models.enum_value_descriptor_proto import EnumValueDescriptorProto +from conductor.client.codegen.models.enum_value_descriptor_proto_or_builder import EnumValueDescriptorProtoOrBuilder +from conductor.client.codegen.models.enum_value_options import EnumValueOptions +from conductor.client.codegen.models.enum_value_options_or_builder import EnumValueOptionsOrBuilder +from conductor.client.codegen.models.environment_variable import EnvironmentVariable +from conductor.client.codegen.models.event_handler import EventHandler +from conductor.client.codegen.models.event_log import EventLog +from conductor.client.codegen.models.event_message import EventMessage +from conductor.client.codegen.models.extended_conductor_application import ExtendedConductorApplication +from conductor.client.codegen.models.extended_event_execution import ExtendedEventExecution +from conductor.client.codegen.models.extended_secret import ExtendedSecret +from conductor.client.codegen.models.extended_task_def import ExtendedTaskDef +from conductor.client.codegen.models.extended_workflow_def import ExtendedWorkflowDef +from conductor.client.codegen.models.extension_range import ExtensionRange +from conductor.client.codegen.models.extension_range_options import ExtensionRangeOptions +from conductor.client.codegen.models.extension_range_options_or_builder import ExtensionRangeOptionsOrBuilder +from conductor.client.codegen.models.extension_range_or_builder import ExtensionRangeOrBuilder +from conductor.client.codegen.models.feature_set import FeatureSet +from conductor.client.codegen.models.feature_set_or_builder import FeatureSetOrBuilder +from conductor.client.codegen.models.field_descriptor import FieldDescriptor +from conductor.client.codegen.models.field_descriptor_proto import FieldDescriptorProto +from conductor.client.codegen.models.field_descriptor_proto_or_builder import FieldDescriptorProtoOrBuilder +from conductor.client.codegen.models.field_options import FieldOptions +from conductor.client.codegen.models.field_options_or_builder import FieldOptionsOrBuilder +from conductor.client.codegen.models.file_descriptor import FileDescriptor +from conductor.client.codegen.models.file_descriptor_proto import FileDescriptorProto +from conductor.client.codegen.models.file_options import FileOptions +from conductor.client.codegen.models.file_options_or_builder import FileOptionsOrBuilder +from conductor.client.codegen.models.generate_token_request import GenerateTokenRequest +from conductor.client.codegen.models.granted_access import GrantedAccess +from conductor.client.codegen.models.granted_access_response import GrantedAccessResponse +from conductor.client.codegen.models.group import Group +from conductor.client.codegen.models.permission import Permission +from conductor.client.codegen.models.poll_data import PollData +from conductor.client.codegen.models.prompt_template import PromptTemplate +from conductor.client.codegen.models.rate_limit import RateLimit +from conductor.client.codegen.models.rerun_workflow_request import RerunWorkflowRequest +from conductor.client.codegen.models.response import Response +from conductor.client.codegen.models.role import Role +from conductor.client.codegen.models.save_schedule_request import SaveScheduleRequest +from conductor.client.codegen.models.scrollable_search_result_workflow_summary import ScrollableSearchResultWorkflowSummary +from conductor.client.codegen.models.search_result_task import SearchResultTask +from conductor.client.codegen.models.search_result_task_summary import SearchResultTaskSummary +from conductor.client.codegen.models.search_result_workflow import SearchResultWorkflow +from conductor.client.codegen.models.search_result_workflow_schedule_execution_model import \ + SearchResultWorkflowScheduleExecutionModel +from conductor.client.codegen.models.search_result_workflow_summary import SearchResultWorkflowSummary +from conductor.client.codegen.models.skip_task_request import SkipTaskRequest +from conductor.client.codegen.models.start_workflow import StartWorkflow +from conductor.client.codegen.models.start_workflow_request import StartWorkflowRequest +from conductor.client.codegen.models.sub_workflow_params import SubWorkflowParams +from conductor.client.codegen.models.subject_ref import SubjectRef +from conductor.client.codegen.models.tag_object import TagObject +from conductor.client.codegen.models.tag_string import TagString +from conductor.client.codegen.models.target_ref import TargetRef +from conductor.client.codegen.models.workflow_task import WorkflowTask +from conductor.client.codegen.models.task import Task +from conductor.client.codegen.models.task_def import TaskDef +from conductor.client.codegen.models.task_details import TaskDetails +from conductor.client.codegen.models.task_exec_log import TaskExecLog +from conductor.client.codegen.models.task_result import TaskResult +from conductor.client.codegen.models.task_summary import TaskSummary +from conductor.client.codegen.models.token import Token +from conductor.client.codegen.models.upsert_group_request import UpsertGroupRequest +from conductor.client.codegen.models.upsert_user_request import UpsertUserRequest +from conductor.client.codegen.models.workflow import Workflow +from conductor.client.codegen.models.workflow_def import WorkflowDef +from conductor.client.codegen.models.workflow_run import WorkflowRun +from conductor.client.codegen.models.workflow_schedule import WorkflowSchedule +from conductor.client.codegen.models.workflow_schedule_execution_model import WorkflowScheduleExecutionModel +from conductor.client.codegen.models.workflow_status import WorkflowStatus +from conductor.client.codegen.models.workflow_state_update import WorkflowStateUpdate +from conductor.client.codegen.models.workflow_summary import WorkflowSummary +from conductor.client.codegen.models.workflow_tag import WorkflowTag +from conductor.client.codegen.models.integration import Integration +from conductor.client.codegen.models.integration_api import IntegrationApi +from conductor.client.codegen.models.state_change_event import StateChangeEvent +from conductor.client.codegen.models.schema_def import SchemaDef +from conductor.client.codegen.models.service_registry import ServiceRegistry, OrkesCircuitBreakerConfig, Config, ServiceType +from conductor.client.codegen.models.request_param import RequestParam, Schema +from conductor.client.codegen.models.proto_registry_entry import ProtoRegistryEntry +from conductor.client.codegen.models.service_method import ServiceMethod +from conductor.client.codegen.models.circuit_breaker_transition_response import CircuitBreakerTransitionResponse +from conductor.client.codegen.models.signal_response import SignalResponse, TaskStatus +from conductor.client.codegen.models.handled_event_response import HandledEventResponse +from conductor.client.codegen.models.integration_api_update import IntegrationApiUpdate +from conductor.client.codegen.models.integration_def import IntegrationDef +from conductor.client.codegen.models.integration_def_form_field import IntegrationDefFormField +from conductor.client.codegen.models.integration_update import IntegrationUpdate +from conductor.client.codegen.models.location import Location +from conductor.client.codegen.models.location_or_builder import LocationOrBuilder +from conductor.client.codegen.models.message import Message +from conductor.client.codegen.models.message_lite import MessageLite +from conductor.client.codegen.models.message_options import MessageOptions +from conductor.client.codegen.models.message_options_or_builder import MessageOptionsOrBuilder +from conductor.client.codegen.models.message_template import MessageTemplate +from conductor.client.codegen.models.method_descriptor import MethodDescriptor +from conductor.client.codegen.models.method_descriptor_proto import MethodDescriptorProto +from conductor.client.codegen.models.method_descriptor_proto_or_builder import MethodDescriptorProtoOrBuilder +from conductor.client.codegen.models.method_options import MethodOptions +from conductor.client.codegen.models.method_options_or_builder import MethodOptionsOrBuilder +from conductor.client.codegen.models.metrics_token import MetricsToken +from conductor.client.codegen.models.name_part import NamePart +from conductor.client.codegen.models.name_part_or_builder import NamePartOrBuilder +from conductor.client.codegen.models.oneof_descriptor import OneofDescriptor +from conductor.client.codegen.models.oneof_options import OneofOptions +from conductor.client.codegen.models.oneof_options_or_builder import OneofOptionsOrBuilder +from conductor.client.codegen.models.oneof_descriptor_proto import OneofDescriptorProto +from conductor.client.codegen.models.oneof_descriptor_proto_or_builder import OneofDescriptorProtoOrBuilder +from conductor.client.codegen.models.oneof_options import OneofOptions +from conductor.client.codegen.models.oneof_options_or_builder import OneofOptionsOrBuilder +from conductor.client.codegen.models.option import Option +from conductor.client.codegen.models.prompt_template_test_request import PromptTemplateTestRequest +from conductor.client.codegen.models.task_details import TaskDetails diff --git a/src/conductor/client/codegen/models/action.py b/src/conductor/client/codegen/models/action.py new file mode 100644 index 00000000..535ef702 --- /dev/null +++ b/src/conductor/client/codegen/models/action.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Action(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'action': 'str', + 'complete_task': 'TaskDetails', + 'expand_inline_json': 'bool', + 'fail_task': 'TaskDetails', + 'start_workflow': 'StartWorkflow', + 'terminate_workflow': 'TerminateWorkflow', + 'update_workflow_variables': 'UpdateWorkflowVariables' + } + + attribute_map = { + 'action': 'action', + 'complete_task': 'complete_task', + 'expand_inline_json': 'expandInlineJSON', + 'fail_task': 'fail_task', + 'start_workflow': 'start_workflow', + 'terminate_workflow': 'terminate_workflow', + 'update_workflow_variables': 'update_workflow_variables' + } + + def __init__(self, action=None, complete_task=None, expand_inline_json=None, fail_task=None, start_workflow=None, terminate_workflow=None, update_workflow_variables=None): # noqa: E501 + """Action - a model defined in Swagger""" # noqa: E501 + self._action = None + self._complete_task = None + self._expand_inline_json = None + self._fail_task = None + self._start_workflow = None + self._terminate_workflow = None + self._update_workflow_variables = None + self.discriminator = None + if action is not None: + self.action = action + if complete_task is not None: + self.complete_task = complete_task + if expand_inline_json is not None: + self.expand_inline_json = expand_inline_json + if fail_task is not None: + self.fail_task = fail_task + if start_workflow is not None: + self.start_workflow = start_workflow + if terminate_workflow is not None: + self.terminate_workflow = terminate_workflow + if update_workflow_variables is not None: + self.update_workflow_variables = update_workflow_variables + + @property + def action(self): + """Gets the action of this Action. # noqa: E501 + + + :return: The action of this Action. # noqa: E501 + :rtype: str + """ + return self._action + + @action.setter + def action(self, action): + """Sets the action of this Action. + + + :param action: The action of this Action. # noqa: E501 + :type: str + """ + allowed_values = ["start_workflow", "complete_task", "fail_task", "terminate_workflow", "update_workflow_variables"] # noqa: E501 + if action not in allowed_values: + raise ValueError( + "Invalid value for `action` ({0}), must be one of {1}" # noqa: E501 + .format(action, allowed_values) + ) + + self._action = action + + @property + def complete_task(self): + """Gets the complete_task of this Action. # noqa: E501 + + + :return: The complete_task of this Action. # noqa: E501 + :rtype: TaskDetails + """ + return self._complete_task + + @complete_task.setter + def complete_task(self, complete_task): + """Sets the complete_task of this Action. + + + :param complete_task: The complete_task of this Action. # noqa: E501 + :type: TaskDetails + """ + + self._complete_task = complete_task + + @property + def expand_inline_json(self): + """Gets the expand_inline_json of this Action. # noqa: E501 + + + :return: The expand_inline_json of this Action. # noqa: E501 + :rtype: bool + """ + return self._expand_inline_json + + @expand_inline_json.setter + def expand_inline_json(self, expand_inline_json): + """Sets the expand_inline_json of this Action. + + + :param expand_inline_json: The expand_inline_json of this Action. # noqa: E501 + :type: bool + """ + + self._expand_inline_json = expand_inline_json + + @property + def fail_task(self): + """Gets the fail_task of this Action. # noqa: E501 + + + :return: The fail_task of this Action. # noqa: E501 + :rtype: TaskDetails + """ + return self._fail_task + + @fail_task.setter + def fail_task(self, fail_task): + """Sets the fail_task of this Action. + + + :param fail_task: The fail_task of this Action. # noqa: E501 + :type: TaskDetails + """ + + self._fail_task = fail_task + + @property + def start_workflow(self): + """Gets the start_workflow of this Action. # noqa: E501 + + + :return: The start_workflow of this Action. # noqa: E501 + :rtype: StartWorkflowRequest + """ + return self._start_workflow + + @start_workflow.setter + def start_workflow(self, start_workflow): + """Sets the start_workflow of this Action. + + + :param start_workflow: The start_workflow of this Action. # noqa: E501 + :type: StartWorkflowRequest + """ + + self._start_workflow = start_workflow + + @property + def terminate_workflow(self): + """Gets the terminate_workflow of this Action. # noqa: E501 + + + :return: The terminate_workflow of this Action. # noqa: E501 + :rtype: TerminateWorkflow + """ + return self._terminate_workflow + + @terminate_workflow.setter + def terminate_workflow(self, terminate_workflow): + """Sets the terminate_workflow of this Action. + + + :param terminate_workflow: The terminate_workflow of this Action. # noqa: E501 + :type: TerminateWorkflow + """ + + self._terminate_workflow = terminate_workflow + + @property + def update_workflow_variables(self): + """Gets the update_workflow_variables of this Action. # noqa: E501 + + + :return: The update_workflow_variables of this Action. # noqa: E501 + :rtype: UpdateWorkflowVariables + """ + return self._update_workflow_variables + + @update_workflow_variables.setter + def update_workflow_variables(self, update_workflow_variables): + """Sets the update_workflow_variables of this Action. + + + :param update_workflow_variables: The update_workflow_variables of this Action. # noqa: E501 + :type: UpdateWorkflowVariables + """ + + self._update_workflow_variables = update_workflow_variables + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Action, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Action): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/any.py b/src/conductor/client/codegen/models/any.py new file mode 100644 index 00000000..5dec56bf --- /dev/null +++ b/src/conductor/client/codegen/models/any.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Any(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Any', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserAny', + 'serialized_size': 'int', + 'type_url': 'str', + 'type_url_bytes': 'ByteString', + 'unknown_fields': 'UnknownFieldSet', + 'value': 'ByteString' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'type_url': 'typeUrl', + 'type_url_bytes': 'typeUrlBytes', + 'unknown_fields': 'unknownFields', + 'value': 'value' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, type_url=None, type_url_bytes=None, unknown_fields=None, value=None): # noqa: E501 + """Any - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._type_url = None + self._type_url_bytes = None + self._unknown_fields = None + self._value = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if type_url is not None: + self.type_url = type_url + if type_url_bytes is not None: + self.type_url_bytes = type_url_bytes + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if value is not None: + self.value = value + + @property + def all_fields(self): + """Gets the all_fields of this Any. # noqa: E501 + + + :return: The all_fields of this Any. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this Any. + + + :param all_fields: The all_fields of this Any. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this Any. # noqa: E501 + + + :return: The default_instance_for_type of this Any. # noqa: E501 + :rtype: Any + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this Any. + + + :param default_instance_for_type: The default_instance_for_type of this Any. # noqa: E501 + :type: Any + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this Any. # noqa: E501 + + + :return: The descriptor_for_type of this Any. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this Any. + + + :param descriptor_for_type: The descriptor_for_type of this Any. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this Any. # noqa: E501 + + + :return: The initialization_error_string of this Any. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this Any. + + + :param initialization_error_string: The initialization_error_string of this Any. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this Any. # noqa: E501 + + + :return: The initialized of this Any. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this Any. + + + :param initialized: The initialized of this Any. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this Any. # noqa: E501 + + + :return: The memoized_serialized_size of this Any. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this Any. + + + :param memoized_serialized_size: The memoized_serialized_size of this Any. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this Any. # noqa: E501 + + + :return: The parser_for_type of this Any. # noqa: E501 + :rtype: ParserAny + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this Any. + + + :param parser_for_type: The parser_for_type of this Any. # noqa: E501 + :type: ParserAny + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this Any. # noqa: E501 + + + :return: The serialized_size of this Any. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this Any. + + + :param serialized_size: The serialized_size of this Any. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def type_url(self): + """Gets the type_url of this Any. # noqa: E501 + + + :return: The type_url of this Any. # noqa: E501 + :rtype: str + """ + return self._type_url + + @type_url.setter + def type_url(self, type_url): + """Sets the type_url of this Any. + + + :param type_url: The type_url of this Any. # noqa: E501 + :type: str + """ + + self._type_url = type_url + + @property + def type_url_bytes(self): + """Gets the type_url_bytes of this Any. # noqa: E501 + + + :return: The type_url_bytes of this Any. # noqa: E501 + :rtype: ByteString + """ + return self._type_url_bytes + + @type_url_bytes.setter + def type_url_bytes(self, type_url_bytes): + """Sets the type_url_bytes of this Any. + + + :param type_url_bytes: The type_url_bytes of this Any. # noqa: E501 + :type: ByteString + """ + + self._type_url_bytes = type_url_bytes + + @property + def unknown_fields(self): + """Gets the unknown_fields of this Any. # noqa: E501 + + + :return: The unknown_fields of this Any. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this Any. + + + :param unknown_fields: The unknown_fields of this Any. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def value(self): + """Gets the value of this Any. # noqa: E501 + + + :return: The value of this Any. # noqa: E501 + :rtype: ByteString + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this Any. + + + :param value: The value of this Any. # noqa: E501 + :type: ByteString + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Any, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Any): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/authorization_request.py b/src/conductor/client/codegen/models/authorization_request.py new file mode 100644 index 00000000..8169c4d9 --- /dev/null +++ b/src/conductor/client/codegen/models/authorization_request.py @@ -0,0 +1,174 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthorizationRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'access': 'list[str]', + 'subject': 'SubjectRef', + 'target': 'TargetRef' + } + + attribute_map = { + 'access': 'access', + 'subject': 'subject', + 'target': 'target' + } + + def __init__(self, access=None, subject=None, target=None): # noqa: E501 + """AuthorizationRequest - a model defined in Swagger""" # noqa: E501 + self._access = None + self._subject = None + self._target = None + self.discriminator = None + self.access = access + self.subject = subject + self.target = target + + @property + def access(self): + """Gets the access of this AuthorizationRequest. # noqa: E501 + + The set of access which is granted or removed # noqa: E501 + + :return: The access of this AuthorizationRequest. # noqa: E501 + :rtype: list[str] + """ + return self._access + + @access.setter + def access(self, access): + """Sets the access of this AuthorizationRequest. + + The set of access which is granted or removed # noqa: E501 + + :param access: The access of this AuthorizationRequest. # noqa: E501 + :type: list[str] + """ + if access is None: + raise ValueError("Invalid value for `access`, must not be `None`") # noqa: E501 + allowed_values = ["CREATE", "READ", "EXECUTE", "UPDATE", "DELETE"] # noqa: E501 + if not set(access).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `access` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(access) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._access = access + + @property + def subject(self): + """Gets the subject of this AuthorizationRequest. # noqa: E501 + + + :return: The subject of this AuthorizationRequest. # noqa: E501 + :rtype: SubjectRef + """ + return self._subject + + @subject.setter + def subject(self, subject): + """Sets the subject of this AuthorizationRequest. + + + :param subject: The subject of this AuthorizationRequest. # noqa: E501 + :type: SubjectRef + """ + if subject is None: + raise ValueError("Invalid value for `subject`, must not be `None`") # noqa: E501 + + self._subject = subject + + @property + def target(self): + """Gets the target of this AuthorizationRequest. # noqa: E501 + + + :return: The target of this AuthorizationRequest. # noqa: E501 + :rtype: TargetRef + """ + return self._target + + @target.setter + def target(self, target): + """Sets the target of this AuthorizationRequest. + + + :param target: The target of this AuthorizationRequest. # noqa: E501 + :type: TargetRef + """ + if target is None: + raise ValueError("Invalid value for `target`, must not be `None`") # noqa: E501 + + self._target = target + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthorizationRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthorizationRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/bulk_response.py b/src/conductor/client/codegen/models/bulk_response.py new file mode 100644 index 00000000..2bb4ad24 --- /dev/null +++ b/src/conductor/client/codegen/models/bulk_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BulkResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bulk_error_results': 'dict(str, str)', + 'bulk_successful_results': 'list[object]' + } + + attribute_map = { + 'bulk_error_results': 'bulkErrorResults', + 'bulk_successful_results': 'bulkSuccessfulResults' + } + + def __init__(self, bulk_error_results=None, bulk_successful_results=None): # noqa: E501 + """BulkResponse - a model defined in Swagger""" # noqa: E501 + self._bulk_error_results = None + self._bulk_successful_results = None + self.discriminator = None + if bulk_error_results is not None: + self.bulk_error_results = bulk_error_results + if bulk_successful_results is not None: + self.bulk_successful_results = bulk_successful_results + + @property + def bulk_error_results(self): + """Gets the bulk_error_results of this BulkResponse. # noqa: E501 + + + :return: The bulk_error_results of this BulkResponse. # noqa: E501 + :rtype: dict(str, str) + """ + return self._bulk_error_results + + @bulk_error_results.setter + def bulk_error_results(self, bulk_error_results): + """Sets the bulk_error_results of this BulkResponse. + + + :param bulk_error_results: The bulk_error_results of this BulkResponse. # noqa: E501 + :type: dict(str, str) + """ + + self._bulk_error_results = bulk_error_results + + @property + def bulk_successful_results(self): + """Gets the bulk_successful_results of this BulkResponse. # noqa: E501 + + + :return: The bulk_successful_results of this BulkResponse. # noqa: E501 + :rtype: list[object] + """ + return self._bulk_successful_results + + @bulk_successful_results.setter + def bulk_successful_results(self, bulk_successful_results): + """Sets the bulk_successful_results of this BulkResponse. + + + :param bulk_successful_results: The bulk_successful_results of this BulkResponse. # noqa: E501 + :type: list[object] + """ + + self._bulk_successful_results = bulk_successful_results + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BulkResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BulkResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/byte_string.py b/src/conductor/client/codegen/models/byte_string.py new file mode 100644 index 00000000..22b8c424 --- /dev/null +++ b/src/conductor/client/codegen/models/byte_string.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ByteString(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'empty': 'bool', + 'valid_utf8': 'bool' + } + + attribute_map = { + 'empty': 'empty', + 'valid_utf8': 'validUtf8' + } + + def __init__(self, empty=None, valid_utf8=None): # noqa: E501 + """ByteString - a model defined in Swagger""" # noqa: E501 + self._empty = None + self._valid_utf8 = None + self.discriminator = None + if empty is not None: + self.empty = empty + if valid_utf8 is not None: + self.valid_utf8 = valid_utf8 + + @property + def empty(self): + """Gets the empty of this ByteString. # noqa: E501 + + + :return: The empty of this ByteString. # noqa: E501 + :rtype: bool + """ + return self._empty + + @empty.setter + def empty(self, empty): + """Sets the empty of this ByteString. + + + :param empty: The empty of this ByteString. # noqa: E501 + :type: bool + """ + + self._empty = empty + + @property + def valid_utf8(self): + """Gets the valid_utf8 of this ByteString. # noqa: E501 + + + :return: The valid_utf8 of this ByteString. # noqa: E501 + :rtype: bool + """ + return self._valid_utf8 + + @valid_utf8.setter + def valid_utf8(self, valid_utf8): + """Sets the valid_utf8 of this ByteString. + + + :param valid_utf8: The valid_utf8 of this ByteString. # noqa: E501 + :type: bool + """ + + self._valid_utf8 = valid_utf8 + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ByteString, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ByteString): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/cache_config.py b/src/conductor/client/codegen/models/cache_config.py new file mode 100644 index 00000000..9fa18600 --- /dev/null +++ b/src/conductor/client/codegen/models/cache_config.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CacheConfig(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'key': 'str', + 'ttl_in_second': 'int' + } + + attribute_map = { + 'key': 'key', + 'ttl_in_second': 'ttlInSecond' + } + + def __init__(self, key=None, ttl_in_second=None): # noqa: E501 + """CacheConfig - a model defined in Swagger""" # noqa: E501 + self._key = None + self._ttl_in_second = None + self.discriminator = None + if key is not None: + self.key = key + if ttl_in_second is not None: + self.ttl_in_second = ttl_in_second + + @property + def key(self): + """Gets the key of this CacheConfig. # noqa: E501 + + + :return: The key of this CacheConfig. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this CacheConfig. + + + :param key: The key of this CacheConfig. # noqa: E501 + :type: str + """ + + self._key = key + + @property + def ttl_in_second(self): + """Gets the ttl_in_second of this CacheConfig. # noqa: E501 + + + :return: The ttl_in_second of this CacheConfig. # noqa: E501 + :rtype: int + """ + return self._ttl_in_second + + @ttl_in_second.setter + def ttl_in_second(self, ttl_in_second): + """Sets the ttl_in_second of this CacheConfig. + + + :param ttl_in_second: The ttl_in_second of this CacheConfig. # noqa: E501 + :type: int + """ + + self._ttl_in_second = ttl_in_second + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CacheConfig, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CacheConfig): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/circuit_breaker_transition_response.py b/src/conductor/client/codegen/models/circuit_breaker_transition_response.py new file mode 100644 index 00000000..4ccbe44a --- /dev/null +++ b/src/conductor/client/codegen/models/circuit_breaker_transition_response.py @@ -0,0 +1,55 @@ +from dataclasses import dataclass +from typing import Optional +import six + + +@dataclass +class CircuitBreakerTransitionResponse: + """Circuit breaker transition response model.""" + + swagger_types = { + 'service': 'str', + 'previous_state': 'str', + 'current_state': 'str', + 'transition_timestamp': 'int', + 'message': 'str' + } + + attribute_map = { + 'service': 'service', + 'previous_state': 'previousState', + 'current_state': 'currentState', + 'transition_timestamp': 'transitionTimestamp', + 'message': 'message' + } + + service: Optional[str] = None + previous_state: Optional[str] = None + current_state: Optional[str] = None + transition_timestamp: Optional[int] = None + message: Optional[str] = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + return result + + def __str__(self): + return f"CircuitBreakerTransitionResponse(service='{self.service}', previous_state='{self.previous_state}', current_state='{self.current_state}', transition_timestamp={self.transition_timestamp}, message='{self.message}')" \ No newline at end of file diff --git a/src/conductor/client/codegen/models/conductor_application.py b/src/conductor/client/codegen/models/conductor_application.py new file mode 100644 index 00000000..86f4f605 --- /dev/null +++ b/src/conductor/client/codegen/models/conductor_application.py @@ -0,0 +1,228 @@ +import pprint +import re # noqa: F401 +import six + + +class ConductorApplication: + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str', + 'created_by': 'str', + 'create_time': 'int', + 'update_time': 'int', + 'updated_by': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'created_by': 'createdBy', + 'create_time': 'createTime', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy' + } + + def __init__(self, id=None, name=None, created_by=None, create_time=None, update_time=None, updated_by=None): # noqa: E501 + """ConductorApplication - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._created_by = None + self._create_time = None + self._update_time = None + self._updated_by = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + if created_by is not None: + self.created_by = created_by + if create_time is not None: + self.create_time = create_time + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + + @property + def id(self): + """Gets the id of this ConductorApplication. # noqa: E501 + + + :return: The id of this ConductorApplication. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ConductorApplication. + + + :param id: The id of this ConductorApplication. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this ConductorApplication. # noqa: E501 + + + :return: The name of this ConductorApplication. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConductorApplication. + + + :param name: The name of this ConductorApplication. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def created_by(self): + """Gets the created_by of this ConductorApplication. # noqa: E501 + + + :return: The created_by of this ConductorApplication. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this ConductorApplication. + + + :param created_by: The created_by of this ConductorApplication. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def create_time(self): + """Gets the create_time of this ConductorApplication. # noqa: E501 + + + :return: The create_time of this ConductorApplication. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this ConductorApplication. + + + :param create_time: The create_time of this ConductorApplication. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this ConductorApplication. # noqa: E501 + + + :return: The update_time of this ConductorApplication. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this ConductorApplication. + + + :param update_time: The update_time of this ConductorApplication. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this ConductorApplication. # noqa: E501 + + + :return: The updated_by of this ConductorApplication. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this ConductorApplication. + + + :param updated_by: The updated_by of this ConductorApplication. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConductorApplication, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConductorApplication): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/conductor_user.py b/src/conductor/client/codegen/models/conductor_user.py new file mode 100644 index 00000000..40712b8d --- /dev/null +++ b/src/conductor/client/codegen/models/conductor_user.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConductorUser(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'application_user': 'bool', + 'encrypted_id': 'bool', + 'encrypted_id_display_value': 'str', + 'groups': 'list[Group]', + 'id': 'str', + 'name': 'str', + 'orkes_workers_app': 'bool', + 'roles': 'list[Role]', + 'uuid': 'str' + } + + attribute_map = { + 'application_user': 'applicationUser', + 'encrypted_id': 'encryptedId', + 'encrypted_id_display_value': 'encryptedIdDisplayValue', + 'groups': 'groups', + 'id': 'id', + 'name': 'name', + 'orkes_workers_app': 'orkesWorkersApp', + 'roles': 'roles', + 'uuid': 'uuid' + } + + def __init__(self, application_user=None, encrypted_id=None, encrypted_id_display_value=None, groups=None, id=None, name=None, orkes_workers_app=None, roles=None, uuid=None): # noqa: E501 + """ConductorUser - a model defined in Swagger""" # noqa: E501 + self._application_user = None + self._encrypted_id = None + self._encrypted_id_display_value = None + self._groups = None + self._id = None + self._name = None + self._orkes_workers_app = None + self._roles = None + self._uuid = None + self.discriminator = None + if application_user is not None: + self.application_user = application_user + if encrypted_id is not None: + self.encrypted_id = encrypted_id + if encrypted_id_display_value is not None: + self.encrypted_id_display_value = encrypted_id_display_value + if groups is not None: + self.groups = groups + if id is not None: + self.id = id + if name is not None: + self.name = name + if orkes_workers_app is not None: + self.orkes_workers_app = orkes_workers_app + if roles is not None: + self.roles = roles + if uuid is not None: + self.uuid = uuid + + @property + def application_user(self): + """Gets the application_user of this ConductorUser. # noqa: E501 + + + :return: The application_user of this ConductorUser. # noqa: E501 + :rtype: bool + """ + return self._application_user + + @application_user.setter + def application_user(self, application_user): + """Sets the application_user of this ConductorUser. + + + :param application_user: The application_user of this ConductorUser. # noqa: E501 + :type: bool + """ + + self._application_user = application_user + + @property + def encrypted_id(self): + """Gets the encrypted_id of this ConductorUser. # noqa: E501 + + + :return: The encrypted_id of this ConductorUser. # noqa: E501 + :rtype: bool + """ + return self._encrypted_id + + @encrypted_id.setter + def encrypted_id(self, encrypted_id): + """Sets the encrypted_id of this ConductorUser. + + + :param encrypted_id: The encrypted_id of this ConductorUser. # noqa: E501 + :type: bool + """ + + self._encrypted_id = encrypted_id + + @property + def encrypted_id_display_value(self): + """Gets the encrypted_id_display_value of this ConductorUser. # noqa: E501 + + + :return: The encrypted_id_display_value of this ConductorUser. # noqa: E501 + :rtype: str + """ + return self._encrypted_id_display_value + + @encrypted_id_display_value.setter + def encrypted_id_display_value(self, encrypted_id_display_value): + """Sets the encrypted_id_display_value of this ConductorUser. + + + :param encrypted_id_display_value: The encrypted_id_display_value of this ConductorUser. # noqa: E501 + :type: str + """ + + self._encrypted_id_display_value = encrypted_id_display_value + + @property + def groups(self): + """Gets the groups of this ConductorUser. # noqa: E501 + + + :return: The groups of this ConductorUser. # noqa: E501 + :rtype: list[Group] + """ + return self._groups + + @groups.setter + def groups(self, groups): + """Sets the groups of this ConductorUser. + + + :param groups: The groups of this ConductorUser. # noqa: E501 + :type: list[Group] + """ + + self._groups = groups + + @property + def id(self): + """Gets the id of this ConductorUser. # noqa: E501 + + + :return: The id of this ConductorUser. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ConductorUser. + + + :param id: The id of this ConductorUser. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this ConductorUser. # noqa: E501 + + + :return: The name of this ConductorUser. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConductorUser. + + + :param name: The name of this ConductorUser. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def orkes_workers_app(self): + """Gets the orkes_workers_app of this ConductorUser. # noqa: E501 + + + :return: The orkes_workers_app of this ConductorUser. # noqa: E501 + :rtype: bool + """ + return self._orkes_workers_app + + @orkes_workers_app.setter + def orkes_workers_app(self, orkes_workers_app): + """Sets the orkes_workers_app of this ConductorUser. + + + :param orkes_workers_app: The orkes_workers_app of this ConductorUser. # noqa: E501 + :type: bool + """ + + self._orkes_workers_app = orkes_workers_app + + @property + def roles(self): + """Gets the roles of this ConductorUser. # noqa: E501 + + + :return: The roles of this ConductorUser. # noqa: E501 + :rtype: list[Role] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this ConductorUser. + + + :param roles: The roles of this ConductorUser. # noqa: E501 + :type: list[Role] + """ + + self._roles = roles + + @property + def uuid(self): + """Gets the uuid of this ConductorUser. # noqa: E501 + + + :return: The uuid of this ConductorUser. # noqa: E501 + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """Sets the uuid of this ConductorUser. + + + :param uuid: The uuid of this ConductorUser. # noqa: E501 + :type: str + """ + + self._uuid = uuid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConductorUser, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConductorUser): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/connectivity_test_input.py b/src/conductor/client/codegen/models/connectivity_test_input.py new file mode 100644 index 00000000..ec81bc0f --- /dev/null +++ b/src/conductor/client/codegen/models/connectivity_test_input.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectivityTestInput(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'input': 'dict(str, object)', + 'sink': 'str' + } + + attribute_map = { + 'input': 'input', + 'sink': 'sink' + } + + def __init__(self, input=None, sink=None): # noqa: E501 + """ConnectivityTestInput - a model defined in Swagger""" # noqa: E501 + self._input = None + self._sink = None + self.discriminator = None + if input is not None: + self.input = input + if sink is not None: + self.sink = sink + + @property + def input(self): + """Gets the input of this ConnectivityTestInput. # noqa: E501 + + + :return: The input of this ConnectivityTestInput. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input + + @input.setter + def input(self, input): + """Sets the input of this ConnectivityTestInput. + + + :param input: The input of this ConnectivityTestInput. # noqa: E501 + :type: dict(str, object) + """ + + self._input = input + + @property + def sink(self): + """Gets the sink of this ConnectivityTestInput. # noqa: E501 + + + :return: The sink of this ConnectivityTestInput. # noqa: E501 + :rtype: str + """ + return self._sink + + @sink.setter + def sink(self, sink): + """Sets the sink of this ConnectivityTestInput. + + + :param sink: The sink of this ConnectivityTestInput. # noqa: E501 + :type: str + """ + + self._sink = sink + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectivityTestInput, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectivityTestInput): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/connectivity_test_result.py b/src/conductor/client/codegen/models/connectivity_test_result.py new file mode 100644 index 00000000..fe6d7c40 --- /dev/null +++ b/src/conductor/client/codegen/models/connectivity_test_result.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectivityTestResult(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'reason': 'str', + 'successful': 'bool', + 'workflow_id': 'str' + } + + attribute_map = { + 'reason': 'reason', + 'successful': 'successful', + 'workflow_id': 'workflowId' + } + + def __init__(self, reason=None, successful=None, workflow_id=None): # noqa: E501 + """ConnectivityTestResult - a model defined in Swagger""" # noqa: E501 + self._reason = None + self._successful = None + self._workflow_id = None + self.discriminator = None + if reason is not None: + self.reason = reason + if successful is not None: + self.successful = successful + if workflow_id is not None: + self.workflow_id = workflow_id + + @property + def reason(self): + """Gets the reason of this ConnectivityTestResult. # noqa: E501 + + + :return: The reason of this ConnectivityTestResult. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this ConnectivityTestResult. + + + :param reason: The reason of this ConnectivityTestResult. # noqa: E501 + :type: str + """ + + self._reason = reason + + @property + def successful(self): + """Gets the successful of this ConnectivityTestResult. # noqa: E501 + + + :return: The successful of this ConnectivityTestResult. # noqa: E501 + :rtype: bool + """ + return self._successful + + @successful.setter + def successful(self, successful): + """Sets the successful of this ConnectivityTestResult. + + + :param successful: The successful of this ConnectivityTestResult. # noqa: E501 + :type: bool + """ + + self._successful = successful + + @property + def workflow_id(self): + """Gets the workflow_id of this ConnectivityTestResult. # noqa: E501 + + + :return: The workflow_id of this ConnectivityTestResult. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this ConnectivityTestResult. + + + :param workflow_id: The workflow_id of this ConnectivityTestResult. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectivityTestResult, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectivityTestResult): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/correlation_ids_search_request.py b/src/conductor/client/codegen/models/correlation_ids_search_request.py new file mode 100644 index 00000000..38083ac2 --- /dev/null +++ b/src/conductor/client/codegen/models/correlation_ids_search_request.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CorrelationIdsSearchRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'correlation_ids': 'list[str]', + 'workflow_names': 'list[str]' + } + + attribute_map = { + 'correlation_ids': 'correlationIds', + 'workflow_names': 'workflowNames' + } + + def __init__(self, correlation_ids=None, workflow_names=None): # noqa: E501 + """CorrelationIdsSearchRequest - a model defined in Swagger""" # noqa: E501 + self._correlation_ids = None + self._workflow_names = None + self.discriminator = None + if correlation_ids is not None: + self.correlation_ids = correlation_ids + if workflow_names is not None: + self.workflow_names = workflow_names + + @property + def correlation_ids(self): + """Gets the correlation_ids of this CorrelationIdsSearchRequest. # noqa: E501 + + + :return: The correlation_ids of this CorrelationIdsSearchRequest. # noqa: E501 + :rtype: list[str] + """ + return self._correlation_ids + + @correlation_ids.setter + def correlation_ids(self, correlation_ids): + """Sets the correlation_ids of this CorrelationIdsSearchRequest. + + + :param correlation_ids: The correlation_ids of this CorrelationIdsSearchRequest. # noqa: E501 + :type: list[str] + """ + + self._correlation_ids = correlation_ids + + @property + def workflow_names(self): + """Gets the workflow_names of this CorrelationIdsSearchRequest. # noqa: E501 + + + :return: The workflow_names of this CorrelationIdsSearchRequest. # noqa: E501 + :rtype: list[str] + """ + return self._workflow_names + + @workflow_names.setter + def workflow_names(self, workflow_names): + """Sets the workflow_names of this CorrelationIdsSearchRequest. + + + :param workflow_names: The workflow_names of this CorrelationIdsSearchRequest. # noqa: E501 + :type: list[str] + """ + + self._workflow_names = workflow_names + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CorrelationIdsSearchRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CorrelationIdsSearchRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/create_or_update_application_request.py b/src/conductor/client/codegen/models/create_or_update_application_request.py new file mode 100644 index 00000000..af209679 --- /dev/null +++ b/src/conductor/client/codegen/models/create_or_update_application_request.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CreateOrUpdateApplicationRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """CreateOrUpdateApplicationRequest - a model defined in Swagger""" # noqa: E501 + self._name = None + self.discriminator = None + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this CreateOrUpdateApplicationRequest. # noqa: E501 + + Application's name e.g.: Payment Processors # noqa: E501 + + :return: The name of this CreateOrUpdateApplicationRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CreateOrUpdateApplicationRequest. + + Application's name e.g.: Payment Processors # noqa: E501 + + :param name: The name of this CreateOrUpdateApplicationRequest. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CreateOrUpdateApplicationRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateOrUpdateApplicationRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/declaration.py b/src/conductor/client/codegen/models/declaration.py new file mode 100644 index 00000000..409aa527 --- /dev/null +++ b/src/conductor/client/codegen/models/declaration.py @@ -0,0 +1,500 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Declaration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Declaration', + 'descriptor_for_type': 'Descriptor', + 'full_name': 'str', + 'full_name_bytes': 'ByteString', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'number': 'int', + 'parser_for_type': 'ParserDeclaration', + 'repeated': 'bool', + 'reserved': 'bool', + 'serialized_size': 'int', + 'type': 'str', + 'type_bytes': 'ByteString', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'full_name': 'fullName', + 'full_name_bytes': 'fullNameBytes', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'number': 'number', + 'parser_for_type': 'parserForType', + 'repeated': 'repeated', + 'reserved': 'reserved', + 'serialized_size': 'serializedSize', + 'type': 'type', + 'type_bytes': 'typeBytes', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, full_name=None, full_name_bytes=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, number=None, parser_for_type=None, repeated=None, reserved=None, serialized_size=None, type=None, type_bytes=None, unknown_fields=None): # noqa: E501 + """Declaration - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._full_name = None + self._full_name_bytes = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._number = None + self._parser_for_type = None + self._repeated = None + self._reserved = None + self._serialized_size = None + self._type = None + self._type_bytes = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if full_name is not None: + self.full_name = full_name + if full_name_bytes is not None: + self.full_name_bytes = full_name_bytes + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if number is not None: + self.number = number + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if repeated is not None: + self.repeated = repeated + if reserved is not None: + self.reserved = reserved + if serialized_size is not None: + self.serialized_size = serialized_size + if type is not None: + self.type = type + if type_bytes is not None: + self.type_bytes = type_bytes + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this Declaration. # noqa: E501 + + + :return: The all_fields of this Declaration. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this Declaration. + + + :param all_fields: The all_fields of this Declaration. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this Declaration. # noqa: E501 + + + :return: The default_instance_for_type of this Declaration. # noqa: E501 + :rtype: Declaration + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this Declaration. + + + :param default_instance_for_type: The default_instance_for_type of this Declaration. # noqa: E501 + :type: Declaration + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this Declaration. # noqa: E501 + + + :return: The descriptor_for_type of this Declaration. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this Declaration. + + + :param descriptor_for_type: The descriptor_for_type of this Declaration. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def full_name(self): + """Gets the full_name of this Declaration. # noqa: E501 + + + :return: The full_name of this Declaration. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this Declaration. + + + :param full_name: The full_name of this Declaration. # noqa: E501 + :type: str + """ + + self._full_name = full_name + + @property + def full_name_bytes(self): + """Gets the full_name_bytes of this Declaration. # noqa: E501 + + + :return: The full_name_bytes of this Declaration. # noqa: E501 + :rtype: ByteString + """ + return self._full_name_bytes + + @full_name_bytes.setter + def full_name_bytes(self, full_name_bytes): + """Sets the full_name_bytes of this Declaration. + + + :param full_name_bytes: The full_name_bytes of this Declaration. # noqa: E501 + :type: ByteString + """ + + self._full_name_bytes = full_name_bytes + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this Declaration. # noqa: E501 + + + :return: The initialization_error_string of this Declaration. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this Declaration. + + + :param initialization_error_string: The initialization_error_string of this Declaration. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this Declaration. # noqa: E501 + + + :return: The initialized of this Declaration. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this Declaration. + + + :param initialized: The initialized of this Declaration. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this Declaration. # noqa: E501 + + + :return: The memoized_serialized_size of this Declaration. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this Declaration. + + + :param memoized_serialized_size: The memoized_serialized_size of this Declaration. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def number(self): + """Gets the number of this Declaration. # noqa: E501 + + + :return: The number of this Declaration. # noqa: E501 + :rtype: int + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this Declaration. + + + :param number: The number of this Declaration. # noqa: E501 + :type: int + """ + + self._number = number + + @property + def parser_for_type(self): + """Gets the parser_for_type of this Declaration. # noqa: E501 + + + :return: The parser_for_type of this Declaration. # noqa: E501 + :rtype: ParserDeclaration + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this Declaration. + + + :param parser_for_type: The parser_for_type of this Declaration. # noqa: E501 + :type: ParserDeclaration + """ + + self._parser_for_type = parser_for_type + + @property + def repeated(self): + """Gets the repeated of this Declaration. # noqa: E501 + + + :return: The repeated of this Declaration. # noqa: E501 + :rtype: bool + """ + return self._repeated + + @repeated.setter + def repeated(self, repeated): + """Sets the repeated of this Declaration. + + + :param repeated: The repeated of this Declaration. # noqa: E501 + :type: bool + """ + + self._repeated = repeated + + @property + def reserved(self): + """Gets the reserved of this Declaration. # noqa: E501 + + + :return: The reserved of this Declaration. # noqa: E501 + :rtype: bool + """ + return self._reserved + + @reserved.setter + def reserved(self, reserved): + """Sets the reserved of this Declaration. + + + :param reserved: The reserved of this Declaration. # noqa: E501 + :type: bool + """ + + self._reserved = reserved + + @property + def serialized_size(self): + """Gets the serialized_size of this Declaration. # noqa: E501 + + + :return: The serialized_size of this Declaration. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this Declaration. + + + :param serialized_size: The serialized_size of this Declaration. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def type(self): + """Gets the type of this Declaration. # noqa: E501 + + + :return: The type of this Declaration. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Declaration. + + + :param type: The type of this Declaration. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def type_bytes(self): + """Gets the type_bytes of this Declaration. # noqa: E501 + + + :return: The type_bytes of this Declaration. # noqa: E501 + :rtype: ByteString + """ + return self._type_bytes + + @type_bytes.setter + def type_bytes(self, type_bytes): + """Sets the type_bytes of this Declaration. + + + :param type_bytes: The type_bytes of this Declaration. # noqa: E501 + :type: ByteString + """ + + self._type_bytes = type_bytes + + @property + def unknown_fields(self): + """Gets the unknown_fields of this Declaration. # noqa: E501 + + + :return: The unknown_fields of this Declaration. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this Declaration. + + + :param unknown_fields: The unknown_fields of this Declaration. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Declaration, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Declaration): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/declaration_or_builder.py b/src/conductor/client/codegen/models/declaration_or_builder.py new file mode 100644 index 00000000..d2650fa7 --- /dev/null +++ b/src/conductor/client/codegen/models/declaration_or_builder.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DeclarationOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'full_name': 'str', + 'full_name_bytes': 'ByteString', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'number': 'int', + 'repeated': 'bool', + 'reserved': 'bool', + 'type': 'str', + 'type_bytes': 'ByteString', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'full_name': 'fullName', + 'full_name_bytes': 'fullNameBytes', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'number': 'number', + 'repeated': 'repeated', + 'reserved': 'reserved', + 'type': 'type', + 'type_bytes': 'typeBytes', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, full_name=None, full_name_bytes=None, initialization_error_string=None, initialized=None, number=None, repeated=None, reserved=None, type=None, type_bytes=None, unknown_fields=None): # noqa: E501 + """DeclarationOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._full_name = None + self._full_name_bytes = None + self._initialization_error_string = None + self._initialized = None + self._number = None + self._repeated = None + self._reserved = None + self._type = None + self._type_bytes = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if full_name is not None: + self.full_name = full_name + if full_name_bytes is not None: + self.full_name_bytes = full_name_bytes + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if number is not None: + self.number = number + if repeated is not None: + self.repeated = repeated + if reserved is not None: + self.reserved = reserved + if type is not None: + self.type = type + if type_bytes is not None: + self.type_bytes = type_bytes + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this DeclarationOrBuilder. # noqa: E501 + + + :return: The all_fields of this DeclarationOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this DeclarationOrBuilder. + + + :param all_fields: The all_fields of this DeclarationOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this DeclarationOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this DeclarationOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this DeclarationOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this DeclarationOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this DeclarationOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this DeclarationOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this DeclarationOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this DeclarationOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def full_name(self): + """Gets the full_name of this DeclarationOrBuilder. # noqa: E501 + + + :return: The full_name of this DeclarationOrBuilder. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this DeclarationOrBuilder. + + + :param full_name: The full_name of this DeclarationOrBuilder. # noqa: E501 + :type: str + """ + + self._full_name = full_name + + @property + def full_name_bytes(self): + """Gets the full_name_bytes of this DeclarationOrBuilder. # noqa: E501 + + + :return: The full_name_bytes of this DeclarationOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._full_name_bytes + + @full_name_bytes.setter + def full_name_bytes(self, full_name_bytes): + """Sets the full_name_bytes of this DeclarationOrBuilder. + + + :param full_name_bytes: The full_name_bytes of this DeclarationOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._full_name_bytes = full_name_bytes + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this DeclarationOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this DeclarationOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this DeclarationOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this DeclarationOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this DeclarationOrBuilder. # noqa: E501 + + + :return: The initialized of this DeclarationOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this DeclarationOrBuilder. + + + :param initialized: The initialized of this DeclarationOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def number(self): + """Gets the number of this DeclarationOrBuilder. # noqa: E501 + + + :return: The number of this DeclarationOrBuilder. # noqa: E501 + :rtype: int + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this DeclarationOrBuilder. + + + :param number: The number of this DeclarationOrBuilder. # noqa: E501 + :type: int + """ + + self._number = number + + @property + def repeated(self): + """Gets the repeated of this DeclarationOrBuilder. # noqa: E501 + + + :return: The repeated of this DeclarationOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._repeated + + @repeated.setter + def repeated(self, repeated): + """Sets the repeated of this DeclarationOrBuilder. + + + :param repeated: The repeated of this DeclarationOrBuilder. # noqa: E501 + :type: bool + """ + + self._repeated = repeated + + @property + def reserved(self): + """Gets the reserved of this DeclarationOrBuilder. # noqa: E501 + + + :return: The reserved of this DeclarationOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._reserved + + @reserved.setter + def reserved(self, reserved): + """Sets the reserved of this DeclarationOrBuilder. + + + :param reserved: The reserved of this DeclarationOrBuilder. # noqa: E501 + :type: bool + """ + + self._reserved = reserved + + @property + def type(self): + """Gets the type of this DeclarationOrBuilder. # noqa: E501 + + + :return: The type of this DeclarationOrBuilder. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DeclarationOrBuilder. + + + :param type: The type of this DeclarationOrBuilder. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def type_bytes(self): + """Gets the type_bytes of this DeclarationOrBuilder. # noqa: E501 + + + :return: The type_bytes of this DeclarationOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._type_bytes + + @type_bytes.setter + def type_bytes(self, type_bytes): + """Sets the type_bytes of this DeclarationOrBuilder. + + + :param type_bytes: The type_bytes of this DeclarationOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._type_bytes = type_bytes + + @property + def unknown_fields(self): + """Gets the unknown_fields of this DeclarationOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this DeclarationOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this DeclarationOrBuilder. + + + :param unknown_fields: The unknown_fields of this DeclarationOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeclarationOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeclarationOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/descriptor.py b/src/conductor/client/codegen/models/descriptor.py new file mode 100644 index 00000000..6e4fb5a1 --- /dev/null +++ b/src/conductor/client/codegen/models/descriptor.py @@ -0,0 +1,448 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Descriptor(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'containing_type': 'Descriptor', + 'enum_types': 'list[EnumDescriptor]', + 'extendable': 'bool', + 'extensions': 'list[FieldDescriptor]', + 'fields': 'list[FieldDescriptor]', + 'file': 'FileDescriptor', + 'full_name': 'str', + 'index': 'int', + 'name': 'str', + 'nested_types': 'list[Descriptor]', + 'oneofs': 'list[OneofDescriptor]', + 'options': 'MessageOptions', + 'proto': 'DescriptorProto', + 'real_oneofs': 'list[OneofDescriptor]' + } + + attribute_map = { + 'containing_type': 'containingType', + 'enum_types': 'enumTypes', + 'extendable': 'extendable', + 'extensions': 'extensions', + 'fields': 'fields', + 'file': 'file', + 'full_name': 'fullName', + 'index': 'index', + 'name': 'name', + 'nested_types': 'nestedTypes', + 'oneofs': 'oneofs', + 'options': 'options', + 'proto': 'proto', + 'real_oneofs': 'realOneofs' + } + + def __init__(self, containing_type=None, enum_types=None, extendable=None, extensions=None, fields=None, file=None, full_name=None, index=None, name=None, nested_types=None, oneofs=None, options=None, proto=None, real_oneofs=None): # noqa: E501 + """Descriptor - a model defined in Swagger""" # noqa: E501 + self._containing_type = None + self._enum_types = None + self._extendable = None + self._extensions = None + self._fields = None + self._file = None + self._full_name = None + self._index = None + self._name = None + self._nested_types = None + self._oneofs = None + self._options = None + self._proto = None + self._real_oneofs = None + self.discriminator = None + if containing_type is not None: + self.containing_type = containing_type + if enum_types is not None: + self.enum_types = enum_types + if extendable is not None: + self.extendable = extendable + if extensions is not None: + self.extensions = extensions + if fields is not None: + self.fields = fields + if file is not None: + self.file = file + if full_name is not None: + self.full_name = full_name + if index is not None: + self.index = index + if name is not None: + self.name = name + if nested_types is not None: + self.nested_types = nested_types + if oneofs is not None: + self.oneofs = oneofs + if options is not None: + self.options = options + if proto is not None: + self.proto = proto + if real_oneofs is not None: + self.real_oneofs = real_oneofs + + @property + def containing_type(self): + """Gets the containing_type of this Descriptor. # noqa: E501 + + + :return: The containing_type of this Descriptor. # noqa: E501 + :rtype: Descriptor + """ + return self._containing_type + + @containing_type.setter + def containing_type(self, containing_type): + """Sets the containing_type of this Descriptor. + + + :param containing_type: The containing_type of this Descriptor. # noqa: E501 + :type: Descriptor + """ + + self._containing_type = containing_type + + @property + def enum_types(self): + """Gets the enum_types of this Descriptor. # noqa: E501 + + + :return: The enum_types of this Descriptor. # noqa: E501 + :rtype: list[EnumDescriptor] + """ + return self._enum_types + + @enum_types.setter + def enum_types(self, enum_types): + """Sets the enum_types of this Descriptor. + + + :param enum_types: The enum_types of this Descriptor. # noqa: E501 + :type: list[EnumDescriptor] + """ + + self._enum_types = enum_types + + @property + def extendable(self): + """Gets the extendable of this Descriptor. # noqa: E501 + + + :return: The extendable of this Descriptor. # noqa: E501 + :rtype: bool + """ + return self._extendable + + @extendable.setter + def extendable(self, extendable): + """Sets the extendable of this Descriptor. + + + :param extendable: The extendable of this Descriptor. # noqa: E501 + :type: bool + """ + + self._extendable = extendable + + @property + def extensions(self): + """Gets the extensions of this Descriptor. # noqa: E501 + + + :return: The extensions of this Descriptor. # noqa: E501 + :rtype: list[FieldDescriptor] + """ + return self._extensions + + @extensions.setter + def extensions(self, extensions): + """Sets the extensions of this Descriptor. + + + :param extensions: The extensions of this Descriptor. # noqa: E501 + :type: list[FieldDescriptor] + """ + + self._extensions = extensions + + @property + def fields(self): + """Gets the fields of this Descriptor. # noqa: E501 + + + :return: The fields of this Descriptor. # noqa: E501 + :rtype: list[FieldDescriptor] + """ + return self._fields + + @fields.setter + def fields(self, fields): + """Sets the fields of this Descriptor. + + + :param fields: The fields of this Descriptor. # noqa: E501 + :type: list[FieldDescriptor] + """ + + self._fields = fields + + @property + def file(self): + """Gets the file of this Descriptor. # noqa: E501 + + + :return: The file of this Descriptor. # noqa: E501 + :rtype: FileDescriptor + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this Descriptor. + + + :param file: The file of this Descriptor. # noqa: E501 + :type: FileDescriptor + """ + + self._file = file + + @property + def full_name(self): + """Gets the full_name of this Descriptor. # noqa: E501 + + + :return: The full_name of this Descriptor. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this Descriptor. + + + :param full_name: The full_name of this Descriptor. # noqa: E501 + :type: str + """ + + self._full_name = full_name + + @property + def index(self): + """Gets the index of this Descriptor. # noqa: E501 + + + :return: The index of this Descriptor. # noqa: E501 + :rtype: int + """ + return self._index + + @index.setter + def index(self, index): + """Sets the index of this Descriptor. + + + :param index: The index of this Descriptor. # noqa: E501 + :type: int + """ + + self._index = index + + @property + def name(self): + """Gets the name of this Descriptor. # noqa: E501 + + + :return: The name of this Descriptor. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Descriptor. + + + :param name: The name of this Descriptor. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def nested_types(self): + """Gets the nested_types of this Descriptor. # noqa: E501 + + + :return: The nested_types of this Descriptor. # noqa: E501 + :rtype: list[Descriptor] + """ + return self._nested_types + + @nested_types.setter + def nested_types(self, nested_types): + """Sets the nested_types of this Descriptor. + + + :param nested_types: The nested_types of this Descriptor. # noqa: E501 + :type: list[Descriptor] + """ + + self._nested_types = nested_types + + @property + def oneofs(self): + """Gets the oneofs of this Descriptor. # noqa: E501 + + + :return: The oneofs of this Descriptor. # noqa: E501 + :rtype: list[OneofDescriptor] + """ + return self._oneofs + + @oneofs.setter + def oneofs(self, oneofs): + """Sets the oneofs of this Descriptor. + + + :param oneofs: The oneofs of this Descriptor. # noqa: E501 + :type: list[OneofDescriptor] + """ + + self._oneofs = oneofs + + @property + def options(self): + """Gets the options of this Descriptor. # noqa: E501 + + + :return: The options of this Descriptor. # noqa: E501 + :rtype: MessageOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this Descriptor. + + + :param options: The options of this Descriptor. # noqa: E501 + :type: MessageOptions + """ + + self._options = options + + @property + def proto(self): + """Gets the proto of this Descriptor. # noqa: E501 + + + :return: The proto of this Descriptor. # noqa: E501 + :rtype: DescriptorProto + """ + return self._proto + + @proto.setter + def proto(self, proto): + """Sets the proto of this Descriptor. + + + :param proto: The proto of this Descriptor. # noqa: E501 + :type: DescriptorProto + """ + + self._proto = proto + + @property + def real_oneofs(self): + """Gets the real_oneofs of this Descriptor. # noqa: E501 + + + :return: The real_oneofs of this Descriptor. # noqa: E501 + :rtype: list[OneofDescriptor] + """ + return self._real_oneofs + + @real_oneofs.setter + def real_oneofs(self, real_oneofs): + """Sets the real_oneofs of this Descriptor. + + + :param real_oneofs: The real_oneofs of this Descriptor. # noqa: E501 + :type: list[OneofDescriptor] + """ + + self._real_oneofs = real_oneofs + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Descriptor, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Descriptor): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/descriptor_proto.py b/src/conductor/client/codegen/models/descriptor_proto.py new file mode 100644 index 00000000..fbfd8860 --- /dev/null +++ b/src/conductor/client/codegen/models/descriptor_proto.py @@ -0,0 +1,1020 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'DescriptorProto', + 'descriptor_for_type': 'Descriptor', + 'enum_type_count': 'int', + 'enum_type_list': 'list[EnumDescriptorProto]', + 'enum_type_or_builder_list': 'list[EnumDescriptorProtoOrBuilder]', + 'extension_count': 'int', + 'extension_list': 'list[FieldDescriptorProto]', + 'extension_or_builder_list': 'list[FieldDescriptorProtoOrBuilder]', + 'extension_range_count': 'int', + 'extension_range_list': 'list[ExtensionRange]', + 'extension_range_or_builder_list': 'list[ExtensionRangeOrBuilder]', + 'field_count': 'int', + 'field_list': 'list[FieldDescriptorProto]', + 'field_or_builder_list': 'list[FieldDescriptorProtoOrBuilder]', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'name': 'str', + 'name_bytes': 'ByteString', + 'nested_type_count': 'int', + 'nested_type_list': 'list[DescriptorProto]', + 'nested_type_or_builder_list': 'list[DescriptorProtoOrBuilder]', + 'oneof_decl_count': 'int', + 'oneof_decl_list': 'list[OneofDescriptorProto]', + 'oneof_decl_or_builder_list': 'list[OneofDescriptorProtoOrBuilder]', + 'options': 'MessageOptions', + 'options_or_builder': 'MessageOptionsOrBuilder', + 'parser_for_type': 'ParserDescriptorProto', + 'reserved_name_count': 'int', + 'reserved_name_list': 'list[str]', + 'reserved_range_count': 'int', + 'reserved_range_list': 'list[ReservedRange]', + 'reserved_range_or_builder_list': 'list[ReservedRangeOrBuilder]', + 'serialized_size': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'enum_type_count': 'enumTypeCount', + 'enum_type_list': 'enumTypeList', + 'enum_type_or_builder_list': 'enumTypeOrBuilderList', + 'extension_count': 'extensionCount', + 'extension_list': 'extensionList', + 'extension_or_builder_list': 'extensionOrBuilderList', + 'extension_range_count': 'extensionRangeCount', + 'extension_range_list': 'extensionRangeList', + 'extension_range_or_builder_list': 'extensionRangeOrBuilderList', + 'field_count': 'fieldCount', + 'field_list': 'fieldList', + 'field_or_builder_list': 'fieldOrBuilderList', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'nested_type_count': 'nestedTypeCount', + 'nested_type_list': 'nestedTypeList', + 'nested_type_or_builder_list': 'nestedTypeOrBuilderList', + 'oneof_decl_count': 'oneofDeclCount', + 'oneof_decl_list': 'oneofDeclList', + 'oneof_decl_or_builder_list': 'oneofDeclOrBuilderList', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'parser_for_type': 'parserForType', + 'reserved_name_count': 'reservedNameCount', + 'reserved_name_list': 'reservedNameList', + 'reserved_range_count': 'reservedRangeCount', + 'reserved_range_list': 'reservedRangeList', + 'reserved_range_or_builder_list': 'reservedRangeOrBuilderList', + 'serialized_size': 'serializedSize', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, enum_type_count=None, enum_type_list=None, enum_type_or_builder_list=None, extension_count=None, extension_list=None, extension_or_builder_list=None, extension_range_count=None, extension_range_list=None, extension_range_or_builder_list=None, field_count=None, field_list=None, field_or_builder_list=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, name=None, name_bytes=None, nested_type_count=None, nested_type_list=None, nested_type_or_builder_list=None, oneof_decl_count=None, oneof_decl_list=None, oneof_decl_or_builder_list=None, options=None, options_or_builder=None, parser_for_type=None, reserved_name_count=None, reserved_name_list=None, reserved_range_count=None, reserved_range_list=None, reserved_range_or_builder_list=None, serialized_size=None, unknown_fields=None): # noqa: E501 + """DescriptorProto - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._enum_type_count = None + self._enum_type_list = None + self._enum_type_or_builder_list = None + self._extension_count = None + self._extension_list = None + self._extension_or_builder_list = None + self._extension_range_count = None + self._extension_range_list = None + self._extension_range_or_builder_list = None + self._field_count = None + self._field_list = None + self._field_or_builder_list = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._name = None + self._name_bytes = None + self._nested_type_count = None + self._nested_type_list = None + self._nested_type_or_builder_list = None + self._oneof_decl_count = None + self._oneof_decl_list = None + self._oneof_decl_or_builder_list = None + self._options = None + self._options_or_builder = None + self._parser_for_type = None + self._reserved_name_count = None + self._reserved_name_list = None + self._reserved_range_count = None + self._reserved_range_list = None + self._reserved_range_or_builder_list = None + self._serialized_size = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if enum_type_count is not None: + self.enum_type_count = enum_type_count + if enum_type_list is not None: + self.enum_type_list = enum_type_list + if enum_type_or_builder_list is not None: + self.enum_type_or_builder_list = enum_type_or_builder_list + if extension_count is not None: + self.extension_count = extension_count + if extension_list is not None: + self.extension_list = extension_list + if extension_or_builder_list is not None: + self.extension_or_builder_list = extension_or_builder_list + if extension_range_count is not None: + self.extension_range_count = extension_range_count + if extension_range_list is not None: + self.extension_range_list = extension_range_list + if extension_range_or_builder_list is not None: + self.extension_range_or_builder_list = extension_range_or_builder_list + if field_count is not None: + self.field_count = field_count + if field_list is not None: + self.field_list = field_list + if field_or_builder_list is not None: + self.field_or_builder_list = field_or_builder_list + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if nested_type_count is not None: + self.nested_type_count = nested_type_count + if nested_type_list is not None: + self.nested_type_list = nested_type_list + if nested_type_or_builder_list is not None: + self.nested_type_or_builder_list = nested_type_or_builder_list + if oneof_decl_count is not None: + self.oneof_decl_count = oneof_decl_count + if oneof_decl_list is not None: + self.oneof_decl_list = oneof_decl_list + if oneof_decl_or_builder_list is not None: + self.oneof_decl_or_builder_list = oneof_decl_or_builder_list + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if reserved_name_count is not None: + self.reserved_name_count = reserved_name_count + if reserved_name_list is not None: + self.reserved_name_list = reserved_name_list + if reserved_range_count is not None: + self.reserved_range_count = reserved_range_count + if reserved_range_list is not None: + self.reserved_range_list = reserved_range_list + if reserved_range_or_builder_list is not None: + self.reserved_range_or_builder_list = reserved_range_or_builder_list + if serialized_size is not None: + self.serialized_size = serialized_size + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this DescriptorProto. # noqa: E501 + + + :return: The all_fields of this DescriptorProto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this DescriptorProto. + + + :param all_fields: The all_fields of this DescriptorProto. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this DescriptorProto. # noqa: E501 + + + :return: The default_instance_for_type of this DescriptorProto. # noqa: E501 + :rtype: DescriptorProto + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this DescriptorProto. + + + :param default_instance_for_type: The default_instance_for_type of this DescriptorProto. # noqa: E501 + :type: DescriptorProto + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this DescriptorProto. # noqa: E501 + + + :return: The descriptor_for_type of this DescriptorProto. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this DescriptorProto. + + + :param descriptor_for_type: The descriptor_for_type of this DescriptorProto. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def enum_type_count(self): + """Gets the enum_type_count of this DescriptorProto. # noqa: E501 + + + :return: The enum_type_count of this DescriptorProto. # noqa: E501 + :rtype: int + """ + return self._enum_type_count + + @enum_type_count.setter + def enum_type_count(self, enum_type_count): + """Sets the enum_type_count of this DescriptorProto. + + + :param enum_type_count: The enum_type_count of this DescriptorProto. # noqa: E501 + :type: int + """ + + self._enum_type_count = enum_type_count + + @property + def enum_type_list(self): + """Gets the enum_type_list of this DescriptorProto. # noqa: E501 + + + :return: The enum_type_list of this DescriptorProto. # noqa: E501 + :rtype: list[EnumDescriptorProto] + """ + return self._enum_type_list + + @enum_type_list.setter + def enum_type_list(self, enum_type_list): + """Sets the enum_type_list of this DescriptorProto. + + + :param enum_type_list: The enum_type_list of this DescriptorProto. # noqa: E501 + :type: list[EnumDescriptorProto] + """ + + self._enum_type_list = enum_type_list + + @property + def enum_type_or_builder_list(self): + """Gets the enum_type_or_builder_list of this DescriptorProto. # noqa: E501 + + + :return: The enum_type_or_builder_list of this DescriptorProto. # noqa: E501 + :rtype: list[EnumDescriptorProtoOrBuilder] + """ + return self._enum_type_or_builder_list + + @enum_type_or_builder_list.setter + def enum_type_or_builder_list(self, enum_type_or_builder_list): + """Sets the enum_type_or_builder_list of this DescriptorProto. + + + :param enum_type_or_builder_list: The enum_type_or_builder_list of this DescriptorProto. # noqa: E501 + :type: list[EnumDescriptorProtoOrBuilder] + """ + + self._enum_type_or_builder_list = enum_type_or_builder_list + + @property + def extension_count(self): + """Gets the extension_count of this DescriptorProto. # noqa: E501 + + + :return: The extension_count of this DescriptorProto. # noqa: E501 + :rtype: int + """ + return self._extension_count + + @extension_count.setter + def extension_count(self, extension_count): + """Sets the extension_count of this DescriptorProto. + + + :param extension_count: The extension_count of this DescriptorProto. # noqa: E501 + :type: int + """ + + self._extension_count = extension_count + + @property + def extension_list(self): + """Gets the extension_list of this DescriptorProto. # noqa: E501 + + + :return: The extension_list of this DescriptorProto. # noqa: E501 + :rtype: list[FieldDescriptorProto] + """ + return self._extension_list + + @extension_list.setter + def extension_list(self, extension_list): + """Sets the extension_list of this DescriptorProto. + + + :param extension_list: The extension_list of this DescriptorProto. # noqa: E501 + :type: list[FieldDescriptorProto] + """ + + self._extension_list = extension_list + + @property + def extension_or_builder_list(self): + """Gets the extension_or_builder_list of this DescriptorProto. # noqa: E501 + + + :return: The extension_or_builder_list of this DescriptorProto. # noqa: E501 + :rtype: list[FieldDescriptorProtoOrBuilder] + """ + return self._extension_or_builder_list + + @extension_or_builder_list.setter + def extension_or_builder_list(self, extension_or_builder_list): + """Sets the extension_or_builder_list of this DescriptorProto. + + + :param extension_or_builder_list: The extension_or_builder_list of this DescriptorProto. # noqa: E501 + :type: list[FieldDescriptorProtoOrBuilder] + """ + + self._extension_or_builder_list = extension_or_builder_list + + @property + def extension_range_count(self): + """Gets the extension_range_count of this DescriptorProto. # noqa: E501 + + + :return: The extension_range_count of this DescriptorProto. # noqa: E501 + :rtype: int + """ + return self._extension_range_count + + @extension_range_count.setter + def extension_range_count(self, extension_range_count): + """Sets the extension_range_count of this DescriptorProto. + + + :param extension_range_count: The extension_range_count of this DescriptorProto. # noqa: E501 + :type: int + """ + + self._extension_range_count = extension_range_count + + @property + def extension_range_list(self): + """Gets the extension_range_list of this DescriptorProto. # noqa: E501 + + + :return: The extension_range_list of this DescriptorProto. # noqa: E501 + :rtype: list[ExtensionRange] + """ + return self._extension_range_list + + @extension_range_list.setter + def extension_range_list(self, extension_range_list): + """Sets the extension_range_list of this DescriptorProto. + + + :param extension_range_list: The extension_range_list of this DescriptorProto. # noqa: E501 + :type: list[ExtensionRange] + """ + + self._extension_range_list = extension_range_list + + @property + def extension_range_or_builder_list(self): + """Gets the extension_range_or_builder_list of this DescriptorProto. # noqa: E501 + + + :return: The extension_range_or_builder_list of this DescriptorProto. # noqa: E501 + :rtype: list[ExtensionRangeOrBuilder] + """ + return self._extension_range_or_builder_list + + @extension_range_or_builder_list.setter + def extension_range_or_builder_list(self, extension_range_or_builder_list): + """Sets the extension_range_or_builder_list of this DescriptorProto. + + + :param extension_range_or_builder_list: The extension_range_or_builder_list of this DescriptorProto. # noqa: E501 + :type: list[ExtensionRangeOrBuilder] + """ + + self._extension_range_or_builder_list = extension_range_or_builder_list + + @property + def field_count(self): + """Gets the field_count of this DescriptorProto. # noqa: E501 + + + :return: The field_count of this DescriptorProto. # noqa: E501 + :rtype: int + """ + return self._field_count + + @field_count.setter + def field_count(self, field_count): + """Sets the field_count of this DescriptorProto. + + + :param field_count: The field_count of this DescriptorProto. # noqa: E501 + :type: int + """ + + self._field_count = field_count + + @property + def field_list(self): + """Gets the field_list of this DescriptorProto. # noqa: E501 + + + :return: The field_list of this DescriptorProto. # noqa: E501 + :rtype: list[FieldDescriptorProto] + """ + return self._field_list + + @field_list.setter + def field_list(self, field_list): + """Sets the field_list of this DescriptorProto. + + + :param field_list: The field_list of this DescriptorProto. # noqa: E501 + :type: list[FieldDescriptorProto] + """ + + self._field_list = field_list + + @property + def field_or_builder_list(self): + """Gets the field_or_builder_list of this DescriptorProto. # noqa: E501 + + + :return: The field_or_builder_list of this DescriptorProto. # noqa: E501 + :rtype: list[FieldDescriptorProtoOrBuilder] + """ + return self._field_or_builder_list + + @field_or_builder_list.setter + def field_or_builder_list(self, field_or_builder_list): + """Sets the field_or_builder_list of this DescriptorProto. + + + :param field_or_builder_list: The field_or_builder_list of this DescriptorProto. # noqa: E501 + :type: list[FieldDescriptorProtoOrBuilder] + """ + + self._field_or_builder_list = field_or_builder_list + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this DescriptorProto. # noqa: E501 + + + :return: The initialization_error_string of this DescriptorProto. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this DescriptorProto. + + + :param initialization_error_string: The initialization_error_string of this DescriptorProto. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this DescriptorProto. # noqa: E501 + + + :return: The initialized of this DescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this DescriptorProto. + + + :param initialized: The initialized of this DescriptorProto. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this DescriptorProto. # noqa: E501 + + + :return: The memoized_serialized_size of this DescriptorProto. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this DescriptorProto. + + + :param memoized_serialized_size: The memoized_serialized_size of this DescriptorProto. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def name(self): + """Gets the name of this DescriptorProto. # noqa: E501 + + + :return: The name of this DescriptorProto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DescriptorProto. + + + :param name: The name of this DescriptorProto. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this DescriptorProto. # noqa: E501 + + + :return: The name_bytes of this DescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this DescriptorProto. + + + :param name_bytes: The name_bytes of this DescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def nested_type_count(self): + """Gets the nested_type_count of this DescriptorProto. # noqa: E501 + + + :return: The nested_type_count of this DescriptorProto. # noqa: E501 + :rtype: int + """ + return self._nested_type_count + + @nested_type_count.setter + def nested_type_count(self, nested_type_count): + """Sets the nested_type_count of this DescriptorProto. + + + :param nested_type_count: The nested_type_count of this DescriptorProto. # noqa: E501 + :type: int + """ + + self._nested_type_count = nested_type_count + + @property + def nested_type_list(self): + """Gets the nested_type_list of this DescriptorProto. # noqa: E501 + + + :return: The nested_type_list of this DescriptorProto. # noqa: E501 + :rtype: list[DescriptorProto] + """ + return self._nested_type_list + + @nested_type_list.setter + def nested_type_list(self, nested_type_list): + """Sets the nested_type_list of this DescriptorProto. + + + :param nested_type_list: The nested_type_list of this DescriptorProto. # noqa: E501 + :type: list[DescriptorProto] + """ + + self._nested_type_list = nested_type_list + + @property + def nested_type_or_builder_list(self): + """Gets the nested_type_or_builder_list of this DescriptorProto. # noqa: E501 + + + :return: The nested_type_or_builder_list of this DescriptorProto. # noqa: E501 + :rtype: list[DescriptorProtoOrBuilder] + """ + return self._nested_type_or_builder_list + + @nested_type_or_builder_list.setter + def nested_type_or_builder_list(self, nested_type_or_builder_list): + """Sets the nested_type_or_builder_list of this DescriptorProto. + + + :param nested_type_or_builder_list: The nested_type_or_builder_list of this DescriptorProto. # noqa: E501 + :type: list[DescriptorProtoOrBuilder] + """ + + self._nested_type_or_builder_list = nested_type_or_builder_list + + @property + def oneof_decl_count(self): + """Gets the oneof_decl_count of this DescriptorProto. # noqa: E501 + + + :return: The oneof_decl_count of this DescriptorProto. # noqa: E501 + :rtype: int + """ + return self._oneof_decl_count + + @oneof_decl_count.setter + def oneof_decl_count(self, oneof_decl_count): + """Sets the oneof_decl_count of this DescriptorProto. + + + :param oneof_decl_count: The oneof_decl_count of this DescriptorProto. # noqa: E501 + :type: int + """ + + self._oneof_decl_count = oneof_decl_count + + @property + def oneof_decl_list(self): + """Gets the oneof_decl_list of this DescriptorProto. # noqa: E501 + + + :return: The oneof_decl_list of this DescriptorProto. # noqa: E501 + :rtype: list[OneofDescriptorProto] + """ + return self._oneof_decl_list + + @oneof_decl_list.setter + def oneof_decl_list(self, oneof_decl_list): + """Sets the oneof_decl_list of this DescriptorProto. + + + :param oneof_decl_list: The oneof_decl_list of this DescriptorProto. # noqa: E501 + :type: list[OneofDescriptorProto] + """ + + self._oneof_decl_list = oneof_decl_list + + @property + def oneof_decl_or_builder_list(self): + """Gets the oneof_decl_or_builder_list of this DescriptorProto. # noqa: E501 + + + :return: The oneof_decl_or_builder_list of this DescriptorProto. # noqa: E501 + :rtype: list[OneofDescriptorProtoOrBuilder] + """ + return self._oneof_decl_or_builder_list + + @oneof_decl_or_builder_list.setter + def oneof_decl_or_builder_list(self, oneof_decl_or_builder_list): + """Sets the oneof_decl_or_builder_list of this DescriptorProto. + + + :param oneof_decl_or_builder_list: The oneof_decl_or_builder_list of this DescriptorProto. # noqa: E501 + :type: list[OneofDescriptorProtoOrBuilder] + """ + + self._oneof_decl_or_builder_list = oneof_decl_or_builder_list + + @property + def options(self): + """Gets the options of this DescriptorProto. # noqa: E501 + + + :return: The options of this DescriptorProto. # noqa: E501 + :rtype: MessageOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this DescriptorProto. + + + :param options: The options of this DescriptorProto. # noqa: E501 + :type: MessageOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this DescriptorProto. # noqa: E501 + + + :return: The options_or_builder of this DescriptorProto. # noqa: E501 + :rtype: MessageOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this DescriptorProto. + + + :param options_or_builder: The options_or_builder of this DescriptorProto. # noqa: E501 + :type: MessageOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def parser_for_type(self): + """Gets the parser_for_type of this DescriptorProto. # noqa: E501 + + + :return: The parser_for_type of this DescriptorProto. # noqa: E501 + :rtype: ParserDescriptorProto + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this DescriptorProto. + + + :param parser_for_type: The parser_for_type of this DescriptorProto. # noqa: E501 + :type: ParserDescriptorProto + """ + + self._parser_for_type = parser_for_type + + @property + def reserved_name_count(self): + """Gets the reserved_name_count of this DescriptorProto. # noqa: E501 + + + :return: The reserved_name_count of this DescriptorProto. # noqa: E501 + :rtype: int + """ + return self._reserved_name_count + + @reserved_name_count.setter + def reserved_name_count(self, reserved_name_count): + """Sets the reserved_name_count of this DescriptorProto. + + + :param reserved_name_count: The reserved_name_count of this DescriptorProto. # noqa: E501 + :type: int + """ + + self._reserved_name_count = reserved_name_count + + @property + def reserved_name_list(self): + """Gets the reserved_name_list of this DescriptorProto. # noqa: E501 + + + :return: The reserved_name_list of this DescriptorProto. # noqa: E501 + :rtype: list[str] + """ + return self._reserved_name_list + + @reserved_name_list.setter + def reserved_name_list(self, reserved_name_list): + """Sets the reserved_name_list of this DescriptorProto. + + + :param reserved_name_list: The reserved_name_list of this DescriptorProto. # noqa: E501 + :type: list[str] + """ + + self._reserved_name_list = reserved_name_list + + @property + def reserved_range_count(self): + """Gets the reserved_range_count of this DescriptorProto. # noqa: E501 + + + :return: The reserved_range_count of this DescriptorProto. # noqa: E501 + :rtype: int + """ + return self._reserved_range_count + + @reserved_range_count.setter + def reserved_range_count(self, reserved_range_count): + """Sets the reserved_range_count of this DescriptorProto. + + + :param reserved_range_count: The reserved_range_count of this DescriptorProto. # noqa: E501 + :type: int + """ + + self._reserved_range_count = reserved_range_count + + @property + def reserved_range_list(self): + """Gets the reserved_range_list of this DescriptorProto. # noqa: E501 + + + :return: The reserved_range_list of this DescriptorProto. # noqa: E501 + :rtype: list[ReservedRange] + """ + return self._reserved_range_list + + @reserved_range_list.setter + def reserved_range_list(self, reserved_range_list): + """Sets the reserved_range_list of this DescriptorProto. + + + :param reserved_range_list: The reserved_range_list of this DescriptorProto. # noqa: E501 + :type: list[ReservedRange] + """ + + self._reserved_range_list = reserved_range_list + + @property + def reserved_range_or_builder_list(self): + """Gets the reserved_range_or_builder_list of this DescriptorProto. # noqa: E501 + + + :return: The reserved_range_or_builder_list of this DescriptorProto. # noqa: E501 + :rtype: list[ReservedRangeOrBuilder] + """ + return self._reserved_range_or_builder_list + + @reserved_range_or_builder_list.setter + def reserved_range_or_builder_list(self, reserved_range_or_builder_list): + """Sets the reserved_range_or_builder_list of this DescriptorProto. + + + :param reserved_range_or_builder_list: The reserved_range_or_builder_list of this DescriptorProto. # noqa: E501 + :type: list[ReservedRangeOrBuilder] + """ + + self._reserved_range_or_builder_list = reserved_range_or_builder_list + + @property + def serialized_size(self): + """Gets the serialized_size of this DescriptorProto. # noqa: E501 + + + :return: The serialized_size of this DescriptorProto. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this DescriptorProto. + + + :param serialized_size: The serialized_size of this DescriptorProto. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def unknown_fields(self): + """Gets the unknown_fields of this DescriptorProto. # noqa: E501 + + + :return: The unknown_fields of this DescriptorProto. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this DescriptorProto. + + + :param unknown_fields: The unknown_fields of this DescriptorProto. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/descriptor_proto_or_builder.py b/src/conductor/client/codegen/models/descriptor_proto_or_builder.py new file mode 100644 index 00000000..09c74698 --- /dev/null +++ b/src/conductor/client/codegen/models/descriptor_proto_or_builder.py @@ -0,0 +1,916 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DescriptorProtoOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'enum_type_count': 'int', + 'enum_type_list': 'list[EnumDescriptorProto]', + 'enum_type_or_builder_list': 'list[EnumDescriptorProtoOrBuilder]', + 'extension_count': 'int', + 'extension_list': 'list[FieldDescriptorProto]', + 'extension_or_builder_list': 'list[FieldDescriptorProtoOrBuilder]', + 'extension_range_count': 'int', + 'extension_range_list': 'list[ExtensionRange]', + 'extension_range_or_builder_list': 'list[ExtensionRangeOrBuilder]', + 'field_count': 'int', + 'field_list': 'list[FieldDescriptorProto]', + 'field_or_builder_list': 'list[FieldDescriptorProtoOrBuilder]', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'name': 'str', + 'name_bytes': 'ByteString', + 'nested_type_count': 'int', + 'nested_type_list': 'list[DescriptorProto]', + 'oneof_decl_count': 'int', + 'oneof_decl_list': 'list[OneofDescriptorProto]', + 'oneof_decl_or_builder_list': 'list[OneofDescriptorProtoOrBuilder]', + 'options': 'MessageOptions', + 'options_or_builder': 'MessageOptionsOrBuilder', + 'reserved_name_count': 'int', + 'reserved_name_list': 'list[str]', + 'reserved_range_count': 'int', + 'reserved_range_list': 'list[ReservedRange]', + 'reserved_range_or_builder_list': 'list[ReservedRangeOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'enum_type_count': 'enumTypeCount', + 'enum_type_list': 'enumTypeList', + 'enum_type_or_builder_list': 'enumTypeOrBuilderList', + 'extension_count': 'extensionCount', + 'extension_list': 'extensionList', + 'extension_or_builder_list': 'extensionOrBuilderList', + 'extension_range_count': 'extensionRangeCount', + 'extension_range_list': 'extensionRangeList', + 'extension_range_or_builder_list': 'extensionRangeOrBuilderList', + 'field_count': 'fieldCount', + 'field_list': 'fieldList', + 'field_or_builder_list': 'fieldOrBuilderList', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'nested_type_count': 'nestedTypeCount', + 'nested_type_list': 'nestedTypeList', + 'oneof_decl_count': 'oneofDeclCount', + 'oneof_decl_list': 'oneofDeclList', + 'oneof_decl_or_builder_list': 'oneofDeclOrBuilderList', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'reserved_name_count': 'reservedNameCount', + 'reserved_name_list': 'reservedNameList', + 'reserved_range_count': 'reservedRangeCount', + 'reserved_range_list': 'reservedRangeList', + 'reserved_range_or_builder_list': 'reservedRangeOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, enum_type_count=None, enum_type_list=None, enum_type_or_builder_list=None, extension_count=None, extension_list=None, extension_or_builder_list=None, extension_range_count=None, extension_range_list=None, extension_range_or_builder_list=None, field_count=None, field_list=None, field_or_builder_list=None, initialization_error_string=None, initialized=None, name=None, name_bytes=None, nested_type_count=None, nested_type_list=None, oneof_decl_count=None, oneof_decl_list=None, oneof_decl_or_builder_list=None, options=None, options_or_builder=None, reserved_name_count=None, reserved_name_list=None, reserved_range_count=None, reserved_range_list=None, reserved_range_or_builder_list=None, unknown_fields=None): # noqa: E501 + """DescriptorProtoOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._enum_type_count = None + self._enum_type_list = None + self._enum_type_or_builder_list = None + self._extension_count = None + self._extension_list = None + self._extension_or_builder_list = None + self._extension_range_count = None + self._extension_range_list = None + self._extension_range_or_builder_list = None + self._field_count = None + self._field_list = None + self._field_or_builder_list = None + self._initialization_error_string = None + self._initialized = None + self._name = None + self._name_bytes = None + self._nested_type_count = None + self._nested_type_list = None + self._oneof_decl_count = None + self._oneof_decl_list = None + self._oneof_decl_or_builder_list = None + self._options = None + self._options_or_builder = None + self._reserved_name_count = None + self._reserved_name_list = None + self._reserved_range_count = None + self._reserved_range_list = None + self._reserved_range_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if enum_type_count is not None: + self.enum_type_count = enum_type_count + if enum_type_list is not None: + self.enum_type_list = enum_type_list + if enum_type_or_builder_list is not None: + self.enum_type_or_builder_list = enum_type_or_builder_list + if extension_count is not None: + self.extension_count = extension_count + if extension_list is not None: + self.extension_list = extension_list + if extension_or_builder_list is not None: + self.extension_or_builder_list = extension_or_builder_list + if extension_range_count is not None: + self.extension_range_count = extension_range_count + if extension_range_list is not None: + self.extension_range_list = extension_range_list + if extension_range_or_builder_list is not None: + self.extension_range_or_builder_list = extension_range_or_builder_list + if field_count is not None: + self.field_count = field_count + if field_list is not None: + self.field_list = field_list + if field_or_builder_list is not None: + self.field_or_builder_list = field_or_builder_list + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if nested_type_count is not None: + self.nested_type_count = nested_type_count + if nested_type_list is not None: + self.nested_type_list = nested_type_list + if oneof_decl_count is not None: + self.oneof_decl_count = oneof_decl_count + if oneof_decl_list is not None: + self.oneof_decl_list = oneof_decl_list + if oneof_decl_or_builder_list is not None: + self.oneof_decl_or_builder_list = oneof_decl_or_builder_list + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if reserved_name_count is not None: + self.reserved_name_count = reserved_name_count + if reserved_name_list is not None: + self.reserved_name_list = reserved_name_list + if reserved_range_count is not None: + self.reserved_range_count = reserved_range_count + if reserved_range_list is not None: + self.reserved_range_list = reserved_range_list + if reserved_range_or_builder_list is not None: + self.reserved_range_or_builder_list = reserved_range_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The all_fields of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this DescriptorProtoOrBuilder. + + + :param all_fields: The all_fields of this DescriptorProtoOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this DescriptorProtoOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this DescriptorProtoOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this DescriptorProtoOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this DescriptorProtoOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def enum_type_count(self): + """Gets the enum_type_count of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The enum_type_count of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._enum_type_count + + @enum_type_count.setter + def enum_type_count(self, enum_type_count): + """Sets the enum_type_count of this DescriptorProtoOrBuilder. + + + :param enum_type_count: The enum_type_count of this DescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._enum_type_count = enum_type_count + + @property + def enum_type_list(self): + """Gets the enum_type_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The enum_type_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[EnumDescriptorProto] + """ + return self._enum_type_list + + @enum_type_list.setter + def enum_type_list(self, enum_type_list): + """Sets the enum_type_list of this DescriptorProtoOrBuilder. + + + :param enum_type_list: The enum_type_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[EnumDescriptorProto] + """ + + self._enum_type_list = enum_type_list + + @property + def enum_type_or_builder_list(self): + """Gets the enum_type_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The enum_type_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[EnumDescriptorProtoOrBuilder] + """ + return self._enum_type_or_builder_list + + @enum_type_or_builder_list.setter + def enum_type_or_builder_list(self, enum_type_or_builder_list): + """Sets the enum_type_or_builder_list of this DescriptorProtoOrBuilder. + + + :param enum_type_or_builder_list: The enum_type_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[EnumDescriptorProtoOrBuilder] + """ + + self._enum_type_or_builder_list = enum_type_or_builder_list + + @property + def extension_count(self): + """Gets the extension_count of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The extension_count of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._extension_count + + @extension_count.setter + def extension_count(self, extension_count): + """Sets the extension_count of this DescriptorProtoOrBuilder. + + + :param extension_count: The extension_count of this DescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._extension_count = extension_count + + @property + def extension_list(self): + """Gets the extension_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The extension_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[FieldDescriptorProto] + """ + return self._extension_list + + @extension_list.setter + def extension_list(self, extension_list): + """Sets the extension_list of this DescriptorProtoOrBuilder. + + + :param extension_list: The extension_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[FieldDescriptorProto] + """ + + self._extension_list = extension_list + + @property + def extension_or_builder_list(self): + """Gets the extension_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The extension_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[FieldDescriptorProtoOrBuilder] + """ + return self._extension_or_builder_list + + @extension_or_builder_list.setter + def extension_or_builder_list(self, extension_or_builder_list): + """Sets the extension_or_builder_list of this DescriptorProtoOrBuilder. + + + :param extension_or_builder_list: The extension_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[FieldDescriptorProtoOrBuilder] + """ + + self._extension_or_builder_list = extension_or_builder_list + + @property + def extension_range_count(self): + """Gets the extension_range_count of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The extension_range_count of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._extension_range_count + + @extension_range_count.setter + def extension_range_count(self, extension_range_count): + """Sets the extension_range_count of this DescriptorProtoOrBuilder. + + + :param extension_range_count: The extension_range_count of this DescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._extension_range_count = extension_range_count + + @property + def extension_range_list(self): + """Gets the extension_range_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The extension_range_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[ExtensionRange] + """ + return self._extension_range_list + + @extension_range_list.setter + def extension_range_list(self, extension_range_list): + """Sets the extension_range_list of this DescriptorProtoOrBuilder. + + + :param extension_range_list: The extension_range_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[ExtensionRange] + """ + + self._extension_range_list = extension_range_list + + @property + def extension_range_or_builder_list(self): + """Gets the extension_range_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The extension_range_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[ExtensionRangeOrBuilder] + """ + return self._extension_range_or_builder_list + + @extension_range_or_builder_list.setter + def extension_range_or_builder_list(self, extension_range_or_builder_list): + """Sets the extension_range_or_builder_list of this DescriptorProtoOrBuilder. + + + :param extension_range_or_builder_list: The extension_range_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[ExtensionRangeOrBuilder] + """ + + self._extension_range_or_builder_list = extension_range_or_builder_list + + @property + def field_count(self): + """Gets the field_count of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The field_count of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._field_count + + @field_count.setter + def field_count(self, field_count): + """Sets the field_count of this DescriptorProtoOrBuilder. + + + :param field_count: The field_count of this DescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._field_count = field_count + + @property + def field_list(self): + """Gets the field_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The field_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[FieldDescriptorProto] + """ + return self._field_list + + @field_list.setter + def field_list(self, field_list): + """Sets the field_list of this DescriptorProtoOrBuilder. + + + :param field_list: The field_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[FieldDescriptorProto] + """ + + self._field_list = field_list + + @property + def field_or_builder_list(self): + """Gets the field_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The field_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[FieldDescriptorProtoOrBuilder] + """ + return self._field_or_builder_list + + @field_or_builder_list.setter + def field_or_builder_list(self, field_or_builder_list): + """Sets the field_or_builder_list of this DescriptorProtoOrBuilder. + + + :param field_or_builder_list: The field_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[FieldDescriptorProtoOrBuilder] + """ + + self._field_or_builder_list = field_or_builder_list + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this DescriptorProtoOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this DescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialized of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this DescriptorProtoOrBuilder. + + + :param initialized: The initialized of this DescriptorProtoOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def name(self): + """Gets the name of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DescriptorProtoOrBuilder. + + + :param name: The name of this DescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name_bytes of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this DescriptorProtoOrBuilder. + + + :param name_bytes: The name_bytes of this DescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def nested_type_count(self): + """Gets the nested_type_count of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The nested_type_count of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._nested_type_count + + @nested_type_count.setter + def nested_type_count(self, nested_type_count): + """Sets the nested_type_count of this DescriptorProtoOrBuilder. + + + :param nested_type_count: The nested_type_count of this DescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._nested_type_count = nested_type_count + + @property + def nested_type_list(self): + """Gets the nested_type_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The nested_type_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[DescriptorProto] + """ + return self._nested_type_list + + @nested_type_list.setter + def nested_type_list(self, nested_type_list): + """Sets the nested_type_list of this DescriptorProtoOrBuilder. + + + :param nested_type_list: The nested_type_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[DescriptorProto] + """ + + self._nested_type_list = nested_type_list + + @property + def oneof_decl_count(self): + """Gets the oneof_decl_count of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The oneof_decl_count of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._oneof_decl_count + + @oneof_decl_count.setter + def oneof_decl_count(self, oneof_decl_count): + """Sets the oneof_decl_count of this DescriptorProtoOrBuilder. + + + :param oneof_decl_count: The oneof_decl_count of this DescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._oneof_decl_count = oneof_decl_count + + @property + def oneof_decl_list(self): + """Gets the oneof_decl_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The oneof_decl_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[OneofDescriptorProto] + """ + return self._oneof_decl_list + + @oneof_decl_list.setter + def oneof_decl_list(self, oneof_decl_list): + """Sets the oneof_decl_list of this DescriptorProtoOrBuilder. + + + :param oneof_decl_list: The oneof_decl_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[OneofDescriptorProto] + """ + + self._oneof_decl_list = oneof_decl_list + + @property + def oneof_decl_or_builder_list(self): + """Gets the oneof_decl_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The oneof_decl_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[OneofDescriptorProtoOrBuilder] + """ + return self._oneof_decl_or_builder_list + + @oneof_decl_or_builder_list.setter + def oneof_decl_or_builder_list(self, oneof_decl_or_builder_list): + """Sets the oneof_decl_or_builder_list of this DescriptorProtoOrBuilder. + + + :param oneof_decl_or_builder_list: The oneof_decl_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[OneofDescriptorProtoOrBuilder] + """ + + self._oneof_decl_or_builder_list = oneof_decl_or_builder_list + + @property + def options(self): + """Gets the options of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: MessageOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this DescriptorProtoOrBuilder. + + + :param options: The options of this DescriptorProtoOrBuilder. # noqa: E501 + :type: MessageOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options_or_builder of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: MessageOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this DescriptorProtoOrBuilder. + + + :param options_or_builder: The options_or_builder of this DescriptorProtoOrBuilder. # noqa: E501 + :type: MessageOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def reserved_name_count(self): + """Gets the reserved_name_count of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The reserved_name_count of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._reserved_name_count + + @reserved_name_count.setter + def reserved_name_count(self, reserved_name_count): + """Sets the reserved_name_count of this DescriptorProtoOrBuilder. + + + :param reserved_name_count: The reserved_name_count of this DescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._reserved_name_count = reserved_name_count + + @property + def reserved_name_list(self): + """Gets the reserved_name_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The reserved_name_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[str] + """ + return self._reserved_name_list + + @reserved_name_list.setter + def reserved_name_list(self, reserved_name_list): + """Sets the reserved_name_list of this DescriptorProtoOrBuilder. + + + :param reserved_name_list: The reserved_name_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[str] + """ + + self._reserved_name_list = reserved_name_list + + @property + def reserved_range_count(self): + """Gets the reserved_range_count of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The reserved_range_count of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._reserved_range_count + + @reserved_range_count.setter + def reserved_range_count(self, reserved_range_count): + """Sets the reserved_range_count of this DescriptorProtoOrBuilder. + + + :param reserved_range_count: The reserved_range_count of this DescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._reserved_range_count = reserved_range_count + + @property + def reserved_range_list(self): + """Gets the reserved_range_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The reserved_range_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[ReservedRange] + """ + return self._reserved_range_list + + @reserved_range_list.setter + def reserved_range_list(self, reserved_range_list): + """Sets the reserved_range_list of this DescriptorProtoOrBuilder. + + + :param reserved_range_list: The reserved_range_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[ReservedRange] + """ + + self._reserved_range_list = reserved_range_list + + @property + def reserved_range_or_builder_list(self): + """Gets the reserved_range_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The reserved_range_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[ReservedRangeOrBuilder] + """ + return self._reserved_range_or_builder_list + + @reserved_range_or_builder_list.setter + def reserved_range_or_builder_list(self, reserved_range_or_builder_list): + """Sets the reserved_range_or_builder_list of this DescriptorProtoOrBuilder. + + + :param reserved_range_or_builder_list: The reserved_range_or_builder_list of this DescriptorProtoOrBuilder. # noqa: E501 + :type: list[ReservedRangeOrBuilder] + """ + + self._reserved_range_or_builder_list = reserved_range_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this DescriptorProtoOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this DescriptorProtoOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this DescriptorProtoOrBuilder. + + + :param unknown_fields: The unknown_fields of this DescriptorProtoOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DescriptorProtoOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DescriptorProtoOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/edition_default.py b/src/conductor/client/codegen/models/edition_default.py new file mode 100644 index 00000000..78355fe2 --- /dev/null +++ b/src/conductor/client/codegen/models/edition_default.py @@ -0,0 +1,402 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EditionDefault(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'EditionDefault', + 'descriptor_for_type': 'Descriptor', + 'edition': 'str', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserEditionDefault', + 'serialized_size': 'int', + 'unknown_fields': 'UnknownFieldSet', + 'value': 'str', + 'value_bytes': 'ByteString' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'edition': 'edition', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'unknown_fields': 'unknownFields', + 'value': 'value', + 'value_bytes': 'valueBytes' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, edition=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, unknown_fields=None, value=None, value_bytes=None): # noqa: E501 + """EditionDefault - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._edition = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._unknown_fields = None + self._value = None + self._value_bytes = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if edition is not None: + self.edition = edition + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if value is not None: + self.value = value + if value_bytes is not None: + self.value_bytes = value_bytes + + @property + def all_fields(self): + """Gets the all_fields of this EditionDefault. # noqa: E501 + + + :return: The all_fields of this EditionDefault. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EditionDefault. + + + :param all_fields: The all_fields of this EditionDefault. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EditionDefault. # noqa: E501 + + + :return: The default_instance_for_type of this EditionDefault. # noqa: E501 + :rtype: EditionDefault + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EditionDefault. + + + :param default_instance_for_type: The default_instance_for_type of this EditionDefault. # noqa: E501 + :type: EditionDefault + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EditionDefault. # noqa: E501 + + + :return: The descriptor_for_type of this EditionDefault. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EditionDefault. + + + :param descriptor_for_type: The descriptor_for_type of this EditionDefault. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def edition(self): + """Gets the edition of this EditionDefault. # noqa: E501 + + + :return: The edition of this EditionDefault. # noqa: E501 + :rtype: str + """ + return self._edition + + @edition.setter + def edition(self, edition): + """Sets the edition of this EditionDefault. + + + :param edition: The edition of this EditionDefault. # noqa: E501 + :type: str + """ + allowed_values = ["EDITION_UNKNOWN", "EDITION_PROTO2", "EDITION_PROTO3", "EDITION_2023", "EDITION_1_TEST_ONLY", "EDITION_2_TEST_ONLY", "EDITION_99997_TEST_ONLY", "EDITION_99998_TEST_ONLY", "EDITION_99999_TEST_ONLY"] # noqa: E501 + if edition not in allowed_values: + raise ValueError( + "Invalid value for `edition` ({0}), must be one of {1}" # noqa: E501 + .format(edition, allowed_values) + ) + + self._edition = edition + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EditionDefault. # noqa: E501 + + + :return: The initialization_error_string of this EditionDefault. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EditionDefault. + + + :param initialization_error_string: The initialization_error_string of this EditionDefault. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EditionDefault. # noqa: E501 + + + :return: The initialized of this EditionDefault. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EditionDefault. + + + :param initialized: The initialized of this EditionDefault. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this EditionDefault. # noqa: E501 + + + :return: The memoized_serialized_size of this EditionDefault. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this EditionDefault. + + + :param memoized_serialized_size: The memoized_serialized_size of this EditionDefault. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this EditionDefault. # noqa: E501 + + + :return: The parser_for_type of this EditionDefault. # noqa: E501 + :rtype: ParserEditionDefault + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this EditionDefault. + + + :param parser_for_type: The parser_for_type of this EditionDefault. # noqa: E501 + :type: ParserEditionDefault + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this EditionDefault. # noqa: E501 + + + :return: The serialized_size of this EditionDefault. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this EditionDefault. + + + :param serialized_size: The serialized_size of this EditionDefault. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EditionDefault. # noqa: E501 + + + :return: The unknown_fields of this EditionDefault. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EditionDefault. + + + :param unknown_fields: The unknown_fields of this EditionDefault. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def value(self): + """Gets the value of this EditionDefault. # noqa: E501 + + + :return: The value of this EditionDefault. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this EditionDefault. + + + :param value: The value of this EditionDefault. # noqa: E501 + :type: str + """ + + self._value = value + + @property + def value_bytes(self): + """Gets the value_bytes of this EditionDefault. # noqa: E501 + + + :return: The value_bytes of this EditionDefault. # noqa: E501 + :rtype: ByteString + """ + return self._value_bytes + + @value_bytes.setter + def value_bytes(self, value_bytes): + """Sets the value_bytes of this EditionDefault. + + + :param value_bytes: The value_bytes of this EditionDefault. # noqa: E501 + :type: ByteString + """ + + self._value_bytes = value_bytes + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EditionDefault, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EditionDefault): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/edition_default_or_builder.py b/src/conductor/client/codegen/models/edition_default_or_builder.py new file mode 100644 index 00000000..58484109 --- /dev/null +++ b/src/conductor/client/codegen/models/edition_default_or_builder.py @@ -0,0 +1,324 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EditionDefaultOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'edition': 'str', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'unknown_fields': 'UnknownFieldSet', + 'value': 'str', + 'value_bytes': 'ByteString' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'edition': 'edition', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'unknown_fields': 'unknownFields', + 'value': 'value', + 'value_bytes': 'valueBytes' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, edition=None, initialization_error_string=None, initialized=None, unknown_fields=None, value=None, value_bytes=None): # noqa: E501 + """EditionDefaultOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._edition = None + self._initialization_error_string = None + self._initialized = None + self._unknown_fields = None + self._value = None + self._value_bytes = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if edition is not None: + self.edition = edition + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if value is not None: + self.value = value + if value_bytes is not None: + self.value_bytes = value_bytes + + @property + def all_fields(self): + """Gets the all_fields of this EditionDefaultOrBuilder. # noqa: E501 + + + :return: The all_fields of this EditionDefaultOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EditionDefaultOrBuilder. + + + :param all_fields: The all_fields of this EditionDefaultOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EditionDefaultOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this EditionDefaultOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EditionDefaultOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this EditionDefaultOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EditionDefaultOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this EditionDefaultOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EditionDefaultOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this EditionDefaultOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def edition(self): + """Gets the edition of this EditionDefaultOrBuilder. # noqa: E501 + + + :return: The edition of this EditionDefaultOrBuilder. # noqa: E501 + :rtype: str + """ + return self._edition + + @edition.setter + def edition(self, edition): + """Sets the edition of this EditionDefaultOrBuilder. + + + :param edition: The edition of this EditionDefaultOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["EDITION_UNKNOWN", "EDITION_PROTO2", "EDITION_PROTO3", "EDITION_2023", "EDITION_1_TEST_ONLY", "EDITION_2_TEST_ONLY", "EDITION_99997_TEST_ONLY", "EDITION_99998_TEST_ONLY", "EDITION_99999_TEST_ONLY"] # noqa: E501 + if edition not in allowed_values: + raise ValueError( + "Invalid value for `edition` ({0}), must be one of {1}" # noqa: E501 + .format(edition, allowed_values) + ) + + self._edition = edition + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EditionDefaultOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this EditionDefaultOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EditionDefaultOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this EditionDefaultOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EditionDefaultOrBuilder. # noqa: E501 + + + :return: The initialized of this EditionDefaultOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EditionDefaultOrBuilder. + + + :param initialized: The initialized of this EditionDefaultOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EditionDefaultOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this EditionDefaultOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EditionDefaultOrBuilder. + + + :param unknown_fields: The unknown_fields of this EditionDefaultOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def value(self): + """Gets the value of this EditionDefaultOrBuilder. # noqa: E501 + + + :return: The value of this EditionDefaultOrBuilder. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this EditionDefaultOrBuilder. + + + :param value: The value of this EditionDefaultOrBuilder. # noqa: E501 + :type: str + """ + + self._value = value + + @property + def value_bytes(self): + """Gets the value_bytes of this EditionDefaultOrBuilder. # noqa: E501 + + + :return: The value_bytes of this EditionDefaultOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._value_bytes + + @value_bytes.setter + def value_bytes(self, value_bytes): + """Sets the value_bytes of this EditionDefaultOrBuilder. + + + :param value_bytes: The value_bytes of this EditionDefaultOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._value_bytes = value_bytes + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EditionDefaultOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EditionDefaultOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_descriptor.py b/src/conductor/client/codegen/models/enum_descriptor.py new file mode 100644 index 00000000..85ef9eda --- /dev/null +++ b/src/conductor/client/codegen/models/enum_descriptor.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumDescriptor(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'closed': 'bool', + 'containing_type': 'Descriptor', + 'file': 'FileDescriptor', + 'full_name': 'str', + 'index': 'int', + 'name': 'str', + 'options': 'EnumOptions', + 'proto': 'EnumDescriptorProto', + 'values': 'list[EnumValueDescriptor]' + } + + attribute_map = { + 'closed': 'closed', + 'containing_type': 'containingType', + 'file': 'file', + 'full_name': 'fullName', + 'index': 'index', + 'name': 'name', + 'options': 'options', + 'proto': 'proto', + 'values': 'values' + } + + def __init__(self, closed=None, containing_type=None, file=None, full_name=None, index=None, name=None, options=None, proto=None, values=None): # noqa: E501 + """EnumDescriptor - a model defined in Swagger""" # noqa: E501 + self._closed = None + self._containing_type = None + self._file = None + self._full_name = None + self._index = None + self._name = None + self._options = None + self._proto = None + self._values = None + self.discriminator = None + if closed is not None: + self.closed = closed + if containing_type is not None: + self.containing_type = containing_type + if file is not None: + self.file = file + if full_name is not None: + self.full_name = full_name + if index is not None: + self.index = index + if name is not None: + self.name = name + if options is not None: + self.options = options + if proto is not None: + self.proto = proto + if values is not None: + self.values = values + + @property + def closed(self): + """Gets the closed of this EnumDescriptor. # noqa: E501 + + + :return: The closed of this EnumDescriptor. # noqa: E501 + :rtype: bool + """ + return self._closed + + @closed.setter + def closed(self, closed): + """Sets the closed of this EnumDescriptor. + + + :param closed: The closed of this EnumDescriptor. # noqa: E501 + :type: bool + """ + + self._closed = closed + + @property + def containing_type(self): + """Gets the containing_type of this EnumDescriptor. # noqa: E501 + + + :return: The containing_type of this EnumDescriptor. # noqa: E501 + :rtype: Descriptor + """ + return self._containing_type + + @containing_type.setter + def containing_type(self, containing_type): + """Sets the containing_type of this EnumDescriptor. + + + :param containing_type: The containing_type of this EnumDescriptor. # noqa: E501 + :type: Descriptor + """ + + self._containing_type = containing_type + + @property + def file(self): + """Gets the file of this EnumDescriptor. # noqa: E501 + + + :return: The file of this EnumDescriptor. # noqa: E501 + :rtype: FileDescriptor + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this EnumDescriptor. + + + :param file: The file of this EnumDescriptor. # noqa: E501 + :type: FileDescriptor + """ + + self._file = file + + @property + def full_name(self): + """Gets the full_name of this EnumDescriptor. # noqa: E501 + + + :return: The full_name of this EnumDescriptor. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this EnumDescriptor. + + + :param full_name: The full_name of this EnumDescriptor. # noqa: E501 + :type: str + """ + + self._full_name = full_name + + @property + def index(self): + """Gets the index of this EnumDescriptor. # noqa: E501 + + + :return: The index of this EnumDescriptor. # noqa: E501 + :rtype: int + """ + return self._index + + @index.setter + def index(self, index): + """Sets the index of this EnumDescriptor. + + + :param index: The index of this EnumDescriptor. # noqa: E501 + :type: int + """ + + self._index = index + + @property + def name(self): + """Gets the name of this EnumDescriptor. # noqa: E501 + + + :return: The name of this EnumDescriptor. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EnumDescriptor. + + + :param name: The name of this EnumDescriptor. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def options(self): + """Gets the options of this EnumDescriptor. # noqa: E501 + + + :return: The options of this EnumDescriptor. # noqa: E501 + :rtype: EnumOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this EnumDescriptor. + + + :param options: The options of this EnumDescriptor. # noqa: E501 + :type: EnumOptions + """ + + self._options = options + + @property + def proto(self): + """Gets the proto of this EnumDescriptor. # noqa: E501 + + + :return: The proto of this EnumDescriptor. # noqa: E501 + :rtype: EnumDescriptorProto + """ + return self._proto + + @proto.setter + def proto(self, proto): + """Sets the proto of this EnumDescriptor. + + + :param proto: The proto of this EnumDescriptor. # noqa: E501 + :type: EnumDescriptorProto + """ + + self._proto = proto + + @property + def values(self): + """Gets the values of this EnumDescriptor. # noqa: E501 + + + :return: The values of this EnumDescriptor. # noqa: E501 + :rtype: list[EnumValueDescriptor] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this EnumDescriptor. + + + :param values: The values of this EnumDescriptor. # noqa: E501 + :type: list[EnumValueDescriptor] + """ + + self._values = values + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumDescriptor, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumDescriptor): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_descriptor_proto.py b/src/conductor/client/codegen/models/enum_descriptor_proto.py new file mode 100644 index 00000000..84200de8 --- /dev/null +++ b/src/conductor/client/codegen/models/enum_descriptor_proto.py @@ -0,0 +1,630 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'EnumDescriptorProto', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'name': 'str', + 'name_bytes': 'ByteString', + 'options': 'EnumOptions', + 'options_or_builder': 'EnumOptionsOrBuilder', + 'parser_for_type': 'ParserEnumDescriptorProto', + 'reserved_name_count': 'int', + 'reserved_name_list': 'list[str]', + 'reserved_range_count': 'int', + 'reserved_range_list': 'list[EnumReservedRange]', + 'reserved_range_or_builder_list': 'list[EnumReservedRangeOrBuilder]', + 'serialized_size': 'int', + 'unknown_fields': 'UnknownFieldSet', + 'value_count': 'int', + 'value_list': 'list[EnumValueDescriptorProto]', + 'value_or_builder_list': 'list[EnumValueDescriptorProtoOrBuilder]' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'parser_for_type': 'parserForType', + 'reserved_name_count': 'reservedNameCount', + 'reserved_name_list': 'reservedNameList', + 'reserved_range_count': 'reservedRangeCount', + 'reserved_range_list': 'reservedRangeList', + 'reserved_range_or_builder_list': 'reservedRangeOrBuilderList', + 'serialized_size': 'serializedSize', + 'unknown_fields': 'unknownFields', + 'value_count': 'valueCount', + 'value_list': 'valueList', + 'value_or_builder_list': 'valueOrBuilderList' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, name=None, name_bytes=None, options=None, options_or_builder=None, parser_for_type=None, reserved_name_count=None, reserved_name_list=None, reserved_range_count=None, reserved_range_list=None, reserved_range_or_builder_list=None, serialized_size=None, unknown_fields=None, value_count=None, value_list=None, value_or_builder_list=None): # noqa: E501 + """EnumDescriptorProto - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._name = None + self._name_bytes = None + self._options = None + self._options_or_builder = None + self._parser_for_type = None + self._reserved_name_count = None + self._reserved_name_list = None + self._reserved_range_count = None + self._reserved_range_list = None + self._reserved_range_or_builder_list = None + self._serialized_size = None + self._unknown_fields = None + self._value_count = None + self._value_list = None + self._value_or_builder_list = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if reserved_name_count is not None: + self.reserved_name_count = reserved_name_count + if reserved_name_list is not None: + self.reserved_name_list = reserved_name_list + if reserved_range_count is not None: + self.reserved_range_count = reserved_range_count + if reserved_range_list is not None: + self.reserved_range_list = reserved_range_list + if reserved_range_or_builder_list is not None: + self.reserved_range_or_builder_list = reserved_range_or_builder_list + if serialized_size is not None: + self.serialized_size = serialized_size + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if value_count is not None: + self.value_count = value_count + if value_list is not None: + self.value_list = value_list + if value_or_builder_list is not None: + self.value_or_builder_list = value_or_builder_list + + @property + def all_fields(self): + """Gets the all_fields of this EnumDescriptorProto. # noqa: E501 + + + :return: The all_fields of this EnumDescriptorProto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EnumDescriptorProto. + + + :param all_fields: The all_fields of this EnumDescriptorProto. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EnumDescriptorProto. # noqa: E501 + + + :return: The default_instance_for_type of this EnumDescriptorProto. # noqa: E501 + :rtype: EnumDescriptorProto + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EnumDescriptorProto. + + + :param default_instance_for_type: The default_instance_for_type of this EnumDescriptorProto. # noqa: E501 + :type: EnumDescriptorProto + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EnumDescriptorProto. # noqa: E501 + + + :return: The descriptor_for_type of this EnumDescriptorProto. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EnumDescriptorProto. + + + :param descriptor_for_type: The descriptor_for_type of this EnumDescriptorProto. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EnumDescriptorProto. # noqa: E501 + + + :return: The initialization_error_string of this EnumDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EnumDescriptorProto. + + + :param initialization_error_string: The initialization_error_string of this EnumDescriptorProto. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EnumDescriptorProto. # noqa: E501 + + + :return: The initialized of this EnumDescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EnumDescriptorProto. + + + :param initialized: The initialized of this EnumDescriptorProto. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this EnumDescriptorProto. # noqa: E501 + + + :return: The memoized_serialized_size of this EnumDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this EnumDescriptorProto. + + + :param memoized_serialized_size: The memoized_serialized_size of this EnumDescriptorProto. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def name(self): + """Gets the name of this EnumDescriptorProto. # noqa: E501 + + + :return: The name of this EnumDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EnumDescriptorProto. + + + :param name: The name of this EnumDescriptorProto. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this EnumDescriptorProto. # noqa: E501 + + + :return: The name_bytes of this EnumDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this EnumDescriptorProto. + + + :param name_bytes: The name_bytes of this EnumDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def options(self): + """Gets the options of this EnumDescriptorProto. # noqa: E501 + + + :return: The options of this EnumDescriptorProto. # noqa: E501 + :rtype: EnumOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this EnumDescriptorProto. + + + :param options: The options of this EnumDescriptorProto. # noqa: E501 + :type: EnumOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this EnumDescriptorProto. # noqa: E501 + + + :return: The options_or_builder of this EnumDescriptorProto. # noqa: E501 + :rtype: EnumOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this EnumDescriptorProto. + + + :param options_or_builder: The options_or_builder of this EnumDescriptorProto. # noqa: E501 + :type: EnumOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def parser_for_type(self): + """Gets the parser_for_type of this EnumDescriptorProto. # noqa: E501 + + + :return: The parser_for_type of this EnumDescriptorProto. # noqa: E501 + :rtype: ParserEnumDescriptorProto + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this EnumDescriptorProto. + + + :param parser_for_type: The parser_for_type of this EnumDescriptorProto. # noqa: E501 + :type: ParserEnumDescriptorProto + """ + + self._parser_for_type = parser_for_type + + @property + def reserved_name_count(self): + """Gets the reserved_name_count of this EnumDescriptorProto. # noqa: E501 + + + :return: The reserved_name_count of this EnumDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._reserved_name_count + + @reserved_name_count.setter + def reserved_name_count(self, reserved_name_count): + """Sets the reserved_name_count of this EnumDescriptorProto. + + + :param reserved_name_count: The reserved_name_count of this EnumDescriptorProto. # noqa: E501 + :type: int + """ + + self._reserved_name_count = reserved_name_count + + @property + def reserved_name_list(self): + """Gets the reserved_name_list of this EnumDescriptorProto. # noqa: E501 + + + :return: The reserved_name_list of this EnumDescriptorProto. # noqa: E501 + :rtype: list[str] + """ + return self._reserved_name_list + + @reserved_name_list.setter + def reserved_name_list(self, reserved_name_list): + """Sets the reserved_name_list of this EnumDescriptorProto. + + + :param reserved_name_list: The reserved_name_list of this EnumDescriptorProto. # noqa: E501 + :type: list[str] + """ + + self._reserved_name_list = reserved_name_list + + @property + def reserved_range_count(self): + """Gets the reserved_range_count of this EnumDescriptorProto. # noqa: E501 + + + :return: The reserved_range_count of this EnumDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._reserved_range_count + + @reserved_range_count.setter + def reserved_range_count(self, reserved_range_count): + """Sets the reserved_range_count of this EnumDescriptorProto. + + + :param reserved_range_count: The reserved_range_count of this EnumDescriptorProto. # noqa: E501 + :type: int + """ + + self._reserved_range_count = reserved_range_count + + @property + def reserved_range_list(self): + """Gets the reserved_range_list of this EnumDescriptorProto. # noqa: E501 + + + :return: The reserved_range_list of this EnumDescriptorProto. # noqa: E501 + :rtype: list[EnumReservedRange] + """ + return self._reserved_range_list + + @reserved_range_list.setter + def reserved_range_list(self, reserved_range_list): + """Sets the reserved_range_list of this EnumDescriptorProto. + + + :param reserved_range_list: The reserved_range_list of this EnumDescriptorProto. # noqa: E501 + :type: list[EnumReservedRange] + """ + + self._reserved_range_list = reserved_range_list + + @property + def reserved_range_or_builder_list(self): + """Gets the reserved_range_or_builder_list of this EnumDescriptorProto. # noqa: E501 + + + :return: The reserved_range_or_builder_list of this EnumDescriptorProto. # noqa: E501 + :rtype: list[EnumReservedRangeOrBuilder] + """ + return self._reserved_range_or_builder_list + + @reserved_range_or_builder_list.setter + def reserved_range_or_builder_list(self, reserved_range_or_builder_list): + """Sets the reserved_range_or_builder_list of this EnumDescriptorProto. + + + :param reserved_range_or_builder_list: The reserved_range_or_builder_list of this EnumDescriptorProto. # noqa: E501 + :type: list[EnumReservedRangeOrBuilder] + """ + + self._reserved_range_or_builder_list = reserved_range_or_builder_list + + @property + def serialized_size(self): + """Gets the serialized_size of this EnumDescriptorProto. # noqa: E501 + + + :return: The serialized_size of this EnumDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this EnumDescriptorProto. + + + :param serialized_size: The serialized_size of this EnumDescriptorProto. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EnumDescriptorProto. # noqa: E501 + + + :return: The unknown_fields of this EnumDescriptorProto. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EnumDescriptorProto. + + + :param unknown_fields: The unknown_fields of this EnumDescriptorProto. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def value_count(self): + """Gets the value_count of this EnumDescriptorProto. # noqa: E501 + + + :return: The value_count of this EnumDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._value_count + + @value_count.setter + def value_count(self, value_count): + """Sets the value_count of this EnumDescriptorProto. + + + :param value_count: The value_count of this EnumDescriptorProto. # noqa: E501 + :type: int + """ + + self._value_count = value_count + + @property + def value_list(self): + """Gets the value_list of this EnumDescriptorProto. # noqa: E501 + + + :return: The value_list of this EnumDescriptorProto. # noqa: E501 + :rtype: list[EnumValueDescriptorProto] + """ + return self._value_list + + @value_list.setter + def value_list(self, value_list): + """Sets the value_list of this EnumDescriptorProto. + + + :param value_list: The value_list of this EnumDescriptorProto. # noqa: E501 + :type: list[EnumValueDescriptorProto] + """ + + self._value_list = value_list + + @property + def value_or_builder_list(self): + """Gets the value_or_builder_list of this EnumDescriptorProto. # noqa: E501 + + + :return: The value_or_builder_list of this EnumDescriptorProto. # noqa: E501 + :rtype: list[EnumValueDescriptorProtoOrBuilder] + """ + return self._value_or_builder_list + + @value_or_builder_list.setter + def value_or_builder_list(self, value_or_builder_list): + """Sets the value_or_builder_list of this EnumDescriptorProto. + + + :param value_or_builder_list: The value_or_builder_list of this EnumDescriptorProto. # noqa: E501 + :type: list[EnumValueDescriptorProtoOrBuilder] + """ + + self._value_or_builder_list = value_or_builder_list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_descriptor_proto_or_builder.py b/src/conductor/client/codegen/models/enum_descriptor_proto_or_builder.py new file mode 100644 index 00000000..cba1e20b --- /dev/null +++ b/src/conductor/client/codegen/models/enum_descriptor_proto_or_builder.py @@ -0,0 +1,552 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumDescriptorProtoOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'name': 'str', + 'name_bytes': 'ByteString', + 'options': 'EnumOptions', + 'options_or_builder': 'EnumOptionsOrBuilder', + 'reserved_name_count': 'int', + 'reserved_name_list': 'list[str]', + 'reserved_range_count': 'int', + 'reserved_range_list': 'list[EnumReservedRange]', + 'reserved_range_or_builder_list': 'list[EnumReservedRangeOrBuilder]', + 'unknown_fields': 'UnknownFieldSet', + 'value_count': 'int', + 'value_list': 'list[EnumValueDescriptorProto]', + 'value_or_builder_list': 'list[EnumValueDescriptorProtoOrBuilder]' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'reserved_name_count': 'reservedNameCount', + 'reserved_name_list': 'reservedNameList', + 'reserved_range_count': 'reservedRangeCount', + 'reserved_range_list': 'reservedRangeList', + 'reserved_range_or_builder_list': 'reservedRangeOrBuilderList', + 'unknown_fields': 'unknownFields', + 'value_count': 'valueCount', + 'value_list': 'valueList', + 'value_or_builder_list': 'valueOrBuilderList' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, name=None, name_bytes=None, options=None, options_or_builder=None, reserved_name_count=None, reserved_name_list=None, reserved_range_count=None, reserved_range_list=None, reserved_range_or_builder_list=None, unknown_fields=None, value_count=None, value_list=None, value_or_builder_list=None): # noqa: E501 + """EnumDescriptorProtoOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._name = None + self._name_bytes = None + self._options = None + self._options_or_builder = None + self._reserved_name_count = None + self._reserved_name_list = None + self._reserved_range_count = None + self._reserved_range_list = None + self._reserved_range_or_builder_list = None + self._unknown_fields = None + self._value_count = None + self._value_list = None + self._value_or_builder_list = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if reserved_name_count is not None: + self.reserved_name_count = reserved_name_count + if reserved_name_list is not None: + self.reserved_name_list = reserved_name_list + if reserved_range_count is not None: + self.reserved_range_count = reserved_range_count + if reserved_range_list is not None: + self.reserved_range_list = reserved_range_list + if reserved_range_or_builder_list is not None: + self.reserved_range_or_builder_list = reserved_range_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if value_count is not None: + self.value_count = value_count + if value_list is not None: + self.value_list = value_list + if value_or_builder_list is not None: + self.value_or_builder_list = value_or_builder_list + + @property + def all_fields(self): + """Gets the all_fields of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The all_fields of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EnumDescriptorProtoOrBuilder. + + + :param all_fields: The all_fields of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EnumDescriptorProtoOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EnumDescriptorProtoOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EnumDescriptorProtoOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialized of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EnumDescriptorProtoOrBuilder. + + + :param initialized: The initialized of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def name(self): + """Gets the name of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EnumDescriptorProtoOrBuilder. + + + :param name: The name of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name_bytes of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this EnumDescriptorProtoOrBuilder. + + + :param name_bytes: The name_bytes of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def options(self): + """Gets the options of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: EnumOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this EnumDescriptorProtoOrBuilder. + + + :param options: The options of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: EnumOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options_or_builder of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: EnumOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this EnumDescriptorProtoOrBuilder. + + + :param options_or_builder: The options_or_builder of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: EnumOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def reserved_name_count(self): + """Gets the reserved_name_count of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The reserved_name_count of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._reserved_name_count + + @reserved_name_count.setter + def reserved_name_count(self, reserved_name_count): + """Sets the reserved_name_count of this EnumDescriptorProtoOrBuilder. + + + :param reserved_name_count: The reserved_name_count of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._reserved_name_count = reserved_name_count + + @property + def reserved_name_list(self): + """Gets the reserved_name_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The reserved_name_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[str] + """ + return self._reserved_name_list + + @reserved_name_list.setter + def reserved_name_list(self, reserved_name_list): + """Sets the reserved_name_list of this EnumDescriptorProtoOrBuilder. + + + :param reserved_name_list: The reserved_name_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: list[str] + """ + + self._reserved_name_list = reserved_name_list + + @property + def reserved_range_count(self): + """Gets the reserved_range_count of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The reserved_range_count of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._reserved_range_count + + @reserved_range_count.setter + def reserved_range_count(self, reserved_range_count): + """Sets the reserved_range_count of this EnumDescriptorProtoOrBuilder. + + + :param reserved_range_count: The reserved_range_count of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._reserved_range_count = reserved_range_count + + @property + def reserved_range_list(self): + """Gets the reserved_range_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The reserved_range_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[EnumReservedRange] + """ + return self._reserved_range_list + + @reserved_range_list.setter + def reserved_range_list(self, reserved_range_list): + """Sets the reserved_range_list of this EnumDescriptorProtoOrBuilder. + + + :param reserved_range_list: The reserved_range_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: list[EnumReservedRange] + """ + + self._reserved_range_list = reserved_range_list + + @property + def reserved_range_or_builder_list(self): + """Gets the reserved_range_or_builder_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The reserved_range_or_builder_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[EnumReservedRangeOrBuilder] + """ + return self._reserved_range_or_builder_list + + @reserved_range_or_builder_list.setter + def reserved_range_or_builder_list(self, reserved_range_or_builder_list): + """Sets the reserved_range_or_builder_list of this EnumDescriptorProtoOrBuilder. + + + :param reserved_range_or_builder_list: The reserved_range_or_builder_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: list[EnumReservedRangeOrBuilder] + """ + + self._reserved_range_or_builder_list = reserved_range_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EnumDescriptorProtoOrBuilder. + + + :param unknown_fields: The unknown_fields of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def value_count(self): + """Gets the value_count of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The value_count of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._value_count + + @value_count.setter + def value_count(self, value_count): + """Sets the value_count of this EnumDescriptorProtoOrBuilder. + + + :param value_count: The value_count of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._value_count = value_count + + @property + def value_list(self): + """Gets the value_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The value_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[EnumValueDescriptorProto] + """ + return self._value_list + + @value_list.setter + def value_list(self, value_list): + """Sets the value_list of this EnumDescriptorProtoOrBuilder. + + + :param value_list: The value_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: list[EnumValueDescriptorProto] + """ + + self._value_list = value_list + + @property + def value_or_builder_list(self): + """Gets the value_or_builder_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The value_or_builder_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[EnumValueDescriptorProtoOrBuilder] + """ + return self._value_or_builder_list + + @value_or_builder_list.setter + def value_or_builder_list(self, value_or_builder_list): + """Sets the value_or_builder_list of this EnumDescriptorProtoOrBuilder. + + + :param value_or_builder_list: The value_or_builder_list of this EnumDescriptorProtoOrBuilder. # noqa: E501 + :type: list[EnumValueDescriptorProtoOrBuilder] + """ + + self._value_or_builder_list = value_or_builder_list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumDescriptorProtoOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumDescriptorProtoOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_options.py b/src/conductor/client/codegen/models/enum_options.py new file mode 100644 index 00000000..08db3a88 --- /dev/null +++ b/src/conductor/client/codegen/models/enum_options.py @@ -0,0 +1,552 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'all_fields_raw': 'dict(str, object)', + 'allow_alias': 'bool', + 'default_instance_for_type': 'EnumOptions', + 'deprecated': 'bool', + 'deprecated_legacy_json_field_conflicts': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserEnumOptions', + 'serialized_size': 'int', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'all_fields_raw': 'allFieldsRaw', + 'allow_alias': 'allowAlias', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'deprecated_legacy_json_field_conflicts': 'deprecatedLegacyJsonFieldConflicts', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, all_fields_raw=None, allow_alias=None, default_instance_for_type=None, deprecated=None, deprecated_legacy_json_field_conflicts=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """EnumOptions - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._all_fields_raw = None + self._allow_alias = None + self._default_instance_for_type = None + self._deprecated = None + self._deprecated_legacy_json_field_conflicts = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if all_fields_raw is not None: + self.all_fields_raw = all_fields_raw + if allow_alias is not None: + self.allow_alias = allow_alias + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if deprecated_legacy_json_field_conflicts is not None: + self.deprecated_legacy_json_field_conflicts = deprecated_legacy_json_field_conflicts + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this EnumOptions. # noqa: E501 + + + :return: The all_fields of this EnumOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EnumOptions. + + + :param all_fields: The all_fields of this EnumOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def all_fields_raw(self): + """Gets the all_fields_raw of this EnumOptions. # noqa: E501 + + + :return: The all_fields_raw of this EnumOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields_raw + + @all_fields_raw.setter + def all_fields_raw(self, all_fields_raw): + """Sets the all_fields_raw of this EnumOptions. + + + :param all_fields_raw: The all_fields_raw of this EnumOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields_raw = all_fields_raw + + @property + def allow_alias(self): + """Gets the allow_alias of this EnumOptions. # noqa: E501 + + + :return: The allow_alias of this EnumOptions. # noqa: E501 + :rtype: bool + """ + return self._allow_alias + + @allow_alias.setter + def allow_alias(self, allow_alias): + """Sets the allow_alias of this EnumOptions. + + + :param allow_alias: The allow_alias of this EnumOptions. # noqa: E501 + :type: bool + """ + + self._allow_alias = allow_alias + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EnumOptions. # noqa: E501 + + + :return: The default_instance_for_type of this EnumOptions. # noqa: E501 + :rtype: EnumOptions + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EnumOptions. + + + :param default_instance_for_type: The default_instance_for_type of this EnumOptions. # noqa: E501 + :type: EnumOptions + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this EnumOptions. # noqa: E501 + + + :return: The deprecated of this EnumOptions. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this EnumOptions. + + + :param deprecated: The deprecated of this EnumOptions. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def deprecated_legacy_json_field_conflicts(self): + """Gets the deprecated_legacy_json_field_conflicts of this EnumOptions. # noqa: E501 + + + :return: The deprecated_legacy_json_field_conflicts of this EnumOptions. # noqa: E501 + :rtype: bool + """ + return self._deprecated_legacy_json_field_conflicts + + @deprecated_legacy_json_field_conflicts.setter + def deprecated_legacy_json_field_conflicts(self, deprecated_legacy_json_field_conflicts): + """Sets the deprecated_legacy_json_field_conflicts of this EnumOptions. + + + :param deprecated_legacy_json_field_conflicts: The deprecated_legacy_json_field_conflicts of this EnumOptions. # noqa: E501 + :type: bool + """ + + self._deprecated_legacy_json_field_conflicts = deprecated_legacy_json_field_conflicts + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EnumOptions. # noqa: E501 + + + :return: The descriptor_for_type of this EnumOptions. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EnumOptions. + + + :param descriptor_for_type: The descriptor_for_type of this EnumOptions. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this EnumOptions. # noqa: E501 + + + :return: The features of this EnumOptions. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this EnumOptions. + + + :param features: The features of this EnumOptions. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this EnumOptions. # noqa: E501 + + + :return: The features_or_builder of this EnumOptions. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this EnumOptions. + + + :param features_or_builder: The features_or_builder of this EnumOptions. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EnumOptions. # noqa: E501 + + + :return: The initialization_error_string of this EnumOptions. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EnumOptions. + + + :param initialization_error_string: The initialization_error_string of this EnumOptions. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EnumOptions. # noqa: E501 + + + :return: The initialized of this EnumOptions. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EnumOptions. + + + :param initialized: The initialized of this EnumOptions. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this EnumOptions. # noqa: E501 + + + :return: The memoized_serialized_size of this EnumOptions. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this EnumOptions. + + + :param memoized_serialized_size: The memoized_serialized_size of this EnumOptions. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this EnumOptions. # noqa: E501 + + + :return: The parser_for_type of this EnumOptions. # noqa: E501 + :rtype: ParserEnumOptions + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this EnumOptions. + + + :param parser_for_type: The parser_for_type of this EnumOptions. # noqa: E501 + :type: ParserEnumOptions + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this EnumOptions. # noqa: E501 + + + :return: The serialized_size of this EnumOptions. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this EnumOptions. + + + :param serialized_size: The serialized_size of this EnumOptions. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this EnumOptions. # noqa: E501 + + + :return: The uninterpreted_option_count of this EnumOptions. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this EnumOptions. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this EnumOptions. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this EnumOptions. # noqa: E501 + + + :return: The uninterpreted_option_list of this EnumOptions. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this EnumOptions. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this EnumOptions. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this EnumOptions. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this EnumOptions. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this EnumOptions. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this EnumOptions. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EnumOptions. # noqa: E501 + + + :return: The unknown_fields of this EnumOptions. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EnumOptions. + + + :param unknown_fields: The unknown_fields of this EnumOptions. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_options_or_builder.py b/src/conductor/client/codegen/models/enum_options_or_builder.py new file mode 100644 index 00000000..f4b1e386 --- /dev/null +++ b/src/conductor/client/codegen/models/enum_options_or_builder.py @@ -0,0 +1,448 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumOptionsOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'allow_alias': 'bool', + 'default_instance_for_type': 'Message', + 'deprecated': 'bool', + 'deprecated_legacy_json_field_conflicts': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'allow_alias': 'allowAlias', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'deprecated_legacy_json_field_conflicts': 'deprecatedLegacyJsonFieldConflicts', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, allow_alias=None, default_instance_for_type=None, deprecated=None, deprecated_legacy_json_field_conflicts=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """EnumOptionsOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._allow_alias = None + self._default_instance_for_type = None + self._deprecated = None + self._deprecated_legacy_json_field_conflicts = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if allow_alias is not None: + self.allow_alias = allow_alias + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if deprecated_legacy_json_field_conflicts is not None: + self.deprecated_legacy_json_field_conflicts = deprecated_legacy_json_field_conflicts + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The all_fields of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EnumOptionsOrBuilder. + + + :param all_fields: The all_fields of this EnumOptionsOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def allow_alias(self): + """Gets the allow_alias of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The allow_alias of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._allow_alias + + @allow_alias.setter + def allow_alias(self, allow_alias): + """Sets the allow_alias of this EnumOptionsOrBuilder. + + + :param allow_alias: The allow_alias of this EnumOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._allow_alias = allow_alias + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EnumOptionsOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this EnumOptionsOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The deprecated of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this EnumOptionsOrBuilder. + + + :param deprecated: The deprecated of this EnumOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def deprecated_legacy_json_field_conflicts(self): + """Gets the deprecated_legacy_json_field_conflicts of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The deprecated_legacy_json_field_conflicts of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._deprecated_legacy_json_field_conflicts + + @deprecated_legacy_json_field_conflicts.setter + def deprecated_legacy_json_field_conflicts(self, deprecated_legacy_json_field_conflicts): + """Sets the deprecated_legacy_json_field_conflicts of this EnumOptionsOrBuilder. + + + :param deprecated_legacy_json_field_conflicts: The deprecated_legacy_json_field_conflicts of this EnumOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._deprecated_legacy_json_field_conflicts = deprecated_legacy_json_field_conflicts + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EnumOptionsOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this EnumOptionsOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The features of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this EnumOptionsOrBuilder. + + + :param features: The features of this EnumOptionsOrBuilder. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The features_or_builder of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this EnumOptionsOrBuilder. + + + :param features_or_builder: The features_or_builder of this EnumOptionsOrBuilder. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EnumOptionsOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this EnumOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The initialized of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EnumOptionsOrBuilder. + + + :param initialized: The initialized of this EnumOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_count of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this EnumOptionsOrBuilder. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this EnumOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_list of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this EnumOptionsOrBuilder. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this EnumOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this EnumOptionsOrBuilder. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this EnumOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EnumOptionsOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this EnumOptionsOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EnumOptionsOrBuilder. + + + :param unknown_fields: The unknown_fields of this EnumOptionsOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumOptionsOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumOptionsOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_reserved_range.py b/src/conductor/client/codegen/models/enum_reserved_range.py new file mode 100644 index 00000000..47666e5b --- /dev/null +++ b/src/conductor/client/codegen/models/enum_reserved_range.py @@ -0,0 +1,370 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumReservedRange(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'EnumReservedRange', + 'descriptor_for_type': 'Descriptor', + 'end': 'int', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserEnumReservedRange', + 'serialized_size': 'int', + 'start': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'end': 'end', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'start': 'start', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, end=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, start=None, unknown_fields=None): # noqa: E501 + """EnumReservedRange - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._end = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._start = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if end is not None: + self.end = end + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if start is not None: + self.start = start + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this EnumReservedRange. # noqa: E501 + + + :return: The all_fields of this EnumReservedRange. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EnumReservedRange. + + + :param all_fields: The all_fields of this EnumReservedRange. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EnumReservedRange. # noqa: E501 + + + :return: The default_instance_for_type of this EnumReservedRange. # noqa: E501 + :rtype: EnumReservedRange + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EnumReservedRange. + + + :param default_instance_for_type: The default_instance_for_type of this EnumReservedRange. # noqa: E501 + :type: EnumReservedRange + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EnumReservedRange. # noqa: E501 + + + :return: The descriptor_for_type of this EnumReservedRange. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EnumReservedRange. + + + :param descriptor_for_type: The descriptor_for_type of this EnumReservedRange. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def end(self): + """Gets the end of this EnumReservedRange. # noqa: E501 + + + :return: The end of this EnumReservedRange. # noqa: E501 + :rtype: int + """ + return self._end + + @end.setter + def end(self, end): + """Sets the end of this EnumReservedRange. + + + :param end: The end of this EnumReservedRange. # noqa: E501 + :type: int + """ + + self._end = end + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EnumReservedRange. # noqa: E501 + + + :return: The initialization_error_string of this EnumReservedRange. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EnumReservedRange. + + + :param initialization_error_string: The initialization_error_string of this EnumReservedRange. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EnumReservedRange. # noqa: E501 + + + :return: The initialized of this EnumReservedRange. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EnumReservedRange. + + + :param initialized: The initialized of this EnumReservedRange. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this EnumReservedRange. # noqa: E501 + + + :return: The memoized_serialized_size of this EnumReservedRange. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this EnumReservedRange. + + + :param memoized_serialized_size: The memoized_serialized_size of this EnumReservedRange. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this EnumReservedRange. # noqa: E501 + + + :return: The parser_for_type of this EnumReservedRange. # noqa: E501 + :rtype: ParserEnumReservedRange + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this EnumReservedRange. + + + :param parser_for_type: The parser_for_type of this EnumReservedRange. # noqa: E501 + :type: ParserEnumReservedRange + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this EnumReservedRange. # noqa: E501 + + + :return: The serialized_size of this EnumReservedRange. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this EnumReservedRange. + + + :param serialized_size: The serialized_size of this EnumReservedRange. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def start(self): + """Gets the start of this EnumReservedRange. # noqa: E501 + + + :return: The start of this EnumReservedRange. # noqa: E501 + :rtype: int + """ + return self._start + + @start.setter + def start(self, start): + """Sets the start of this EnumReservedRange. + + + :param start: The start of this EnumReservedRange. # noqa: E501 + :type: int + """ + + self._start = start + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EnumReservedRange. # noqa: E501 + + + :return: The unknown_fields of this EnumReservedRange. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EnumReservedRange. + + + :param unknown_fields: The unknown_fields of this EnumReservedRange. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumReservedRange, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumReservedRange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_reserved_range_or_builder.py b/src/conductor/client/codegen/models/enum_reserved_range_or_builder.py new file mode 100644 index 00000000..e734ba72 --- /dev/null +++ b/src/conductor/client/codegen/models/enum_reserved_range_or_builder.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumReservedRangeOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'end': 'int', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'start': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'end': 'end', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'start': 'start', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, end=None, initialization_error_string=None, initialized=None, start=None, unknown_fields=None): # noqa: E501 + """EnumReservedRangeOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._end = None + self._initialization_error_string = None + self._initialized = None + self._start = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if end is not None: + self.end = end + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if start is not None: + self.start = start + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this EnumReservedRangeOrBuilder. # noqa: E501 + + + :return: The all_fields of this EnumReservedRangeOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EnumReservedRangeOrBuilder. + + + :param all_fields: The all_fields of this EnumReservedRangeOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EnumReservedRangeOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this EnumReservedRangeOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EnumReservedRangeOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this EnumReservedRangeOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EnumReservedRangeOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this EnumReservedRangeOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EnumReservedRangeOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this EnumReservedRangeOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def end(self): + """Gets the end of this EnumReservedRangeOrBuilder. # noqa: E501 + + + :return: The end of this EnumReservedRangeOrBuilder. # noqa: E501 + :rtype: int + """ + return self._end + + @end.setter + def end(self, end): + """Sets the end of this EnumReservedRangeOrBuilder. + + + :param end: The end of this EnumReservedRangeOrBuilder. # noqa: E501 + :type: int + """ + + self._end = end + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EnumReservedRangeOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this EnumReservedRangeOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EnumReservedRangeOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this EnumReservedRangeOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EnumReservedRangeOrBuilder. # noqa: E501 + + + :return: The initialized of this EnumReservedRangeOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EnumReservedRangeOrBuilder. + + + :param initialized: The initialized of this EnumReservedRangeOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def start(self): + """Gets the start of this EnumReservedRangeOrBuilder. # noqa: E501 + + + :return: The start of this EnumReservedRangeOrBuilder. # noqa: E501 + :rtype: int + """ + return self._start + + @start.setter + def start(self, start): + """Sets the start of this EnumReservedRangeOrBuilder. + + + :param start: The start of this EnumReservedRangeOrBuilder. # noqa: E501 + :type: int + """ + + self._start = start + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EnumReservedRangeOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this EnumReservedRangeOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EnumReservedRangeOrBuilder. + + + :param unknown_fields: The unknown_fields of this EnumReservedRangeOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumReservedRangeOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumReservedRangeOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_value_descriptor.py b/src/conductor/client/codegen/models/enum_value_descriptor.py new file mode 100644 index 00000000..23a74023 --- /dev/null +++ b/src/conductor/client/codegen/models/enum_value_descriptor.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumValueDescriptor(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'file': 'FileDescriptor', + 'full_name': 'str', + 'index': 'int', + 'name': 'str', + 'number': 'int', + 'options': 'EnumValueOptions', + 'proto': 'EnumValueDescriptorProto', + 'type': 'EnumDescriptor' + } + + attribute_map = { + 'file': 'file', + 'full_name': 'fullName', + 'index': 'index', + 'name': 'name', + 'number': 'number', + 'options': 'options', + 'proto': 'proto', + 'type': 'type' + } + + def __init__(self, file=None, full_name=None, index=None, name=None, number=None, options=None, proto=None, type=None): # noqa: E501 + """EnumValueDescriptor - a model defined in Swagger""" # noqa: E501 + self._file = None + self._full_name = None + self._index = None + self._name = None + self._number = None + self._options = None + self._proto = None + self._type = None + self.discriminator = None + if file is not None: + self.file = file + if full_name is not None: + self.full_name = full_name + if index is not None: + self.index = index + if name is not None: + self.name = name + if number is not None: + self.number = number + if options is not None: + self.options = options + if proto is not None: + self.proto = proto + if type is not None: + self.type = type + + @property + def file(self): + """Gets the file of this EnumValueDescriptor. # noqa: E501 + + + :return: The file of this EnumValueDescriptor. # noqa: E501 + :rtype: FileDescriptor + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this EnumValueDescriptor. + + + :param file: The file of this EnumValueDescriptor. # noqa: E501 + :type: FileDescriptor + """ + + self._file = file + + @property + def full_name(self): + """Gets the full_name of this EnumValueDescriptor. # noqa: E501 + + + :return: The full_name of this EnumValueDescriptor. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this EnumValueDescriptor. + + + :param full_name: The full_name of this EnumValueDescriptor. # noqa: E501 + :type: str + """ + + self._full_name = full_name + + @property + def index(self): + """Gets the index of this EnumValueDescriptor. # noqa: E501 + + + :return: The index of this EnumValueDescriptor. # noqa: E501 + :rtype: int + """ + return self._index + + @index.setter + def index(self, index): + """Sets the index of this EnumValueDescriptor. + + + :param index: The index of this EnumValueDescriptor. # noqa: E501 + :type: int + """ + + self._index = index + + @property + def name(self): + """Gets the name of this EnumValueDescriptor. # noqa: E501 + + + :return: The name of this EnumValueDescriptor. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EnumValueDescriptor. + + + :param name: The name of this EnumValueDescriptor. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def number(self): + """Gets the number of this EnumValueDescriptor. # noqa: E501 + + + :return: The number of this EnumValueDescriptor. # noqa: E501 + :rtype: int + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this EnumValueDescriptor. + + + :param number: The number of this EnumValueDescriptor. # noqa: E501 + :type: int + """ + + self._number = number + + @property + def options(self): + """Gets the options of this EnumValueDescriptor. # noqa: E501 + + + :return: The options of this EnumValueDescriptor. # noqa: E501 + :rtype: EnumValueOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this EnumValueDescriptor. + + + :param options: The options of this EnumValueDescriptor. # noqa: E501 + :type: EnumValueOptions + """ + + self._options = options + + @property + def proto(self): + """Gets the proto of this EnumValueDescriptor. # noqa: E501 + + + :return: The proto of this EnumValueDescriptor. # noqa: E501 + :rtype: EnumValueDescriptorProto + """ + return self._proto + + @proto.setter + def proto(self, proto): + """Sets the proto of this EnumValueDescriptor. + + + :param proto: The proto of this EnumValueDescriptor. # noqa: E501 + :type: EnumValueDescriptorProto + """ + + self._proto = proto + + @property + def type(self): + """Gets the type of this EnumValueDescriptor. # noqa: E501 + + + :return: The type of this EnumValueDescriptor. # noqa: E501 + :rtype: EnumDescriptor + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this EnumValueDescriptor. + + + :param type: The type of this EnumValueDescriptor. # noqa: E501 + :type: EnumDescriptor + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumValueDescriptor, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumValueDescriptor): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_value_descriptor_proto.py b/src/conductor/client/codegen/models/enum_value_descriptor_proto.py new file mode 100644 index 00000000..930f50ef --- /dev/null +++ b/src/conductor/client/codegen/models/enum_value_descriptor_proto.py @@ -0,0 +1,448 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumValueDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'EnumValueDescriptorProto', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'name': 'str', + 'name_bytes': 'ByteString', + 'number': 'int', + 'options': 'EnumValueOptions', + 'options_or_builder': 'EnumValueOptionsOrBuilder', + 'parser_for_type': 'ParserEnumValueDescriptorProto', + 'serialized_size': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'number': 'number', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, name=None, name_bytes=None, number=None, options=None, options_or_builder=None, parser_for_type=None, serialized_size=None, unknown_fields=None): # noqa: E501 + """EnumValueDescriptorProto - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._name = None + self._name_bytes = None + self._number = None + self._options = None + self._options_or_builder = None + self._parser_for_type = None + self._serialized_size = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if number is not None: + self.number = number + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The all_fields of this EnumValueDescriptorProto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EnumValueDescriptorProto. + + + :param all_fields: The all_fields of this EnumValueDescriptorProto. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The default_instance_for_type of this EnumValueDescriptorProto. # noqa: E501 + :rtype: EnumValueDescriptorProto + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EnumValueDescriptorProto. + + + :param default_instance_for_type: The default_instance_for_type of this EnumValueDescriptorProto. # noqa: E501 + :type: EnumValueDescriptorProto + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The descriptor_for_type of this EnumValueDescriptorProto. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EnumValueDescriptorProto. + + + :param descriptor_for_type: The descriptor_for_type of this EnumValueDescriptorProto. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The initialization_error_string of this EnumValueDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EnumValueDescriptorProto. + + + :param initialization_error_string: The initialization_error_string of this EnumValueDescriptorProto. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The initialized of this EnumValueDescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EnumValueDescriptorProto. + + + :param initialized: The initialized of this EnumValueDescriptorProto. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The memoized_serialized_size of this EnumValueDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this EnumValueDescriptorProto. + + + :param memoized_serialized_size: The memoized_serialized_size of this EnumValueDescriptorProto. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def name(self): + """Gets the name of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The name of this EnumValueDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EnumValueDescriptorProto. + + + :param name: The name of this EnumValueDescriptorProto. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The name_bytes of this EnumValueDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this EnumValueDescriptorProto. + + + :param name_bytes: The name_bytes of this EnumValueDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def number(self): + """Gets the number of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The number of this EnumValueDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this EnumValueDescriptorProto. + + + :param number: The number of this EnumValueDescriptorProto. # noqa: E501 + :type: int + """ + + self._number = number + + @property + def options(self): + """Gets the options of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The options of this EnumValueDescriptorProto. # noqa: E501 + :rtype: EnumValueOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this EnumValueDescriptorProto. + + + :param options: The options of this EnumValueDescriptorProto. # noqa: E501 + :type: EnumValueOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The options_or_builder of this EnumValueDescriptorProto. # noqa: E501 + :rtype: EnumValueOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this EnumValueDescriptorProto. + + + :param options_or_builder: The options_or_builder of this EnumValueDescriptorProto. # noqa: E501 + :type: EnumValueOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def parser_for_type(self): + """Gets the parser_for_type of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The parser_for_type of this EnumValueDescriptorProto. # noqa: E501 + :rtype: ParserEnumValueDescriptorProto + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this EnumValueDescriptorProto. + + + :param parser_for_type: The parser_for_type of this EnumValueDescriptorProto. # noqa: E501 + :type: ParserEnumValueDescriptorProto + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The serialized_size of this EnumValueDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this EnumValueDescriptorProto. + + + :param serialized_size: The serialized_size of this EnumValueDescriptorProto. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EnumValueDescriptorProto. # noqa: E501 + + + :return: The unknown_fields of this EnumValueDescriptorProto. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EnumValueDescriptorProto. + + + :param unknown_fields: The unknown_fields of this EnumValueDescriptorProto. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumValueDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumValueDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_value_descriptor_proto_or_builder.py b/src/conductor/client/codegen/models/enum_value_descriptor_proto_or_builder.py new file mode 100644 index 00000000..461dc0fd --- /dev/null +++ b/src/conductor/client/codegen/models/enum_value_descriptor_proto_or_builder.py @@ -0,0 +1,370 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumValueDescriptorProtoOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'name': 'str', + 'name_bytes': 'ByteString', + 'number': 'int', + 'options': 'EnumValueOptions', + 'options_or_builder': 'EnumValueOptionsOrBuilder', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'number': 'number', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, name=None, name_bytes=None, number=None, options=None, options_or_builder=None, unknown_fields=None): # noqa: E501 + """EnumValueDescriptorProtoOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._name = None + self._name_bytes = None + self._number = None + self._options = None + self._options_or_builder = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if number is not None: + self.number = number + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The all_fields of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EnumValueDescriptorProtoOrBuilder. + + + :param all_fields: The all_fields of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EnumValueDescriptorProtoOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EnumValueDescriptorProtoOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EnumValueDescriptorProtoOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialized of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EnumValueDescriptorProtoOrBuilder. + + + :param initialized: The initialized of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def name(self): + """Gets the name of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EnumValueDescriptorProtoOrBuilder. + + + :param name: The name of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name_bytes of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this EnumValueDescriptorProtoOrBuilder. + + + :param name_bytes: The name_bytes of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def number(self): + """Gets the number of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The number of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this EnumValueDescriptorProtoOrBuilder. + + + :param number: The number of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._number = number + + @property + def options(self): + """Gets the options of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: EnumValueOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this EnumValueDescriptorProtoOrBuilder. + + + :param options: The options of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: EnumValueOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options_or_builder of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: EnumValueOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this EnumValueDescriptorProtoOrBuilder. + + + :param options_or_builder: The options_or_builder of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: EnumValueOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EnumValueDescriptorProtoOrBuilder. + + + :param unknown_fields: The unknown_fields of this EnumValueDescriptorProtoOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumValueDescriptorProtoOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumValueDescriptorProtoOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_value_options.py b/src/conductor/client/codegen/models/enum_value_options.py new file mode 100644 index 00000000..ae5d3942 --- /dev/null +++ b/src/conductor/client/codegen/models/enum_value_options.py @@ -0,0 +1,526 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumValueOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'all_fields_raw': 'dict(str, object)', + 'debug_redact': 'bool', + 'default_instance_for_type': 'EnumValueOptions', + 'deprecated': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserEnumValueOptions', + 'serialized_size': 'int', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'all_fields_raw': 'allFieldsRaw', + 'debug_redact': 'debugRedact', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, all_fields_raw=None, debug_redact=None, default_instance_for_type=None, deprecated=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """EnumValueOptions - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._all_fields_raw = None + self._debug_redact = None + self._default_instance_for_type = None + self._deprecated = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if all_fields_raw is not None: + self.all_fields_raw = all_fields_raw + if debug_redact is not None: + self.debug_redact = debug_redact + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this EnumValueOptions. # noqa: E501 + + + :return: The all_fields of this EnumValueOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EnumValueOptions. + + + :param all_fields: The all_fields of this EnumValueOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def all_fields_raw(self): + """Gets the all_fields_raw of this EnumValueOptions. # noqa: E501 + + + :return: The all_fields_raw of this EnumValueOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields_raw + + @all_fields_raw.setter + def all_fields_raw(self, all_fields_raw): + """Sets the all_fields_raw of this EnumValueOptions. + + + :param all_fields_raw: The all_fields_raw of this EnumValueOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields_raw = all_fields_raw + + @property + def debug_redact(self): + """Gets the debug_redact of this EnumValueOptions. # noqa: E501 + + + :return: The debug_redact of this EnumValueOptions. # noqa: E501 + :rtype: bool + """ + return self._debug_redact + + @debug_redact.setter + def debug_redact(self, debug_redact): + """Sets the debug_redact of this EnumValueOptions. + + + :param debug_redact: The debug_redact of this EnumValueOptions. # noqa: E501 + :type: bool + """ + + self._debug_redact = debug_redact + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EnumValueOptions. # noqa: E501 + + + :return: The default_instance_for_type of this EnumValueOptions. # noqa: E501 + :rtype: EnumValueOptions + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EnumValueOptions. + + + :param default_instance_for_type: The default_instance_for_type of this EnumValueOptions. # noqa: E501 + :type: EnumValueOptions + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this EnumValueOptions. # noqa: E501 + + + :return: The deprecated of this EnumValueOptions. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this EnumValueOptions. + + + :param deprecated: The deprecated of this EnumValueOptions. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EnumValueOptions. # noqa: E501 + + + :return: The descriptor_for_type of this EnumValueOptions. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EnumValueOptions. + + + :param descriptor_for_type: The descriptor_for_type of this EnumValueOptions. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this EnumValueOptions. # noqa: E501 + + + :return: The features of this EnumValueOptions. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this EnumValueOptions. + + + :param features: The features of this EnumValueOptions. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this EnumValueOptions. # noqa: E501 + + + :return: The features_or_builder of this EnumValueOptions. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this EnumValueOptions. + + + :param features_or_builder: The features_or_builder of this EnumValueOptions. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EnumValueOptions. # noqa: E501 + + + :return: The initialization_error_string of this EnumValueOptions. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EnumValueOptions. + + + :param initialization_error_string: The initialization_error_string of this EnumValueOptions. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EnumValueOptions. # noqa: E501 + + + :return: The initialized of this EnumValueOptions. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EnumValueOptions. + + + :param initialized: The initialized of this EnumValueOptions. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this EnumValueOptions. # noqa: E501 + + + :return: The memoized_serialized_size of this EnumValueOptions. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this EnumValueOptions. + + + :param memoized_serialized_size: The memoized_serialized_size of this EnumValueOptions. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this EnumValueOptions. # noqa: E501 + + + :return: The parser_for_type of this EnumValueOptions. # noqa: E501 + :rtype: ParserEnumValueOptions + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this EnumValueOptions. + + + :param parser_for_type: The parser_for_type of this EnumValueOptions. # noqa: E501 + :type: ParserEnumValueOptions + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this EnumValueOptions. # noqa: E501 + + + :return: The serialized_size of this EnumValueOptions. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this EnumValueOptions. + + + :param serialized_size: The serialized_size of this EnumValueOptions. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this EnumValueOptions. # noqa: E501 + + + :return: The uninterpreted_option_count of this EnumValueOptions. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this EnumValueOptions. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this EnumValueOptions. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this EnumValueOptions. # noqa: E501 + + + :return: The uninterpreted_option_list of this EnumValueOptions. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this EnumValueOptions. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this EnumValueOptions. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this EnumValueOptions. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this EnumValueOptions. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this EnumValueOptions. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this EnumValueOptions. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EnumValueOptions. # noqa: E501 + + + :return: The unknown_fields of this EnumValueOptions. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EnumValueOptions. + + + :param unknown_fields: The unknown_fields of this EnumValueOptions. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumValueOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumValueOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/enum_value_options_or_builder.py b/src/conductor/client/codegen/models/enum_value_options_or_builder.py new file mode 100644 index 00000000..811c1d3f --- /dev/null +++ b/src/conductor/client/codegen/models/enum_value_options_or_builder.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnumValueOptionsOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'debug_redact': 'bool', + 'default_instance_for_type': 'Message', + 'deprecated': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'debug_redact': 'debugRedact', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, debug_redact=None, default_instance_for_type=None, deprecated=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """EnumValueOptionsOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._debug_redact = None + self._default_instance_for_type = None + self._deprecated = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if debug_redact is not None: + self.debug_redact = debug_redact + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The all_fields of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this EnumValueOptionsOrBuilder. + + + :param all_fields: The all_fields of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def debug_redact(self): + """Gets the debug_redact of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The debug_redact of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._debug_redact + + @debug_redact.setter + def debug_redact(self, debug_redact): + """Sets the debug_redact of this EnumValueOptionsOrBuilder. + + + :param debug_redact: The debug_redact of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._debug_redact = debug_redact + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this EnumValueOptionsOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The deprecated of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this EnumValueOptionsOrBuilder. + + + :param deprecated: The deprecated of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this EnumValueOptionsOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The features of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this EnumValueOptionsOrBuilder. + + + :param features: The features of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The features_or_builder of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this EnumValueOptionsOrBuilder. + + + :param features_or_builder: The features_or_builder of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this EnumValueOptionsOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The initialized of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this EnumValueOptionsOrBuilder. + + + :param initialized: The initialized of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_count of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this EnumValueOptionsOrBuilder. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_list of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this EnumValueOptionsOrBuilder. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this EnumValueOptionsOrBuilder. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this EnumValueOptionsOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this EnumValueOptionsOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this EnumValueOptionsOrBuilder. + + + :param unknown_fields: The unknown_fields of this EnumValueOptionsOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumValueOptionsOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumValueOptionsOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/environment_variable.py b/src/conductor/client/codegen/models/environment_variable.py new file mode 100644 index 00000000..6190debd --- /dev/null +++ b/src/conductor/client/codegen/models/environment_variable.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EnvironmentVariable(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'tags': 'list[Tag]', + 'value': 'str' + } + + attribute_map = { + 'name': 'name', + 'tags': 'tags', + 'value': 'value' + } + + def __init__(self, name=None, tags=None, value=None): # noqa: E501 + """EnvironmentVariable - a model defined in Swagger""" # noqa: E501 + self._name = None + self._tags = None + self._value = None + self.discriminator = None + if name is not None: + self.name = name + if tags is not None: + self.tags = tags + if value is not None: + self.value = value + + @property + def name(self): + """Gets the name of this EnvironmentVariable. # noqa: E501 + + + :return: The name of this EnvironmentVariable. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EnvironmentVariable. + + + :param name: The name of this EnvironmentVariable. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def tags(self): + """Gets the tags of this EnvironmentVariable. # noqa: E501 + + + :return: The tags of this EnvironmentVariable. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this EnvironmentVariable. + + + :param tags: The tags of this EnvironmentVariable. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def value(self): + """Gets the value of this EnvironmentVariable. # noqa: E501 + + + :return: The value of this EnvironmentVariable. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this EnvironmentVariable. + + + :param value: The value of this EnvironmentVariable. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnvironmentVariable, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnvironmentVariable): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/event_handler.py b/src/conductor/client/codegen/models/event_handler.py new file mode 100644 index 00000000..abbf3391 --- /dev/null +++ b/src/conductor/client/codegen/models/event_handler.py @@ -0,0 +1,344 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EventHandler(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'actions': 'list[Action]', + 'active': 'bool', + 'condition': 'str', + 'created_by': 'str', + 'description': 'str', + 'evaluator_type': 'str', + 'event': 'str', + 'name': 'str', + 'org_id': 'str', + 'tags': 'list[Tag]' + } + + attribute_map = { + 'actions': 'actions', + 'active': 'active', + 'condition': 'condition', + 'created_by': 'createdBy', + 'description': 'description', + 'evaluator_type': 'evaluatorType', + 'event': 'event', + 'name': 'name', + 'org_id': 'orgId', + 'tags': 'tags' + } + + def __init__(self, actions=None, active=None, condition=None, created_by=None, description=None, evaluator_type=None, event=None, name=None, org_id=None, tags=None): # noqa: E501 + """EventHandler - a model defined in Swagger""" # noqa: E501 + self._actions = None + self._active = None + self._condition = None + self._created_by = None + self._description = None + self._evaluator_type = None + self._event = None + self._name = None + self._org_id = None + self._tags = None + self.discriminator = None + if actions is not None: + self.actions = actions + if active is not None: + self.active = active + if condition is not None: + self.condition = condition + if created_by is not None: + self.created_by = created_by + if description is not None: + self.description = description + if evaluator_type is not None: + self.evaluator_type = evaluator_type + if event is not None: + self.event = event + if name is not None: + self.name = name + if org_id is not None: + self.org_id = org_id + if tags is not None: + self.tags = tags + + @property + def actions(self): + """Gets the actions of this EventHandler. # noqa: E501 + + + :return: The actions of this EventHandler. # noqa: E501 + :rtype: list[Action] + """ + return self._actions + + @actions.setter + def actions(self, actions): + """Sets the actions of this EventHandler. + + + :param actions: The actions of this EventHandler. # noqa: E501 + :type: list[Action] + """ + + self._actions = actions + + @property + def active(self): + """Gets the active of this EventHandler. # noqa: E501 + + + :return: The active of this EventHandler. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this EventHandler. + + + :param active: The active of this EventHandler. # noqa: E501 + :type: bool + """ + + self._active = active + + @property + def condition(self): + """Gets the condition of this EventHandler. # noqa: E501 + + + :return: The condition of this EventHandler. # noqa: E501 + :rtype: str + """ + return self._condition + + @condition.setter + def condition(self, condition): + """Sets the condition of this EventHandler. + + + :param condition: The condition of this EventHandler. # noqa: E501 + :type: str + """ + + self._condition = condition + + @property + def created_by(self): + """Gets the created_by of this EventHandler. # noqa: E501 + + + :return: The created_by of this EventHandler. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this EventHandler. + + + :param created_by: The created_by of this EventHandler. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def description(self): + """Gets the description of this EventHandler. # noqa: E501 + + + :return: The description of this EventHandler. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this EventHandler. + + + :param description: The description of this EventHandler. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def evaluator_type(self): + """Gets the evaluator_type of this EventHandler. # noqa: E501 + + + :return: The evaluator_type of this EventHandler. # noqa: E501 + :rtype: str + """ + return self._evaluator_type + + @evaluator_type.setter + def evaluator_type(self, evaluator_type): + """Sets the evaluator_type of this EventHandler. + + + :param evaluator_type: The evaluator_type of this EventHandler. # noqa: E501 + :type: str + """ + + self._evaluator_type = evaluator_type + + @property + def event(self): + """Gets the event of this EventHandler. # noqa: E501 + + + :return: The event of this EventHandler. # noqa: E501 + :rtype: str + """ + return self._event + + @event.setter + def event(self, event): + """Sets the event of this EventHandler. + + + :param event: The event of this EventHandler. # noqa: E501 + :type: str + """ + + self._event = event + + @property + def name(self): + """Gets the name of this EventHandler. # noqa: E501 + + + :return: The name of this EventHandler. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EventHandler. + + + :param name: The name of this EventHandler. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def org_id(self): + """Gets the org_id of this EventHandler. # noqa: E501 + + + :return: The org_id of this EventHandler. # noqa: E501 + :rtype: str + """ + return self._org_id + + @org_id.setter + def org_id(self, org_id): + """Sets the org_id of this EventHandler. + + + :param org_id: The org_id of this EventHandler. # noqa: E501 + :type: str + """ + + self._org_id = org_id + + @property + def tags(self): + """Gets the tags of this EventHandler. # noqa: E501 + + + :return: The tags of this EventHandler. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this EventHandler. + + + :param tags: The tags of this EventHandler. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EventHandler, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EventHandler): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/event_log.py b/src/conductor/client/codegen/models/event_log.py new file mode 100644 index 00000000..58dd5e3b --- /dev/null +++ b/src/conductor/client/codegen/models/event_log.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EventLog(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'int', + 'event': 'str', + 'event_type': 'str', + 'handler_name': 'str', + 'id': 'str', + 'task_id': 'str', + 'worker_id': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'event': 'event', + 'event_type': 'eventType', + 'handler_name': 'handlerName', + 'id': 'id', + 'task_id': 'taskId', + 'worker_id': 'workerId' + } + + def __init__(self, created_at=None, event=None, event_type=None, handler_name=None, id=None, task_id=None, worker_id=None): # noqa: E501 + """EventLog - a model defined in Swagger""" # noqa: E501 + self._created_at = None + self._event = None + self._event_type = None + self._handler_name = None + self._id = None + self._task_id = None + self._worker_id = None + self.discriminator = None + if created_at is not None: + self.created_at = created_at + if event is not None: + self.event = event + if event_type is not None: + self.event_type = event_type + if handler_name is not None: + self.handler_name = handler_name + if id is not None: + self.id = id + if task_id is not None: + self.task_id = task_id + if worker_id is not None: + self.worker_id = worker_id + + @property + def created_at(self): + """Gets the created_at of this EventLog. # noqa: E501 + + + :return: The created_at of this EventLog. # noqa: E501 + :rtype: int + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this EventLog. + + + :param created_at: The created_at of this EventLog. # noqa: E501 + :type: int + """ + + self._created_at = created_at + + @property + def event(self): + """Gets the event of this EventLog. # noqa: E501 + + + :return: The event of this EventLog. # noqa: E501 + :rtype: str + """ + return self._event + + @event.setter + def event(self, event): + """Sets the event of this EventLog. + + + :param event: The event of this EventLog. # noqa: E501 + :type: str + """ + + self._event = event + + @property + def event_type(self): + """Gets the event_type of this EventLog. # noqa: E501 + + + :return: The event_type of this EventLog. # noqa: E501 + :rtype: str + """ + return self._event_type + + @event_type.setter + def event_type(self, event_type): + """Sets the event_type of this EventLog. + + + :param event_type: The event_type of this EventLog. # noqa: E501 + :type: str + """ + allowed_values = ["SEND", "RECEIVE"] # noqa: E501 + if event_type not in allowed_values: + raise ValueError( + "Invalid value for `event_type` ({0}), must be one of {1}" # noqa: E501 + .format(event_type, allowed_values) + ) + + self._event_type = event_type + + @property + def handler_name(self): + """Gets the handler_name of this EventLog. # noqa: E501 + + + :return: The handler_name of this EventLog. # noqa: E501 + :rtype: str + """ + return self._handler_name + + @handler_name.setter + def handler_name(self, handler_name): + """Sets the handler_name of this EventLog. + + + :param handler_name: The handler_name of this EventLog. # noqa: E501 + :type: str + """ + + self._handler_name = handler_name + + @property + def id(self): + """Gets the id of this EventLog. # noqa: E501 + + + :return: The id of this EventLog. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this EventLog. + + + :param id: The id of this EventLog. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def task_id(self): + """Gets the task_id of this EventLog. # noqa: E501 + + + :return: The task_id of this EventLog. # noqa: E501 + :rtype: str + """ + return self._task_id + + @task_id.setter + def task_id(self, task_id): + """Sets the task_id of this EventLog. + + + :param task_id: The task_id of this EventLog. # noqa: E501 + :type: str + """ + + self._task_id = task_id + + @property + def worker_id(self): + """Gets the worker_id of this EventLog. # noqa: E501 + + + :return: The worker_id of this EventLog. # noqa: E501 + :rtype: str + """ + return self._worker_id + + @worker_id.setter + def worker_id(self, worker_id): + """Sets the worker_id of this EventLog. + + + :param worker_id: The worker_id of this EventLog. # noqa: E501 + :type: str + """ + + self._worker_id = worker_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EventLog, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EventLog): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/event_message.py b/src/conductor/client/codegen/models/event_message.py new file mode 100644 index 00000000..868767dc --- /dev/null +++ b/src/conductor/client/codegen/models/event_message.py @@ -0,0 +1,356 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EventMessage(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'int', + 'event_executions': 'list[ExtendedEventExecution]', + 'event_target': 'str', + 'event_type': 'str', + 'full_payload': 'object', + 'id': 'str', + 'org_id': 'str', + 'payload': 'str', + 'status': 'str', + 'status_description': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'event_executions': 'eventExecutions', + 'event_target': 'eventTarget', + 'event_type': 'eventType', + 'full_payload': 'fullPayload', + 'id': 'id', + 'org_id': 'orgId', + 'payload': 'payload', + 'status': 'status', + 'status_description': 'statusDescription' + } + + def __init__(self, created_at=None, event_executions=None, event_target=None, event_type=None, full_payload=None, id=None, org_id=None, payload=None, status=None, status_description=None): # noqa: E501 + """EventMessage - a model defined in Swagger""" # noqa: E501 + self._created_at = None + self._event_executions = None + self._event_target = None + self._event_type = None + self._full_payload = None + self._id = None + self._org_id = None + self._payload = None + self._status = None + self._status_description = None + self.discriminator = None + if created_at is not None: + self.created_at = created_at + if event_executions is not None: + self.event_executions = event_executions + if event_target is not None: + self.event_target = event_target + if event_type is not None: + self.event_type = event_type + if full_payload is not None: + self.full_payload = full_payload + if id is not None: + self.id = id + if org_id is not None: + self.org_id = org_id + if payload is not None: + self.payload = payload + if status is not None: + self.status = status + if status_description is not None: + self.status_description = status_description + + @property + def created_at(self): + """Gets the created_at of this EventMessage. # noqa: E501 + + + :return: The created_at of this EventMessage. # noqa: E501 + :rtype: int + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this EventMessage. + + + :param created_at: The created_at of this EventMessage. # noqa: E501 + :type: int + """ + + self._created_at = created_at + + @property + def event_executions(self): + """Gets the event_executions of this EventMessage. # noqa: E501 + + + :return: The event_executions of this EventMessage. # noqa: E501 + :rtype: list[ExtendedEventExecution] + """ + return self._event_executions + + @event_executions.setter + def event_executions(self, event_executions): + """Sets the event_executions of this EventMessage. + + + :param event_executions: The event_executions of this EventMessage. # noqa: E501 + :type: list[ExtendedEventExecution] + """ + + self._event_executions = event_executions + + @property + def event_target(self): + """Gets the event_target of this EventMessage. # noqa: E501 + + + :return: The event_target of this EventMessage. # noqa: E501 + :rtype: str + """ + return self._event_target + + @event_target.setter + def event_target(self, event_target): + """Sets the event_target of this EventMessage. + + + :param event_target: The event_target of this EventMessage. # noqa: E501 + :type: str + """ + + self._event_target = event_target + + @property + def event_type(self): + """Gets the event_type of this EventMessage. # noqa: E501 + + + :return: The event_type of this EventMessage. # noqa: E501 + :rtype: str + """ + return self._event_type + + @event_type.setter + def event_type(self, event_type): + """Sets the event_type of this EventMessage. + + + :param event_type: The event_type of this EventMessage. # noqa: E501 + :type: str + """ + allowed_values = ["WEBHOOK", "MESSAGE"] # noqa: E501 + if event_type not in allowed_values: + raise ValueError( + "Invalid value for `event_type` ({0}), must be one of {1}" # noqa: E501 + .format(event_type, allowed_values) + ) + + self._event_type = event_type + + @property + def full_payload(self): + """Gets the full_payload of this EventMessage. # noqa: E501 + + + :return: The full_payload of this EventMessage. # noqa: E501 + :rtype: object + """ + return self._full_payload + + @full_payload.setter + def full_payload(self, full_payload): + """Sets the full_payload of this EventMessage. + + + :param full_payload: The full_payload of this EventMessage. # noqa: E501 + :type: object + """ + + self._full_payload = full_payload + + @property + def id(self): + """Gets the id of this EventMessage. # noqa: E501 + + + :return: The id of this EventMessage. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this EventMessage. + + + :param id: The id of this EventMessage. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def org_id(self): + """Gets the org_id of this EventMessage. # noqa: E501 + + + :return: The org_id of this EventMessage. # noqa: E501 + :rtype: str + """ + return self._org_id + + @org_id.setter + def org_id(self, org_id): + """Sets the org_id of this EventMessage. + + + :param org_id: The org_id of this EventMessage. # noqa: E501 + :type: str + """ + + self._org_id = org_id + + @property + def payload(self): + """Gets the payload of this EventMessage. # noqa: E501 + + + :return: The payload of this EventMessage. # noqa: E501 + :rtype: str + """ + return self._payload + + @payload.setter + def payload(self, payload): + """Sets the payload of this EventMessage. + + + :param payload: The payload of this EventMessage. # noqa: E501 + :type: str + """ + + self._payload = payload + + @property + def status(self): + """Gets the status of this EventMessage. # noqa: E501 + + + :return: The status of this EventMessage. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this EventMessage. + + + :param status: The status of this EventMessage. # noqa: E501 + :type: str + """ + allowed_values = ["RECEIVED", "HANDLED", "REJECTED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def status_description(self): + """Gets the status_description of this EventMessage. # noqa: E501 + + + :return: The status_description of this EventMessage. # noqa: E501 + :rtype: str + """ + return self._status_description + + @status_description.setter + def status_description(self, status_description): + """Sets the status_description of this EventMessage. + + + :param status_description: The status_description of this EventMessage. # noqa: E501 + :type: str + """ + + self._status_description = status_description + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EventMessage, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EventMessage): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/extended_conductor_application.py b/src/conductor/client/codegen/models/extended_conductor_application.py new file mode 100644 index 00000000..76830a1a --- /dev/null +++ b/src/conductor/client/codegen/models/extended_conductor_application.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ExtendedConductorApplication(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'create_time': 'int', + 'created_by': 'str', + 'id': 'str', + 'name': 'str', + 'tags': 'list[Tag]', + 'update_time': 'int', + 'updated_by': 'str' + } + + attribute_map = { + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'id': 'id', + 'name': 'name', + 'tags': 'tags', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy' + } + + def __init__(self, create_time=None, created_by=None, id=None, name=None, tags=None, update_time=None, updated_by=None): # noqa: E501 + """ExtendedConductorApplication - a model defined in Swagger""" # noqa: E501 + self._create_time = None + self._created_by = None + self._id = None + self._name = None + self._tags = None + self._update_time = None + self._updated_by = None + self.discriminator = None + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if id is not None: + self.id = id + if name is not None: + self.name = name + if tags is not None: + self.tags = tags + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + + @property + def create_time(self): + """Gets the create_time of this ExtendedConductorApplication. # noqa: E501 + + + :return: The create_time of this ExtendedConductorApplication. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this ExtendedConductorApplication. + + + :param create_time: The create_time of this ExtendedConductorApplication. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this ExtendedConductorApplication. # noqa: E501 + + + :return: The created_by of this ExtendedConductorApplication. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this ExtendedConductorApplication. + + + :param created_by: The created_by of this ExtendedConductorApplication. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def id(self): + """Gets the id of this ExtendedConductorApplication. # noqa: E501 + + + :return: The id of this ExtendedConductorApplication. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ExtendedConductorApplication. + + + :param id: The id of this ExtendedConductorApplication. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this ExtendedConductorApplication. # noqa: E501 + + + :return: The name of this ExtendedConductorApplication. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ExtendedConductorApplication. + + + :param name: The name of this ExtendedConductorApplication. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def tags(self): + """Gets the tags of this ExtendedConductorApplication. # noqa: E501 + + + :return: The tags of this ExtendedConductorApplication. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this ExtendedConductorApplication. + + + :param tags: The tags of this ExtendedConductorApplication. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def update_time(self): + """Gets the update_time of this ExtendedConductorApplication. # noqa: E501 + + + :return: The update_time of this ExtendedConductorApplication. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this ExtendedConductorApplication. + + + :param update_time: The update_time of this ExtendedConductorApplication. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this ExtendedConductorApplication. # noqa: E501 + + + :return: The updated_by of this ExtendedConductorApplication. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this ExtendedConductorApplication. + + + :param updated_by: The updated_by of this ExtendedConductorApplication. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExtendedConductorApplication, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExtendedConductorApplication): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/extended_event_execution.py b/src/conductor/client/codegen/models/extended_event_execution.py new file mode 100644 index 00000000..a7e2db64 --- /dev/null +++ b/src/conductor/client/codegen/models/extended_event_execution.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ExtendedEventExecution(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'action': 'str', + 'created': 'int', + 'event': 'str', + 'event_handler': 'EventHandler', + 'full_message_payload': 'dict(str, object)', + 'id': 'str', + 'message_id': 'str', + 'name': 'str', + 'org_id': 'str', + 'output': 'dict(str, object)', + 'payload': 'dict(str, object)', + 'status': 'str', + 'status_description': 'str' + } + + attribute_map = { + 'action': 'action', + 'created': 'created', + 'event': 'event', + 'event_handler': 'eventHandler', + 'full_message_payload': 'fullMessagePayload', + 'id': 'id', + 'message_id': 'messageId', + 'name': 'name', + 'org_id': 'orgId', + 'output': 'output', + 'payload': 'payload', + 'status': 'status', + 'status_description': 'statusDescription' + } + + def __init__(self, action=None, created=None, event=None, event_handler=None, full_message_payload=None, id=None, message_id=None, name=None, org_id=None, output=None, payload=None, status=None, status_description=None): # noqa: E501 + """ExtendedEventExecution - a model defined in Swagger""" # noqa: E501 + self._action = None + self._created = None + self._event = None + self._event_handler = None + self._full_message_payload = None + self._id = None + self._message_id = None + self._name = None + self._org_id = None + self._output = None + self._payload = None + self._status = None + self._status_description = None + self.discriminator = None + if action is not None: + self.action = action + if created is not None: + self.created = created + if event is not None: + self.event = event + if event_handler is not None: + self.event_handler = event_handler + if full_message_payload is not None: + self.full_message_payload = full_message_payload + if id is not None: + self.id = id + if message_id is not None: + self.message_id = message_id + if name is not None: + self.name = name + if org_id is not None: + self.org_id = org_id + if output is not None: + self.output = output + if payload is not None: + self.payload = payload + if status is not None: + self.status = status + if status_description is not None: + self.status_description = status_description + + @property + def action(self): + """Gets the action of this ExtendedEventExecution. # noqa: E501 + + + :return: The action of this ExtendedEventExecution. # noqa: E501 + :rtype: str + """ + return self._action + + @action.setter + def action(self, action): + """Sets the action of this ExtendedEventExecution. + + + :param action: The action of this ExtendedEventExecution. # noqa: E501 + :type: str + """ + allowed_values = ["start_workflow", "complete_task", "fail_task", "terminate_workflow", "update_workflow_variables"] # noqa: E501 + if action not in allowed_values: + raise ValueError( + "Invalid value for `action` ({0}), must be one of {1}" # noqa: E501 + .format(action, allowed_values) + ) + + self._action = action + + @property + def created(self): + """Gets the created of this ExtendedEventExecution. # noqa: E501 + + + :return: The created of this ExtendedEventExecution. # noqa: E501 + :rtype: int + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ExtendedEventExecution. + + + :param created: The created of this ExtendedEventExecution. # noqa: E501 + :type: int + """ + + self._created = created + + @property + def event(self): + """Gets the event of this ExtendedEventExecution. # noqa: E501 + + + :return: The event of this ExtendedEventExecution. # noqa: E501 + :rtype: str + """ + return self._event + + @event.setter + def event(self, event): + """Sets the event of this ExtendedEventExecution. + + + :param event: The event of this ExtendedEventExecution. # noqa: E501 + :type: str + """ + + self._event = event + + @property + def event_handler(self): + """Gets the event_handler of this ExtendedEventExecution. # noqa: E501 + + + :return: The event_handler of this ExtendedEventExecution. # noqa: E501 + :rtype: EventHandler + """ + return self._event_handler + + @event_handler.setter + def event_handler(self, event_handler): + """Sets the event_handler of this ExtendedEventExecution. + + + :param event_handler: The event_handler of this ExtendedEventExecution. # noqa: E501 + :type: EventHandler + """ + + self._event_handler = event_handler + + @property + def full_message_payload(self): + """Gets the full_message_payload of this ExtendedEventExecution. # noqa: E501 + + + :return: The full_message_payload of this ExtendedEventExecution. # noqa: E501 + :rtype: dict(str, object) + """ + return self._full_message_payload + + @full_message_payload.setter + def full_message_payload(self, full_message_payload): + """Sets the full_message_payload of this ExtendedEventExecution. + + + :param full_message_payload: The full_message_payload of this ExtendedEventExecution. # noqa: E501 + :type: dict(str, object) + """ + + self._full_message_payload = full_message_payload + + @property + def id(self): + """Gets the id of this ExtendedEventExecution. # noqa: E501 + + + :return: The id of this ExtendedEventExecution. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ExtendedEventExecution. + + + :param id: The id of this ExtendedEventExecution. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def message_id(self): + """Gets the message_id of this ExtendedEventExecution. # noqa: E501 + + + :return: The message_id of this ExtendedEventExecution. # noqa: E501 + :rtype: str + """ + return self._message_id + + @message_id.setter + def message_id(self, message_id): + """Sets the message_id of this ExtendedEventExecution. + + + :param message_id: The message_id of this ExtendedEventExecution. # noqa: E501 + :type: str + """ + + self._message_id = message_id + + @property + def name(self): + """Gets the name of this ExtendedEventExecution. # noqa: E501 + + + :return: The name of this ExtendedEventExecution. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ExtendedEventExecution. + + + :param name: The name of this ExtendedEventExecution. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def org_id(self): + """Gets the org_id of this ExtendedEventExecution. # noqa: E501 + + + :return: The org_id of this ExtendedEventExecution. # noqa: E501 + :rtype: str + """ + return self._org_id + + @org_id.setter + def org_id(self, org_id): + """Sets the org_id of this ExtendedEventExecution. + + + :param org_id: The org_id of this ExtendedEventExecution. # noqa: E501 + :type: str + """ + + self._org_id = org_id + + @property + def output(self): + """Gets the output of this ExtendedEventExecution. # noqa: E501 + + + :return: The output of this ExtendedEventExecution. # noqa: E501 + :rtype: dict(str, object) + """ + return self._output + + @output.setter + def output(self, output): + """Sets the output of this ExtendedEventExecution. + + + :param output: The output of this ExtendedEventExecution. # noqa: E501 + :type: dict(str, object) + """ + + self._output = output + + @property + def payload(self): + """Gets the payload of this ExtendedEventExecution. # noqa: E501 + + + :return: The payload of this ExtendedEventExecution. # noqa: E501 + :rtype: dict(str, object) + """ + return self._payload + + @payload.setter + def payload(self, payload): + """Sets the payload of this ExtendedEventExecution. + + + :param payload: The payload of this ExtendedEventExecution. # noqa: E501 + :type: dict(str, object) + """ + + self._payload = payload + + @property + def status(self): + """Gets the status of this ExtendedEventExecution. # noqa: E501 + + + :return: The status of this ExtendedEventExecution. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ExtendedEventExecution. + + + :param status: The status of this ExtendedEventExecution. # noqa: E501 + :type: str + """ + allowed_values = ["IN_PROGRESS", "COMPLETED", "FAILED", "SKIPPED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def status_description(self): + """Gets the status_description of this ExtendedEventExecution. # noqa: E501 + + + :return: The status_description of this ExtendedEventExecution. # noqa: E501 + :rtype: str + """ + return self._status_description + + @status_description.setter + def status_description(self, status_description): + """Sets the status_description of this ExtendedEventExecution. + + + :param status_description: The status_description of this ExtendedEventExecution. # noqa: E501 + :type: str + """ + + self._status_description = status_description + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExtendedEventExecution, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExtendedEventExecution): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/extended_secret.py b/src/conductor/client/codegen/models/extended_secret.py new file mode 100644 index 00000000..f9301993 --- /dev/null +++ b/src/conductor/client/codegen/models/extended_secret.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ExtendedSecret(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'tags': 'list[Tag]' + } + + attribute_map = { + 'name': 'name', + 'tags': 'tags' + } + + def __init__(self, name=None, tags=None): # noqa: E501 + """ExtendedSecret - a model defined in Swagger""" # noqa: E501 + self._name = None + self._tags = None + self.discriminator = None + if name is not None: + self.name = name + if tags is not None: + self.tags = tags + + @property + def name(self): + """Gets the name of this ExtendedSecret. # noqa: E501 + + + :return: The name of this ExtendedSecret. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ExtendedSecret. + + + :param name: The name of this ExtendedSecret. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def tags(self): + """Gets the tags of this ExtendedSecret. # noqa: E501 + + + :return: The tags of this ExtendedSecret. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this ExtendedSecret. + + + :param tags: The tags of this ExtendedSecret. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExtendedSecret, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExtendedSecret): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/extended_task_def.py b/src/conductor/client/codegen/models/extended_task_def.py new file mode 100644 index 00000000..1f05000b --- /dev/null +++ b/src/conductor/client/codegen/models/extended_task_def.py @@ -0,0 +1,904 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ExtendedTaskDef(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'backoff_scale_factor': 'int', + 'base_type': 'str', + 'concurrent_exec_limit': 'int', + 'create_time': 'int', + 'created_by': 'str', + 'description': 'str', + 'enforce_schema': 'bool', + 'execution_name_space': 'str', + 'input_keys': 'list[str]', + 'input_schema': 'SchemaDef', + 'input_template': 'dict(str, object)', + 'isolation_group_id': 'str', + 'name': 'str', + 'output_keys': 'list[str]', + 'output_schema': 'SchemaDef', + 'overwrite_tags': 'bool', + 'owner_app': 'str', + 'owner_email': 'str', + 'poll_timeout_seconds': 'int', + 'rate_limit_frequency_in_seconds': 'int', + 'rate_limit_per_frequency': 'int', + 'response_timeout_seconds': 'int', + 'retry_count': 'int', + 'retry_delay_seconds': 'int', + 'retry_logic': 'str', + 'tags': 'list[Tag]', + 'timeout_policy': 'str', + 'timeout_seconds': 'int', + 'total_timeout_seconds': 'int', + 'update_time': 'int', + 'updated_by': 'str' + } + + attribute_map = { + 'backoff_scale_factor': 'backoffScaleFactor', + 'base_type': 'baseType', + 'concurrent_exec_limit': 'concurrentExecLimit', + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'description': 'description', + 'enforce_schema': 'enforceSchema', + 'execution_name_space': 'executionNameSpace', + 'input_keys': 'inputKeys', + 'input_schema': 'inputSchema', + 'input_template': 'inputTemplate', + 'isolation_group_id': 'isolationGroupId', + 'name': 'name', + 'output_keys': 'outputKeys', + 'output_schema': 'outputSchema', + 'overwrite_tags': 'overwriteTags', + 'owner_app': 'ownerApp', + 'owner_email': 'ownerEmail', + 'poll_timeout_seconds': 'pollTimeoutSeconds', + 'rate_limit_frequency_in_seconds': 'rateLimitFrequencyInSeconds', + 'rate_limit_per_frequency': 'rateLimitPerFrequency', + 'response_timeout_seconds': 'responseTimeoutSeconds', + 'retry_count': 'retryCount', + 'retry_delay_seconds': 'retryDelaySeconds', + 'retry_logic': 'retryLogic', + 'tags': 'tags', + 'timeout_policy': 'timeoutPolicy', + 'timeout_seconds': 'timeoutSeconds', + 'total_timeout_seconds': 'totalTimeoutSeconds', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy' + } + + def __init__(self, backoff_scale_factor=None, base_type=None, concurrent_exec_limit=None, create_time=None, created_by=None, description=None, enforce_schema=None, execution_name_space=None, input_keys=None, input_schema=None, input_template=None, isolation_group_id=None, name=None, output_keys=None, output_schema=None, overwrite_tags=None, owner_app=None, owner_email=None, poll_timeout_seconds=None, rate_limit_frequency_in_seconds=None, rate_limit_per_frequency=None, response_timeout_seconds=None, retry_count=None, retry_delay_seconds=None, retry_logic=None, tags=None, timeout_policy=None, timeout_seconds=None, total_timeout_seconds=None, update_time=None, updated_by=None): # noqa: E501 + """ExtendedTaskDef - a model defined in Swagger""" # noqa: E501 + self._backoff_scale_factor = None + self._base_type = None + self._concurrent_exec_limit = None + self._create_time = None + self._created_by = None + self._description = None + self._enforce_schema = None + self._execution_name_space = None + self._input_keys = None + self._input_schema = None + self._input_template = None + self._isolation_group_id = None + self._name = None + self._output_keys = None + self._output_schema = None + self._overwrite_tags = None + self._owner_app = None + self._owner_email = None + self._poll_timeout_seconds = None + self._rate_limit_frequency_in_seconds = None + self._rate_limit_per_frequency = None + self._response_timeout_seconds = None + self._retry_count = None + self._retry_delay_seconds = None + self._retry_logic = None + self._tags = None + self._timeout_policy = None + self._timeout_seconds = None + self._total_timeout_seconds = None + self._update_time = None + self._updated_by = None + self.discriminator = None + if backoff_scale_factor is not None: + self.backoff_scale_factor = backoff_scale_factor + if base_type is not None: + self.base_type = base_type + if concurrent_exec_limit is not None: + self.concurrent_exec_limit = concurrent_exec_limit + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if description is not None: + self.description = description + if enforce_schema is not None: + self.enforce_schema = enforce_schema + if execution_name_space is not None: + self.execution_name_space = execution_name_space + if input_keys is not None: + self.input_keys = input_keys + if input_schema is not None: + self.input_schema = input_schema + if input_template is not None: + self.input_template = input_template + if isolation_group_id is not None: + self.isolation_group_id = isolation_group_id + if name is not None: + self.name = name + if output_keys is not None: + self.output_keys = output_keys + if output_schema is not None: + self.output_schema = output_schema + if overwrite_tags is not None: + self.overwrite_tags = overwrite_tags + if owner_app is not None: + self.owner_app = owner_app + if owner_email is not None: + self.owner_email = owner_email + if poll_timeout_seconds is not None: + self.poll_timeout_seconds = poll_timeout_seconds + if rate_limit_frequency_in_seconds is not None: + self.rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds + if rate_limit_per_frequency is not None: + self.rate_limit_per_frequency = rate_limit_per_frequency + if response_timeout_seconds is not None: + self.response_timeout_seconds = response_timeout_seconds + if retry_count is not None: + self.retry_count = retry_count + if retry_delay_seconds is not None: + self.retry_delay_seconds = retry_delay_seconds + if retry_logic is not None: + self.retry_logic = retry_logic + if tags is not None: + self.tags = tags + if timeout_policy is not None: + self.timeout_policy = timeout_policy + self.timeout_seconds = timeout_seconds + self.total_timeout_seconds = total_timeout_seconds + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + + @property + def backoff_scale_factor(self): + """Gets the backoff_scale_factor of this ExtendedTaskDef. # noqa: E501 + + + :return: The backoff_scale_factor of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._backoff_scale_factor + + @backoff_scale_factor.setter + def backoff_scale_factor(self, backoff_scale_factor): + """Sets the backoff_scale_factor of this ExtendedTaskDef. + + + :param backoff_scale_factor: The backoff_scale_factor of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + + self._backoff_scale_factor = backoff_scale_factor + + @property + def base_type(self): + """Gets the base_type of this ExtendedTaskDef. # noqa: E501 + + + :return: The base_type of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._base_type + + @base_type.setter + def base_type(self, base_type): + """Sets the base_type of this ExtendedTaskDef. + + + :param base_type: The base_type of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + + self._base_type = base_type + + @property + def concurrent_exec_limit(self): + """Gets the concurrent_exec_limit of this ExtendedTaskDef. # noqa: E501 + + + :return: The concurrent_exec_limit of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._concurrent_exec_limit + + @concurrent_exec_limit.setter + def concurrent_exec_limit(self, concurrent_exec_limit): + """Sets the concurrent_exec_limit of this ExtendedTaskDef. + + + :param concurrent_exec_limit: The concurrent_exec_limit of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + + self._concurrent_exec_limit = concurrent_exec_limit + + @property + def create_time(self): + """Gets the create_time of this ExtendedTaskDef. # noqa: E501 + + + :return: The create_time of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this ExtendedTaskDef. + + + :param create_time: The create_time of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this ExtendedTaskDef. # noqa: E501 + + + :return: The created_by of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this ExtendedTaskDef. + + + :param created_by: The created_by of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def description(self): + """Gets the description of this ExtendedTaskDef. # noqa: E501 + + + :return: The description of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this ExtendedTaskDef. + + + :param description: The description of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def enforce_schema(self): + """Gets the enforce_schema of this ExtendedTaskDef. # noqa: E501 + + + :return: The enforce_schema of this ExtendedTaskDef. # noqa: E501 + :rtype: bool + """ + return self._enforce_schema + + @enforce_schema.setter + def enforce_schema(self, enforce_schema): + """Sets the enforce_schema of this ExtendedTaskDef. + + + :param enforce_schema: The enforce_schema of this ExtendedTaskDef. # noqa: E501 + :type: bool + """ + + self._enforce_schema = enforce_schema + + @property + def execution_name_space(self): + """Gets the execution_name_space of this ExtendedTaskDef. # noqa: E501 + + + :return: The execution_name_space of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._execution_name_space + + @execution_name_space.setter + def execution_name_space(self, execution_name_space): + """Sets the execution_name_space of this ExtendedTaskDef. + + + :param execution_name_space: The execution_name_space of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + + self._execution_name_space = execution_name_space + + @property + def input_keys(self): + """Gets the input_keys of this ExtendedTaskDef. # noqa: E501 + + + :return: The input_keys of this ExtendedTaskDef. # noqa: E501 + :rtype: list[str] + """ + return self._input_keys + + @input_keys.setter + def input_keys(self, input_keys): + """Sets the input_keys of this ExtendedTaskDef. + + + :param input_keys: The input_keys of this ExtendedTaskDef. # noqa: E501 + :type: list[str] + """ + + self._input_keys = input_keys + + @property + def input_schema(self): + """Gets the input_schema of this ExtendedTaskDef. # noqa: E501 + + + :return: The input_schema of this ExtendedTaskDef. # noqa: E501 + :rtype: SchemaDef + """ + return self._input_schema + + @input_schema.setter + def input_schema(self, input_schema): + """Sets the input_schema of this ExtendedTaskDef. + + + :param input_schema: The input_schema of this ExtendedTaskDef. # noqa: E501 + :type: SchemaDef + """ + + self._input_schema = input_schema + + @property + def input_template(self): + """Gets the input_template of this ExtendedTaskDef. # noqa: E501 + + + :return: The input_template of this ExtendedTaskDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input_template + + @input_template.setter + def input_template(self, input_template): + """Sets the input_template of this ExtendedTaskDef. + + + :param input_template: The input_template of this ExtendedTaskDef. # noqa: E501 + :type: dict(str, object) + """ + + self._input_template = input_template + + @property + def isolation_group_id(self): + """Gets the isolation_group_id of this ExtendedTaskDef. # noqa: E501 + + + :return: The isolation_group_id of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._isolation_group_id + + @isolation_group_id.setter + def isolation_group_id(self, isolation_group_id): + """Sets the isolation_group_id of this ExtendedTaskDef. + + + :param isolation_group_id: The isolation_group_id of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + + self._isolation_group_id = isolation_group_id + + @property + def name(self): + """Gets the name of this ExtendedTaskDef. # noqa: E501 + + + :return: The name of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ExtendedTaskDef. + + + :param name: The name of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def output_keys(self): + """Gets the output_keys of this ExtendedTaskDef. # noqa: E501 + + + :return: The output_keys of this ExtendedTaskDef. # noqa: E501 + :rtype: list[str] + """ + return self._output_keys + + @output_keys.setter + def output_keys(self, output_keys): + """Sets the output_keys of this ExtendedTaskDef. + + + :param output_keys: The output_keys of this ExtendedTaskDef. # noqa: E501 + :type: list[str] + """ + + self._output_keys = output_keys + + @property + def output_schema(self): + """Gets the output_schema of this ExtendedTaskDef. # noqa: E501 + + + :return: The output_schema of this ExtendedTaskDef. # noqa: E501 + :rtype: SchemaDef + """ + return self._output_schema + + @output_schema.setter + def output_schema(self, output_schema): + """Sets the output_schema of this ExtendedTaskDef. + + + :param output_schema: The output_schema of this ExtendedTaskDef. # noqa: E501 + :type: SchemaDef + """ + + self._output_schema = output_schema + + @property + def overwrite_tags(self): + """Gets the overwrite_tags of this ExtendedTaskDef. # noqa: E501 + + + :return: The overwrite_tags of this ExtendedTaskDef. # noqa: E501 + :rtype: bool + """ + return self._overwrite_tags + + @overwrite_tags.setter + def overwrite_tags(self, overwrite_tags): + """Sets the overwrite_tags of this ExtendedTaskDef. + + + :param overwrite_tags: The overwrite_tags of this ExtendedTaskDef. # noqa: E501 + :type: bool + """ + + self._overwrite_tags = overwrite_tags + + @property + def owner_app(self): + """Gets the owner_app of this ExtendedTaskDef. # noqa: E501 + + + :return: The owner_app of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._owner_app + + @owner_app.setter + def owner_app(self, owner_app): + """Sets the owner_app of this ExtendedTaskDef. + + + :param owner_app: The owner_app of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + + self._owner_app = owner_app + + @property + def owner_email(self): + """Gets the owner_email of this ExtendedTaskDef. # noqa: E501 + + + :return: The owner_email of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._owner_email + + @owner_email.setter + def owner_email(self, owner_email): + """Sets the owner_email of this ExtendedTaskDef. + + + :param owner_email: The owner_email of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + + self._owner_email = owner_email + + @property + def poll_timeout_seconds(self): + """Gets the poll_timeout_seconds of this ExtendedTaskDef. # noqa: E501 + + + :return: The poll_timeout_seconds of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._poll_timeout_seconds + + @poll_timeout_seconds.setter + def poll_timeout_seconds(self, poll_timeout_seconds): + """Sets the poll_timeout_seconds of this ExtendedTaskDef. + + + :param poll_timeout_seconds: The poll_timeout_seconds of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + + self._poll_timeout_seconds = poll_timeout_seconds + + @property + def rate_limit_frequency_in_seconds(self): + """Gets the rate_limit_frequency_in_seconds of this ExtendedTaskDef. # noqa: E501 + + + :return: The rate_limit_frequency_in_seconds of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._rate_limit_frequency_in_seconds + + @rate_limit_frequency_in_seconds.setter + def rate_limit_frequency_in_seconds(self, rate_limit_frequency_in_seconds): + """Sets the rate_limit_frequency_in_seconds of this ExtendedTaskDef. + + + :param rate_limit_frequency_in_seconds: The rate_limit_frequency_in_seconds of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + + self._rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds + + @property + def rate_limit_per_frequency(self): + """Gets the rate_limit_per_frequency of this ExtendedTaskDef. # noqa: E501 + + + :return: The rate_limit_per_frequency of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._rate_limit_per_frequency + + @rate_limit_per_frequency.setter + def rate_limit_per_frequency(self, rate_limit_per_frequency): + """Sets the rate_limit_per_frequency of this ExtendedTaskDef. + + + :param rate_limit_per_frequency: The rate_limit_per_frequency of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + + self._rate_limit_per_frequency = rate_limit_per_frequency + + @property + def response_timeout_seconds(self): + """Gets the response_timeout_seconds of this ExtendedTaskDef. # noqa: E501 + + + :return: The response_timeout_seconds of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._response_timeout_seconds + + @response_timeout_seconds.setter + def response_timeout_seconds(self, response_timeout_seconds): + """Sets the response_timeout_seconds of this ExtendedTaskDef. + + + :param response_timeout_seconds: The response_timeout_seconds of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + + self._response_timeout_seconds = response_timeout_seconds + + @property + def retry_count(self): + """Gets the retry_count of this ExtendedTaskDef. # noqa: E501 + + + :return: The retry_count of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._retry_count + + @retry_count.setter + def retry_count(self, retry_count): + """Sets the retry_count of this ExtendedTaskDef. + + + :param retry_count: The retry_count of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + + self._retry_count = retry_count + + @property + def retry_delay_seconds(self): + """Gets the retry_delay_seconds of this ExtendedTaskDef. # noqa: E501 + + + :return: The retry_delay_seconds of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._retry_delay_seconds + + @retry_delay_seconds.setter + def retry_delay_seconds(self, retry_delay_seconds): + """Sets the retry_delay_seconds of this ExtendedTaskDef. + + + :param retry_delay_seconds: The retry_delay_seconds of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + + self._retry_delay_seconds = retry_delay_seconds + + @property + def retry_logic(self): + """Gets the retry_logic of this ExtendedTaskDef. # noqa: E501 + + + :return: The retry_logic of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._retry_logic + + @retry_logic.setter + def retry_logic(self, retry_logic): + """Sets the retry_logic of this ExtendedTaskDef. + + + :param retry_logic: The retry_logic of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + allowed_values = ["FIXED", "EXPONENTIAL_BACKOFF", "LINEAR_BACKOFF"] # noqa: E501 + if retry_logic not in allowed_values: + raise ValueError( + "Invalid value for `retry_logic` ({0}), must be one of {1}" # noqa: E501 + .format(retry_logic, allowed_values) + ) + + self._retry_logic = retry_logic + + @property + def tags(self): + """Gets the tags of this ExtendedTaskDef. # noqa: E501 + + + :return: The tags of this ExtendedTaskDef. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this ExtendedTaskDef. + + + :param tags: The tags of this ExtendedTaskDef. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def timeout_policy(self): + """Gets the timeout_policy of this ExtendedTaskDef. # noqa: E501 + + + :return: The timeout_policy of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._timeout_policy + + @timeout_policy.setter + def timeout_policy(self, timeout_policy): + """Sets the timeout_policy of this ExtendedTaskDef. + + + :param timeout_policy: The timeout_policy of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + allowed_values = ["RETRY", "TIME_OUT_WF", "ALERT_ONLY"] # noqa: E501 + if timeout_policy not in allowed_values: + raise ValueError( + "Invalid value for `timeout_policy` ({0}), must be one of {1}" # noqa: E501 + .format(timeout_policy, allowed_values) + ) + + self._timeout_policy = timeout_policy + + @property + def timeout_seconds(self): + """Gets the timeout_seconds of this ExtendedTaskDef. # noqa: E501 + + + :return: The timeout_seconds of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._timeout_seconds + + @timeout_seconds.setter + def timeout_seconds(self, timeout_seconds): + """Sets the timeout_seconds of this ExtendedTaskDef. + + + :param timeout_seconds: The timeout_seconds of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + if timeout_seconds is None: + raise ValueError("Invalid value for `timeout_seconds`, must not be `None`") # noqa: E501 + + self._timeout_seconds = timeout_seconds + + @property + def total_timeout_seconds(self): + """Gets the total_timeout_seconds of this ExtendedTaskDef. # noqa: E501 + + + :return: The total_timeout_seconds of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._total_timeout_seconds + + @total_timeout_seconds.setter + def total_timeout_seconds(self, total_timeout_seconds): + """Sets the total_timeout_seconds of this ExtendedTaskDef. + + + :param total_timeout_seconds: The total_timeout_seconds of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + if total_timeout_seconds is None: + raise ValueError("Invalid value for `total_timeout_seconds`, must not be `None`") # noqa: E501 + + self._total_timeout_seconds = total_timeout_seconds + + @property + def update_time(self): + """Gets the update_time of this ExtendedTaskDef. # noqa: E501 + + + :return: The update_time of this ExtendedTaskDef. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this ExtendedTaskDef. + + + :param update_time: The update_time of this ExtendedTaskDef. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this ExtendedTaskDef. # noqa: E501 + + + :return: The updated_by of this ExtendedTaskDef. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this ExtendedTaskDef. + + + :param updated_by: The updated_by of this ExtendedTaskDef. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExtendedTaskDef, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExtendedTaskDef): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/extended_workflow_def.py b/src/conductor/client/codegen/models/extended_workflow_def.py new file mode 100644 index 00000000..b7889a88 --- /dev/null +++ b/src/conductor/client/codegen/models/extended_workflow_def.py @@ -0,0 +1,872 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ExtendedWorkflowDef(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'cache_config': 'CacheConfig', + 'create_time': 'int', + 'created_by': 'str', + 'description': 'str', + 'enforce_schema': 'bool', + 'failure_workflow': 'str', + 'input_parameters': 'list[str]', + 'input_schema': 'SchemaDef', + 'input_template': 'dict(str, object)', + 'masked_fields': 'list[str]', + 'metadata': 'dict(str, object)', + 'name': 'str', + 'output_parameters': 'dict(str, object)', + 'output_schema': 'SchemaDef', + 'overwrite_tags': 'bool', + 'owner_app': 'str', + 'owner_email': 'str', + 'rate_limit_config': 'RateLimitConfig', + 'restartable': 'bool', + 'schema_version': 'int', + 'tags': 'list[Tag]', + 'tasks': 'list[WorkflowTask]', + 'timeout_policy': 'str', + 'timeout_seconds': 'int', + 'update_time': 'int', + 'updated_by': 'str', + 'variables': 'dict(str, object)', + 'version': 'int', + 'workflow_status_listener_enabled': 'bool', + 'workflow_status_listener_sink': 'str' + } + + attribute_map = { + 'cache_config': 'cacheConfig', + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'description': 'description', + 'enforce_schema': 'enforceSchema', + 'failure_workflow': 'failureWorkflow', + 'input_parameters': 'inputParameters', + 'input_schema': 'inputSchema', + 'input_template': 'inputTemplate', + 'masked_fields': 'maskedFields', + 'metadata': 'metadata', + 'name': 'name', + 'output_parameters': 'outputParameters', + 'output_schema': 'outputSchema', + 'overwrite_tags': 'overwriteTags', + 'owner_app': 'ownerApp', + 'owner_email': 'ownerEmail', + 'rate_limit_config': 'rateLimitConfig', + 'restartable': 'restartable', + 'schema_version': 'schemaVersion', + 'tags': 'tags', + 'tasks': 'tasks', + 'timeout_policy': 'timeoutPolicy', + 'timeout_seconds': 'timeoutSeconds', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy', + 'variables': 'variables', + 'version': 'version', + 'workflow_status_listener_enabled': 'workflowStatusListenerEnabled', + 'workflow_status_listener_sink': 'workflowStatusListenerSink' + } + + def __init__(self, cache_config=None, create_time=None, created_by=None, description=None, enforce_schema=None, failure_workflow=None, input_parameters=None, input_schema=None, input_template=None, masked_fields=None, metadata=None, name=None, output_parameters=None, output_schema=None, overwrite_tags=None, owner_app=None, owner_email=None, rate_limit_config=None, restartable=None, schema_version=None, tags=None, tasks=None, timeout_policy=None, timeout_seconds=None, update_time=None, updated_by=None, variables=None, version=None, workflow_status_listener_enabled=None, workflow_status_listener_sink=None): # noqa: E501 + """ExtendedWorkflowDef - a model defined in Swagger""" # noqa: E501 + self._cache_config = None + self._create_time = None + self._created_by = None + self._description = None + self._enforce_schema = None + self._failure_workflow = None + self._input_parameters = None + self._input_schema = None + self._input_template = None + self._masked_fields = None + self._metadata = None + self._name = None + self._output_parameters = None + self._output_schema = None + self._overwrite_tags = None + self._owner_app = None + self._owner_email = None + self._rate_limit_config = None + self._restartable = None + self._schema_version = None + self._tags = None + self._tasks = None + self._timeout_policy = None + self._timeout_seconds = None + self._update_time = None + self._updated_by = None + self._variables = None + self._version = None + self._workflow_status_listener_enabled = None + self._workflow_status_listener_sink = None + self.discriminator = None + if cache_config is not None: + self.cache_config = cache_config + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if description is not None: + self.description = description + if enforce_schema is not None: + self.enforce_schema = enforce_schema + if failure_workflow is not None: + self.failure_workflow = failure_workflow + if input_parameters is not None: + self.input_parameters = input_parameters + if input_schema is not None: + self.input_schema = input_schema + if input_template is not None: + self.input_template = input_template + if masked_fields is not None: + self.masked_fields = masked_fields + if metadata is not None: + self.metadata = metadata + if name is not None: + self.name = name + if output_parameters is not None: + self.output_parameters = output_parameters + if output_schema is not None: + self.output_schema = output_schema + if overwrite_tags is not None: + self.overwrite_tags = overwrite_tags + if owner_app is not None: + self.owner_app = owner_app + if owner_email is not None: + self.owner_email = owner_email + if rate_limit_config is not None: + self.rate_limit_config = rate_limit_config + if restartable is not None: + self.restartable = restartable + if schema_version is not None: + self.schema_version = schema_version + if tags is not None: + self.tags = tags + self.tasks = tasks + if timeout_policy is not None: + self.timeout_policy = timeout_policy + self.timeout_seconds = timeout_seconds + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + if variables is not None: + self.variables = variables + if version is not None: + self.version = version + if workflow_status_listener_enabled is not None: + self.workflow_status_listener_enabled = workflow_status_listener_enabled + if workflow_status_listener_sink is not None: + self.workflow_status_listener_sink = workflow_status_listener_sink + + @property + def cache_config(self): + """Gets the cache_config of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The cache_config of this ExtendedWorkflowDef. # noqa: E501 + :rtype: CacheConfig + """ + return self._cache_config + + @cache_config.setter + def cache_config(self, cache_config): + """Sets the cache_config of this ExtendedWorkflowDef. + + + :param cache_config: The cache_config of this ExtendedWorkflowDef. # noqa: E501 + :type: CacheConfig + """ + + self._cache_config = cache_config + + @property + def create_time(self): + """Gets the create_time of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The create_time of this ExtendedWorkflowDef. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this ExtendedWorkflowDef. + + + :param create_time: The create_time of this ExtendedWorkflowDef. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The created_by of this ExtendedWorkflowDef. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this ExtendedWorkflowDef. + + + :param created_by: The created_by of this ExtendedWorkflowDef. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def description(self): + """Gets the description of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The description of this ExtendedWorkflowDef. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this ExtendedWorkflowDef. + + + :param description: The description of this ExtendedWorkflowDef. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def enforce_schema(self): + """Gets the enforce_schema of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The enforce_schema of this ExtendedWorkflowDef. # noqa: E501 + :rtype: bool + """ + return self._enforce_schema + + @enforce_schema.setter + def enforce_schema(self, enforce_schema): + """Sets the enforce_schema of this ExtendedWorkflowDef. + + + :param enforce_schema: The enforce_schema of this ExtendedWorkflowDef. # noqa: E501 + :type: bool + """ + + self._enforce_schema = enforce_schema + + @property + def failure_workflow(self): + """Gets the failure_workflow of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The failure_workflow of this ExtendedWorkflowDef. # noqa: E501 + :rtype: str + """ + return self._failure_workflow + + @failure_workflow.setter + def failure_workflow(self, failure_workflow): + """Sets the failure_workflow of this ExtendedWorkflowDef. + + + :param failure_workflow: The failure_workflow of this ExtendedWorkflowDef. # noqa: E501 + :type: str + """ + + self._failure_workflow = failure_workflow + + @property + def input_parameters(self): + """Gets the input_parameters of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The input_parameters of this ExtendedWorkflowDef. # noqa: E501 + :rtype: list[str] + """ + return self._input_parameters + + @input_parameters.setter + def input_parameters(self, input_parameters): + """Sets the input_parameters of this ExtendedWorkflowDef. + + + :param input_parameters: The input_parameters of this ExtendedWorkflowDef. # noqa: E501 + :type: list[str] + """ + + self._input_parameters = input_parameters + + @property + def input_schema(self): + """Gets the input_schema of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The input_schema of this ExtendedWorkflowDef. # noqa: E501 + :rtype: SchemaDef + """ + return self._input_schema + + @input_schema.setter + def input_schema(self, input_schema): + """Sets the input_schema of this ExtendedWorkflowDef. + + + :param input_schema: The input_schema of this ExtendedWorkflowDef. # noqa: E501 + :type: SchemaDef + """ + + self._input_schema = input_schema + + @property + def input_template(self): + """Gets the input_template of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The input_template of this ExtendedWorkflowDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input_template + + @input_template.setter + def input_template(self, input_template): + """Sets the input_template of this ExtendedWorkflowDef. + + + :param input_template: The input_template of this ExtendedWorkflowDef. # noqa: E501 + :type: dict(str, object) + """ + + self._input_template = input_template + + @property + def masked_fields(self): + """Gets the masked_fields of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The masked_fields of this ExtendedWorkflowDef. # noqa: E501 + :rtype: list[str] + """ + return self._masked_fields + + @masked_fields.setter + def masked_fields(self, masked_fields): + """Sets the masked_fields of this ExtendedWorkflowDef. + + + :param masked_fields: The masked_fields of this ExtendedWorkflowDef. # noqa: E501 + :type: list[str] + """ + + self._masked_fields = masked_fields + + @property + def metadata(self): + """Gets the metadata of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The metadata of this ExtendedWorkflowDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this ExtendedWorkflowDef. + + + :param metadata: The metadata of this ExtendedWorkflowDef. # noqa: E501 + :type: dict(str, object) + """ + + self._metadata = metadata + + @property + def name(self): + """Gets the name of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The name of this ExtendedWorkflowDef. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ExtendedWorkflowDef. + + + :param name: The name of this ExtendedWorkflowDef. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def output_parameters(self): + """Gets the output_parameters of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The output_parameters of this ExtendedWorkflowDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._output_parameters + + @output_parameters.setter + def output_parameters(self, output_parameters): + """Sets the output_parameters of this ExtendedWorkflowDef. + + + :param output_parameters: The output_parameters of this ExtendedWorkflowDef. # noqa: E501 + :type: dict(str, object) + """ + + self._output_parameters = output_parameters + + @property + def output_schema(self): + """Gets the output_schema of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The output_schema of this ExtendedWorkflowDef. # noqa: E501 + :rtype: SchemaDef + """ + return self._output_schema + + @output_schema.setter + def output_schema(self, output_schema): + """Sets the output_schema of this ExtendedWorkflowDef. + + + :param output_schema: The output_schema of this ExtendedWorkflowDef. # noqa: E501 + :type: SchemaDef + """ + + self._output_schema = output_schema + + @property + def overwrite_tags(self): + """Gets the overwrite_tags of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The overwrite_tags of this ExtendedWorkflowDef. # noqa: E501 + :rtype: bool + """ + return self._overwrite_tags + + @overwrite_tags.setter + def overwrite_tags(self, overwrite_tags): + """Sets the overwrite_tags of this ExtendedWorkflowDef. + + + :param overwrite_tags: The overwrite_tags of this ExtendedWorkflowDef. # noqa: E501 + :type: bool + """ + + self._overwrite_tags = overwrite_tags + + @property + def owner_app(self): + """Gets the owner_app of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The owner_app of this ExtendedWorkflowDef. # noqa: E501 + :rtype: str + """ + return self._owner_app + + @owner_app.setter + def owner_app(self, owner_app): + """Sets the owner_app of this ExtendedWorkflowDef. + + + :param owner_app: The owner_app of this ExtendedWorkflowDef. # noqa: E501 + :type: str + """ + + self._owner_app = owner_app + + @property + def owner_email(self): + """Gets the owner_email of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The owner_email of this ExtendedWorkflowDef. # noqa: E501 + :rtype: str + """ + return self._owner_email + + @owner_email.setter + def owner_email(self, owner_email): + """Sets the owner_email of this ExtendedWorkflowDef. + + + :param owner_email: The owner_email of this ExtendedWorkflowDef. # noqa: E501 + :type: str + """ + + self._owner_email = owner_email + + @property + def rate_limit_config(self): + """Gets the rate_limit_config of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The rate_limit_config of this ExtendedWorkflowDef. # noqa: E501 + :rtype: RateLimitConfig + """ + return self._rate_limit_config + + @rate_limit_config.setter + def rate_limit_config(self, rate_limit_config): + """Sets the rate_limit_config of this ExtendedWorkflowDef. + + + :param rate_limit_config: The rate_limit_config of this ExtendedWorkflowDef. # noqa: E501 + :type: RateLimitConfig + """ + + self._rate_limit_config = rate_limit_config + + @property + def restartable(self): + """Gets the restartable of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The restartable of this ExtendedWorkflowDef. # noqa: E501 + :rtype: bool + """ + return self._restartable + + @restartable.setter + def restartable(self, restartable): + """Sets the restartable of this ExtendedWorkflowDef. + + + :param restartable: The restartable of this ExtendedWorkflowDef. # noqa: E501 + :type: bool + """ + + self._restartable = restartable + + @property + def schema_version(self): + """Gets the schema_version of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The schema_version of this ExtendedWorkflowDef. # noqa: E501 + :rtype: int + """ + return self._schema_version + + @schema_version.setter + def schema_version(self, schema_version): + """Sets the schema_version of this ExtendedWorkflowDef. + + + :param schema_version: The schema_version of this ExtendedWorkflowDef. # noqa: E501 + :type: int + """ + + self._schema_version = schema_version + + @property + def tags(self): + """Gets the tags of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The tags of this ExtendedWorkflowDef. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this ExtendedWorkflowDef. + + + :param tags: The tags of this ExtendedWorkflowDef. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def tasks(self): + """Gets the tasks of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The tasks of this ExtendedWorkflowDef. # noqa: E501 + :rtype: list[WorkflowTask] + """ + return self._tasks + + @tasks.setter + def tasks(self, tasks): + """Sets the tasks of this ExtendedWorkflowDef. + + + :param tasks: The tasks of this ExtendedWorkflowDef. # noqa: E501 + :type: list[WorkflowTask] + """ + if tasks is None: + raise ValueError("Invalid value for `tasks`, must not be `None`") # noqa: E501 + + self._tasks = tasks + + @property + def timeout_policy(self): + """Gets the timeout_policy of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The timeout_policy of this ExtendedWorkflowDef. # noqa: E501 + :rtype: str + """ + return self._timeout_policy + + @timeout_policy.setter + def timeout_policy(self, timeout_policy): + """Sets the timeout_policy of this ExtendedWorkflowDef. + + + :param timeout_policy: The timeout_policy of this ExtendedWorkflowDef. # noqa: E501 + :type: str + """ + allowed_values = ["TIME_OUT_WF", "ALERT_ONLY"] # noqa: E501 + if timeout_policy not in allowed_values: + raise ValueError( + "Invalid value for `timeout_policy` ({0}), must be one of {1}" # noqa: E501 + .format(timeout_policy, allowed_values) + ) + + self._timeout_policy = timeout_policy + + @property + def timeout_seconds(self): + """Gets the timeout_seconds of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The timeout_seconds of this ExtendedWorkflowDef. # noqa: E501 + :rtype: int + """ + return self._timeout_seconds + + @timeout_seconds.setter + def timeout_seconds(self, timeout_seconds): + """Sets the timeout_seconds of this ExtendedWorkflowDef. + + + :param timeout_seconds: The timeout_seconds of this ExtendedWorkflowDef. # noqa: E501 + :type: int + """ + if timeout_seconds is None: + raise ValueError("Invalid value for `timeout_seconds`, must not be `None`") # noqa: E501 + + self._timeout_seconds = timeout_seconds + + @property + def update_time(self): + """Gets the update_time of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The update_time of this ExtendedWorkflowDef. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this ExtendedWorkflowDef. + + + :param update_time: The update_time of this ExtendedWorkflowDef. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The updated_by of this ExtendedWorkflowDef. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this ExtendedWorkflowDef. + + + :param updated_by: The updated_by of this ExtendedWorkflowDef. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + @property + def variables(self): + """Gets the variables of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The variables of this ExtendedWorkflowDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._variables + + @variables.setter + def variables(self, variables): + """Sets the variables of this ExtendedWorkflowDef. + + + :param variables: The variables of this ExtendedWorkflowDef. # noqa: E501 + :type: dict(str, object) + """ + + self._variables = variables + + @property + def version(self): + """Gets the version of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The version of this ExtendedWorkflowDef. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this ExtendedWorkflowDef. + + + :param version: The version of this ExtendedWorkflowDef. # noqa: E501 + :type: int + """ + + self._version = version + + @property + def workflow_status_listener_enabled(self): + """Gets the workflow_status_listener_enabled of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The workflow_status_listener_enabled of this ExtendedWorkflowDef. # noqa: E501 + :rtype: bool + """ + return self._workflow_status_listener_enabled + + @workflow_status_listener_enabled.setter + def workflow_status_listener_enabled(self, workflow_status_listener_enabled): + """Sets the workflow_status_listener_enabled of this ExtendedWorkflowDef. + + + :param workflow_status_listener_enabled: The workflow_status_listener_enabled of this ExtendedWorkflowDef. # noqa: E501 + :type: bool + """ + + self._workflow_status_listener_enabled = workflow_status_listener_enabled + + @property + def workflow_status_listener_sink(self): + """Gets the workflow_status_listener_sink of this ExtendedWorkflowDef. # noqa: E501 + + + :return: The workflow_status_listener_sink of this ExtendedWorkflowDef. # noqa: E501 + :rtype: str + """ + return self._workflow_status_listener_sink + + @workflow_status_listener_sink.setter + def workflow_status_listener_sink(self, workflow_status_listener_sink): + """Sets the workflow_status_listener_sink of this ExtendedWorkflowDef. + + + :param workflow_status_listener_sink: The workflow_status_listener_sink of this ExtendedWorkflowDef. # noqa: E501 + :type: str + """ + + self._workflow_status_listener_sink = workflow_status_listener_sink + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExtendedWorkflowDef, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExtendedWorkflowDef): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/extension_range.py b/src/conductor/client/codegen/models/extension_range.py new file mode 100644 index 00000000..aa282dfb --- /dev/null +++ b/src/conductor/client/codegen/models/extension_range.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ExtensionRange(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'ExtensionRange', + 'descriptor_for_type': 'Descriptor', + 'end': 'int', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'options': 'ExtensionRangeOptions', + 'options_or_builder': 'ExtensionRangeOptionsOrBuilder', + 'parser_for_type': 'ParserExtensionRange', + 'serialized_size': 'int', + 'start': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'end': 'end', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'start': 'start', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, end=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, options=None, options_or_builder=None, parser_for_type=None, serialized_size=None, start=None, unknown_fields=None): # noqa: E501 + """ExtensionRange - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._end = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._options = None + self._options_or_builder = None + self._parser_for_type = None + self._serialized_size = None + self._start = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if end is not None: + self.end = end + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if start is not None: + self.start = start + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this ExtensionRange. # noqa: E501 + + + :return: The all_fields of this ExtensionRange. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this ExtensionRange. + + + :param all_fields: The all_fields of this ExtensionRange. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this ExtensionRange. # noqa: E501 + + + :return: The default_instance_for_type of this ExtensionRange. # noqa: E501 + :rtype: ExtensionRange + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this ExtensionRange. + + + :param default_instance_for_type: The default_instance_for_type of this ExtensionRange. # noqa: E501 + :type: ExtensionRange + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this ExtensionRange. # noqa: E501 + + + :return: The descriptor_for_type of this ExtensionRange. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this ExtensionRange. + + + :param descriptor_for_type: The descriptor_for_type of this ExtensionRange. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def end(self): + """Gets the end of this ExtensionRange. # noqa: E501 + + + :return: The end of this ExtensionRange. # noqa: E501 + :rtype: int + """ + return self._end + + @end.setter + def end(self, end): + """Sets the end of this ExtensionRange. + + + :param end: The end of this ExtensionRange. # noqa: E501 + :type: int + """ + + self._end = end + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this ExtensionRange. # noqa: E501 + + + :return: The initialization_error_string of this ExtensionRange. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this ExtensionRange. + + + :param initialization_error_string: The initialization_error_string of this ExtensionRange. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this ExtensionRange. # noqa: E501 + + + :return: The initialized of this ExtensionRange. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this ExtensionRange. + + + :param initialized: The initialized of this ExtensionRange. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this ExtensionRange. # noqa: E501 + + + :return: The memoized_serialized_size of this ExtensionRange. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this ExtensionRange. + + + :param memoized_serialized_size: The memoized_serialized_size of this ExtensionRange. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def options(self): + """Gets the options of this ExtensionRange. # noqa: E501 + + + :return: The options of this ExtensionRange. # noqa: E501 + :rtype: ExtensionRangeOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this ExtensionRange. + + + :param options: The options of this ExtensionRange. # noqa: E501 + :type: ExtensionRangeOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this ExtensionRange. # noqa: E501 + + + :return: The options_or_builder of this ExtensionRange. # noqa: E501 + :rtype: ExtensionRangeOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this ExtensionRange. + + + :param options_or_builder: The options_or_builder of this ExtensionRange. # noqa: E501 + :type: ExtensionRangeOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def parser_for_type(self): + """Gets the parser_for_type of this ExtensionRange. # noqa: E501 + + + :return: The parser_for_type of this ExtensionRange. # noqa: E501 + :rtype: ParserExtensionRange + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this ExtensionRange. + + + :param parser_for_type: The parser_for_type of this ExtensionRange. # noqa: E501 + :type: ParserExtensionRange + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this ExtensionRange. # noqa: E501 + + + :return: The serialized_size of this ExtensionRange. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this ExtensionRange. + + + :param serialized_size: The serialized_size of this ExtensionRange. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def start(self): + """Gets the start of this ExtensionRange. # noqa: E501 + + + :return: The start of this ExtensionRange. # noqa: E501 + :rtype: int + """ + return self._start + + @start.setter + def start(self, start): + """Sets the start of this ExtensionRange. + + + :param start: The start of this ExtensionRange. # noqa: E501 + :type: int + """ + + self._start = start + + @property + def unknown_fields(self): + """Gets the unknown_fields of this ExtensionRange. # noqa: E501 + + + :return: The unknown_fields of this ExtensionRange. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this ExtensionRange. + + + :param unknown_fields: The unknown_fields of this ExtensionRange. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExtensionRange, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExtensionRange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/extension_range_options.py b/src/conductor/client/codegen/models/extension_range_options.py new file mode 100644 index 00000000..89c64eb1 --- /dev/null +++ b/src/conductor/client/codegen/models/extension_range_options.py @@ -0,0 +1,584 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ExtensionRangeOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'all_fields_raw': 'dict(str, object)', + 'declaration_count': 'int', + 'declaration_list': 'list[Declaration]', + 'declaration_or_builder_list': 'list[DeclarationOrBuilder]', + 'default_instance_for_type': 'ExtensionRangeOptions', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserExtensionRangeOptions', + 'serialized_size': 'int', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet', + 'verification': 'str' + } + + attribute_map = { + 'all_fields': 'allFields', + 'all_fields_raw': 'allFieldsRaw', + 'declaration_count': 'declarationCount', + 'declaration_list': 'declarationList', + 'declaration_or_builder_list': 'declarationOrBuilderList', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields', + 'verification': 'verification' + } + + def __init__(self, all_fields=None, all_fields_raw=None, declaration_count=None, declaration_list=None, declaration_or_builder_list=None, default_instance_for_type=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None, verification=None): # noqa: E501 + """ExtensionRangeOptions - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._all_fields_raw = None + self._declaration_count = None + self._declaration_list = None + self._declaration_or_builder_list = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self._verification = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if all_fields_raw is not None: + self.all_fields_raw = all_fields_raw + if declaration_count is not None: + self.declaration_count = declaration_count + if declaration_list is not None: + self.declaration_list = declaration_list + if declaration_or_builder_list is not None: + self.declaration_or_builder_list = declaration_or_builder_list + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if verification is not None: + self.verification = verification + + @property + def all_fields(self): + """Gets the all_fields of this ExtensionRangeOptions. # noqa: E501 + + + :return: The all_fields of this ExtensionRangeOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this ExtensionRangeOptions. + + + :param all_fields: The all_fields of this ExtensionRangeOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def all_fields_raw(self): + """Gets the all_fields_raw of this ExtensionRangeOptions. # noqa: E501 + + + :return: The all_fields_raw of this ExtensionRangeOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields_raw + + @all_fields_raw.setter + def all_fields_raw(self, all_fields_raw): + """Sets the all_fields_raw of this ExtensionRangeOptions. + + + :param all_fields_raw: The all_fields_raw of this ExtensionRangeOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields_raw = all_fields_raw + + @property + def declaration_count(self): + """Gets the declaration_count of this ExtensionRangeOptions. # noqa: E501 + + + :return: The declaration_count of this ExtensionRangeOptions. # noqa: E501 + :rtype: int + """ + return self._declaration_count + + @declaration_count.setter + def declaration_count(self, declaration_count): + """Sets the declaration_count of this ExtensionRangeOptions. + + + :param declaration_count: The declaration_count of this ExtensionRangeOptions. # noqa: E501 + :type: int + """ + + self._declaration_count = declaration_count + + @property + def declaration_list(self): + """Gets the declaration_list of this ExtensionRangeOptions. # noqa: E501 + + + :return: The declaration_list of this ExtensionRangeOptions. # noqa: E501 + :rtype: list[Declaration] + """ + return self._declaration_list + + @declaration_list.setter + def declaration_list(self, declaration_list): + """Sets the declaration_list of this ExtensionRangeOptions. + + + :param declaration_list: The declaration_list of this ExtensionRangeOptions. # noqa: E501 + :type: list[Declaration] + """ + + self._declaration_list = declaration_list + + @property + def declaration_or_builder_list(self): + """Gets the declaration_or_builder_list of this ExtensionRangeOptions. # noqa: E501 + + + :return: The declaration_or_builder_list of this ExtensionRangeOptions. # noqa: E501 + :rtype: list[DeclarationOrBuilder] + """ + return self._declaration_or_builder_list + + @declaration_or_builder_list.setter + def declaration_or_builder_list(self, declaration_or_builder_list): + """Sets the declaration_or_builder_list of this ExtensionRangeOptions. + + + :param declaration_or_builder_list: The declaration_or_builder_list of this ExtensionRangeOptions. # noqa: E501 + :type: list[DeclarationOrBuilder] + """ + + self._declaration_or_builder_list = declaration_or_builder_list + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this ExtensionRangeOptions. # noqa: E501 + + + :return: The default_instance_for_type of this ExtensionRangeOptions. # noqa: E501 + :rtype: ExtensionRangeOptions + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this ExtensionRangeOptions. + + + :param default_instance_for_type: The default_instance_for_type of this ExtensionRangeOptions. # noqa: E501 + :type: ExtensionRangeOptions + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this ExtensionRangeOptions. # noqa: E501 + + + :return: The descriptor_for_type of this ExtensionRangeOptions. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this ExtensionRangeOptions. + + + :param descriptor_for_type: The descriptor_for_type of this ExtensionRangeOptions. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this ExtensionRangeOptions. # noqa: E501 + + + :return: The features of this ExtensionRangeOptions. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this ExtensionRangeOptions. + + + :param features: The features of this ExtensionRangeOptions. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this ExtensionRangeOptions. # noqa: E501 + + + :return: The features_or_builder of this ExtensionRangeOptions. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this ExtensionRangeOptions. + + + :param features_or_builder: The features_or_builder of this ExtensionRangeOptions. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this ExtensionRangeOptions. # noqa: E501 + + + :return: The initialization_error_string of this ExtensionRangeOptions. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this ExtensionRangeOptions. + + + :param initialization_error_string: The initialization_error_string of this ExtensionRangeOptions. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this ExtensionRangeOptions. # noqa: E501 + + + :return: The initialized of this ExtensionRangeOptions. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this ExtensionRangeOptions. + + + :param initialized: The initialized of this ExtensionRangeOptions. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this ExtensionRangeOptions. # noqa: E501 + + + :return: The memoized_serialized_size of this ExtensionRangeOptions. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this ExtensionRangeOptions. + + + :param memoized_serialized_size: The memoized_serialized_size of this ExtensionRangeOptions. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this ExtensionRangeOptions. # noqa: E501 + + + :return: The parser_for_type of this ExtensionRangeOptions. # noqa: E501 + :rtype: ParserExtensionRangeOptions + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this ExtensionRangeOptions. + + + :param parser_for_type: The parser_for_type of this ExtensionRangeOptions. # noqa: E501 + :type: ParserExtensionRangeOptions + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this ExtensionRangeOptions. # noqa: E501 + + + :return: The serialized_size of this ExtensionRangeOptions. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this ExtensionRangeOptions. + + + :param serialized_size: The serialized_size of this ExtensionRangeOptions. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this ExtensionRangeOptions. # noqa: E501 + + + :return: The uninterpreted_option_count of this ExtensionRangeOptions. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this ExtensionRangeOptions. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this ExtensionRangeOptions. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this ExtensionRangeOptions. # noqa: E501 + + + :return: The uninterpreted_option_list of this ExtensionRangeOptions. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this ExtensionRangeOptions. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this ExtensionRangeOptions. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this ExtensionRangeOptions. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this ExtensionRangeOptions. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this ExtensionRangeOptions. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this ExtensionRangeOptions. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this ExtensionRangeOptions. # noqa: E501 + + + :return: The unknown_fields of this ExtensionRangeOptions. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this ExtensionRangeOptions. + + + :param unknown_fields: The unknown_fields of this ExtensionRangeOptions. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def verification(self): + """Gets the verification of this ExtensionRangeOptions. # noqa: E501 + + + :return: The verification of this ExtensionRangeOptions. # noqa: E501 + :rtype: str + """ + return self._verification + + @verification.setter + def verification(self, verification): + """Sets the verification of this ExtensionRangeOptions. + + + :param verification: The verification of this ExtensionRangeOptions. # noqa: E501 + :type: str + """ + allowed_values = ["DECLARATION", "UNVERIFIED"] # noqa: E501 + if verification not in allowed_values: + raise ValueError( + "Invalid value for `verification` ({0}), must be one of {1}" # noqa: E501 + .format(verification, allowed_values) + ) + + self._verification = verification + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExtensionRangeOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExtensionRangeOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/extension_range_options_or_builder.py b/src/conductor/client/codegen/models/extension_range_options_or_builder.py new file mode 100644 index 00000000..0bb0e21a --- /dev/null +++ b/src/conductor/client/codegen/models/extension_range_options_or_builder.py @@ -0,0 +1,480 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ExtensionRangeOptionsOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'declaration_count': 'int', + 'declaration_list': 'list[Declaration]', + 'declaration_or_builder_list': 'list[DeclarationOrBuilder]', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet', + 'verification': 'str' + } + + attribute_map = { + 'all_fields': 'allFields', + 'declaration_count': 'declarationCount', + 'declaration_list': 'declarationList', + 'declaration_or_builder_list': 'declarationOrBuilderList', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields', + 'verification': 'verification' + } + + def __init__(self, all_fields=None, declaration_count=None, declaration_list=None, declaration_or_builder_list=None, default_instance_for_type=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None, verification=None): # noqa: E501 + """ExtensionRangeOptionsOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._declaration_count = None + self._declaration_list = None + self._declaration_or_builder_list = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self._verification = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if declaration_count is not None: + self.declaration_count = declaration_count + if declaration_list is not None: + self.declaration_list = declaration_list + if declaration_or_builder_list is not None: + self.declaration_or_builder_list = declaration_or_builder_list + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if verification is not None: + self.verification = verification + + @property + def all_fields(self): + """Gets the all_fields of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The all_fields of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this ExtensionRangeOptionsOrBuilder. + + + :param all_fields: The all_fields of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def declaration_count(self): + """Gets the declaration_count of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The declaration_count of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._declaration_count + + @declaration_count.setter + def declaration_count(self, declaration_count): + """Sets the declaration_count of this ExtensionRangeOptionsOrBuilder. + + + :param declaration_count: The declaration_count of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._declaration_count = declaration_count + + @property + def declaration_list(self): + """Gets the declaration_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The declaration_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: list[Declaration] + """ + return self._declaration_list + + @declaration_list.setter + def declaration_list(self, declaration_list): + """Sets the declaration_list of this ExtensionRangeOptionsOrBuilder. + + + :param declaration_list: The declaration_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: list[Declaration] + """ + + self._declaration_list = declaration_list + + @property + def declaration_or_builder_list(self): + """Gets the declaration_or_builder_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The declaration_or_builder_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: list[DeclarationOrBuilder] + """ + return self._declaration_or_builder_list + + @declaration_or_builder_list.setter + def declaration_or_builder_list(self, declaration_or_builder_list): + """Sets the declaration_or_builder_list of this ExtensionRangeOptionsOrBuilder. + + + :param declaration_or_builder_list: The declaration_or_builder_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: list[DeclarationOrBuilder] + """ + + self._declaration_or_builder_list = declaration_or_builder_list + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this ExtensionRangeOptionsOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this ExtensionRangeOptionsOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The features of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this ExtensionRangeOptionsOrBuilder. + + + :param features: The features of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The features_or_builder of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this ExtensionRangeOptionsOrBuilder. + + + :param features_or_builder: The features_or_builder of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this ExtensionRangeOptionsOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The initialized of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this ExtensionRangeOptionsOrBuilder. + + + :param initialized: The initialized of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_count of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this ExtensionRangeOptionsOrBuilder. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this ExtensionRangeOptionsOrBuilder. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this ExtensionRangeOptionsOrBuilder. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this ExtensionRangeOptionsOrBuilder. + + + :param unknown_fields: The unknown_fields of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def verification(self): + """Gets the verification of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + + + :return: The verification of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._verification + + @verification.setter + def verification(self, verification): + """Sets the verification of this ExtensionRangeOptionsOrBuilder. + + + :param verification: The verification of this ExtensionRangeOptionsOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["DECLARATION", "UNVERIFIED"] # noqa: E501 + if verification not in allowed_values: + raise ValueError( + "Invalid value for `verification` ({0}), must be one of {1}" # noqa: E501 + .format(verification, allowed_values) + ) + + self._verification = verification + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExtensionRangeOptionsOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExtensionRangeOptionsOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/extension_range_or_builder.py b/src/conductor/client/codegen/models/extension_range_or_builder.py new file mode 100644 index 00000000..dfd09060 --- /dev/null +++ b/src/conductor/client/codegen/models/extension_range_or_builder.py @@ -0,0 +1,344 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ExtensionRangeOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'end': 'int', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'options': 'ExtensionRangeOptions', + 'options_or_builder': 'ExtensionRangeOptionsOrBuilder', + 'start': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'end': 'end', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'start': 'start', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, end=None, initialization_error_string=None, initialized=None, options=None, options_or_builder=None, start=None, unknown_fields=None): # noqa: E501 + """ExtensionRangeOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._end = None + self._initialization_error_string = None + self._initialized = None + self._options = None + self._options_or_builder = None + self._start = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if end is not None: + self.end = end + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if start is not None: + self.start = start + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this ExtensionRangeOrBuilder. # noqa: E501 + + + :return: The all_fields of this ExtensionRangeOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this ExtensionRangeOrBuilder. + + + :param all_fields: The all_fields of this ExtensionRangeOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this ExtensionRangeOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this ExtensionRangeOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this ExtensionRangeOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this ExtensionRangeOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this ExtensionRangeOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this ExtensionRangeOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this ExtensionRangeOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this ExtensionRangeOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def end(self): + """Gets the end of this ExtensionRangeOrBuilder. # noqa: E501 + + + :return: The end of this ExtensionRangeOrBuilder. # noqa: E501 + :rtype: int + """ + return self._end + + @end.setter + def end(self, end): + """Sets the end of this ExtensionRangeOrBuilder. + + + :param end: The end of this ExtensionRangeOrBuilder. # noqa: E501 + :type: int + """ + + self._end = end + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this ExtensionRangeOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this ExtensionRangeOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this ExtensionRangeOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this ExtensionRangeOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this ExtensionRangeOrBuilder. # noqa: E501 + + + :return: The initialized of this ExtensionRangeOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this ExtensionRangeOrBuilder. + + + :param initialized: The initialized of this ExtensionRangeOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def options(self): + """Gets the options of this ExtensionRangeOrBuilder. # noqa: E501 + + + :return: The options of this ExtensionRangeOrBuilder. # noqa: E501 + :rtype: ExtensionRangeOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this ExtensionRangeOrBuilder. + + + :param options: The options of this ExtensionRangeOrBuilder. # noqa: E501 + :type: ExtensionRangeOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this ExtensionRangeOrBuilder. # noqa: E501 + + + :return: The options_or_builder of this ExtensionRangeOrBuilder. # noqa: E501 + :rtype: ExtensionRangeOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this ExtensionRangeOrBuilder. + + + :param options_or_builder: The options_or_builder of this ExtensionRangeOrBuilder. # noqa: E501 + :type: ExtensionRangeOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def start(self): + """Gets the start of this ExtensionRangeOrBuilder. # noqa: E501 + + + :return: The start of this ExtensionRangeOrBuilder. # noqa: E501 + :rtype: int + """ + return self._start + + @start.setter + def start(self, start): + """Sets the start of this ExtensionRangeOrBuilder. + + + :param start: The start of this ExtensionRangeOrBuilder. # noqa: E501 + :type: int + """ + + self._start = start + + @property + def unknown_fields(self): + """Gets the unknown_fields of this ExtensionRangeOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this ExtensionRangeOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this ExtensionRangeOrBuilder. + + + :param unknown_fields: The unknown_fields of this ExtensionRangeOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExtensionRangeOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExtensionRangeOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/external_storage_location.py b/src/conductor/client/codegen/models/external_storage_location.py new file mode 100644 index 00000000..bb56ec6b --- /dev/null +++ b/src/conductor/client/codegen/models/external_storage_location.py @@ -0,0 +1,124 @@ +import pprint +import six + + +class ExternalStorageLocation: + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + + swagger_types = { + 'uri': 'str', + 'path': 'str' + } + + attribute_map = { + 'uri': 'uri', + 'path': 'path' + } + + def __init__(self, uri=None, path=None): # noqa: E501 + """ExternalStorageLocation - a model defined in Swagger""" # noqa: E501 + self._uri = None + self._path = None + self.discriminator = None + if uri is not None: + self.uri = uri + if path is not None: + self.path = path + + @property + def uri(self): + """Gets the uri of this ExternalStorageLocation. # noqa: E501 + + + :return: The uri of this ExternalStorageLocation. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this ExternalStorageLocation. + + + :param uri: The uri of this ExternalStorageLocation. # noqa: E501 + :type: str + """ + + self._uri = uri + + @property + def path(self): + """Gets the path of this ExternalStorageLocation. # noqa: E501 + + + :return: The path of this ExternalStorageLocation. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this ExternalStorageLocation. + + + :param path: The path of this ExternalStorageLocation. # noqa: E501 + :type: str + """ + + self._path = path + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExternalStorageLocation, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExternalStorageLocation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/feature_set.py b/src/conductor/client/codegen/models/feature_set.py new file mode 100644 index 00000000..04e62abb --- /dev/null +++ b/src/conductor/client/codegen/models/feature_set.py @@ -0,0 +1,536 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FeatureSet(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'all_fields_raw': 'dict(str, object)', + 'default_instance_for_type': 'FeatureSet', + 'descriptor_for_type': 'Descriptor', + 'enum_type': 'str', + 'field_presence': 'str', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'json_format': 'str', + 'memoized_serialized_size': 'int', + 'message_encoding': 'str', + 'parser_for_type': 'ParserFeatureSet', + 'repeated_field_encoding': 'str', + 'serialized_size': 'int', + 'unknown_fields': 'UnknownFieldSet', + 'utf8_validation': 'str' + } + + attribute_map = { + 'all_fields': 'allFields', + 'all_fields_raw': 'allFieldsRaw', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'enum_type': 'enumType', + 'field_presence': 'fieldPresence', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'json_format': 'jsonFormat', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'message_encoding': 'messageEncoding', + 'parser_for_type': 'parserForType', + 'repeated_field_encoding': 'repeatedFieldEncoding', + 'serialized_size': 'serializedSize', + 'unknown_fields': 'unknownFields', + 'utf8_validation': 'utf8Validation' + } + + def __init__(self, all_fields=None, all_fields_raw=None, default_instance_for_type=None, descriptor_for_type=None, enum_type=None, field_presence=None, initialization_error_string=None, initialized=None, json_format=None, memoized_serialized_size=None, message_encoding=None, parser_for_type=None, repeated_field_encoding=None, serialized_size=None, unknown_fields=None, utf8_validation=None): # noqa: E501 + """FeatureSet - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._all_fields_raw = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._enum_type = None + self._field_presence = None + self._initialization_error_string = None + self._initialized = None + self._json_format = None + self._memoized_serialized_size = None + self._message_encoding = None + self._parser_for_type = None + self._repeated_field_encoding = None + self._serialized_size = None + self._unknown_fields = None + self._utf8_validation = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if all_fields_raw is not None: + self.all_fields_raw = all_fields_raw + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if enum_type is not None: + self.enum_type = enum_type + if field_presence is not None: + self.field_presence = field_presence + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if json_format is not None: + self.json_format = json_format + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if message_encoding is not None: + self.message_encoding = message_encoding + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if repeated_field_encoding is not None: + self.repeated_field_encoding = repeated_field_encoding + if serialized_size is not None: + self.serialized_size = serialized_size + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if utf8_validation is not None: + self.utf8_validation = utf8_validation + + @property + def all_fields(self): + """Gets the all_fields of this FeatureSet. # noqa: E501 + + + :return: The all_fields of this FeatureSet. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this FeatureSet. + + + :param all_fields: The all_fields of this FeatureSet. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def all_fields_raw(self): + """Gets the all_fields_raw of this FeatureSet. # noqa: E501 + + + :return: The all_fields_raw of this FeatureSet. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields_raw + + @all_fields_raw.setter + def all_fields_raw(self, all_fields_raw): + """Sets the all_fields_raw of this FeatureSet. + + + :param all_fields_raw: The all_fields_raw of this FeatureSet. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields_raw = all_fields_raw + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this FeatureSet. # noqa: E501 + + + :return: The default_instance_for_type of this FeatureSet. # noqa: E501 + :rtype: FeatureSet + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this FeatureSet. + + + :param default_instance_for_type: The default_instance_for_type of this FeatureSet. # noqa: E501 + :type: FeatureSet + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this FeatureSet. # noqa: E501 + + + :return: The descriptor_for_type of this FeatureSet. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this FeatureSet. + + + :param descriptor_for_type: The descriptor_for_type of this FeatureSet. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def enum_type(self): + """Gets the enum_type of this FeatureSet. # noqa: E501 + + + :return: The enum_type of this FeatureSet. # noqa: E501 + :rtype: str + """ + return self._enum_type + + @enum_type.setter + def enum_type(self, enum_type): + """Sets the enum_type of this FeatureSet. + + + :param enum_type: The enum_type of this FeatureSet. # noqa: E501 + :type: str + """ + allowed_values = ["ENUM_TYPE_UNKNOWN", "OPEN", "CLOSED"] # noqa: E501 + if enum_type not in allowed_values: + raise ValueError( + "Invalid value for `enum_type` ({0}), must be one of {1}" # noqa: E501 + .format(enum_type, allowed_values) + ) + + self._enum_type = enum_type + + @property + def field_presence(self): + """Gets the field_presence of this FeatureSet. # noqa: E501 + + + :return: The field_presence of this FeatureSet. # noqa: E501 + :rtype: str + """ + return self._field_presence + + @field_presence.setter + def field_presence(self, field_presence): + """Sets the field_presence of this FeatureSet. + + + :param field_presence: The field_presence of this FeatureSet. # noqa: E501 + :type: str + """ + allowed_values = ["FIELD_PRESENCE_UNKNOWN", "EXPLICIT", "IMPLICIT", "LEGACY_REQUIRED"] # noqa: E501 + if field_presence not in allowed_values: + raise ValueError( + "Invalid value for `field_presence` ({0}), must be one of {1}" # noqa: E501 + .format(field_presence, allowed_values) + ) + + self._field_presence = field_presence + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this FeatureSet. # noqa: E501 + + + :return: The initialization_error_string of this FeatureSet. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this FeatureSet. + + + :param initialization_error_string: The initialization_error_string of this FeatureSet. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this FeatureSet. # noqa: E501 + + + :return: The initialized of this FeatureSet. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this FeatureSet. + + + :param initialized: The initialized of this FeatureSet. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def json_format(self): + """Gets the json_format of this FeatureSet. # noqa: E501 + + + :return: The json_format of this FeatureSet. # noqa: E501 + :rtype: str + """ + return self._json_format + + @json_format.setter + def json_format(self, json_format): + """Sets the json_format of this FeatureSet. + + + :param json_format: The json_format of this FeatureSet. # noqa: E501 + :type: str + """ + allowed_values = ["JSON_FORMAT_UNKNOWN", "ALLOW", "LEGACY_BEST_EFFORT"] # noqa: E501 + if json_format not in allowed_values: + raise ValueError( + "Invalid value for `json_format` ({0}), must be one of {1}" # noqa: E501 + .format(json_format, allowed_values) + ) + + self._json_format = json_format + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this FeatureSet. # noqa: E501 + + + :return: The memoized_serialized_size of this FeatureSet. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this FeatureSet. + + + :param memoized_serialized_size: The memoized_serialized_size of this FeatureSet. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def message_encoding(self): + """Gets the message_encoding of this FeatureSet. # noqa: E501 + + + :return: The message_encoding of this FeatureSet. # noqa: E501 + :rtype: str + """ + return self._message_encoding + + @message_encoding.setter + def message_encoding(self, message_encoding): + """Sets the message_encoding of this FeatureSet. + + + :param message_encoding: The message_encoding of this FeatureSet. # noqa: E501 + :type: str + """ + allowed_values = ["MESSAGE_ENCODING_UNKNOWN", "LENGTH_PREFIXED", "DELIMITED"] # noqa: E501 + if message_encoding not in allowed_values: + raise ValueError( + "Invalid value for `message_encoding` ({0}), must be one of {1}" # noqa: E501 + .format(message_encoding, allowed_values) + ) + + self._message_encoding = message_encoding + + @property + def parser_for_type(self): + """Gets the parser_for_type of this FeatureSet. # noqa: E501 + + + :return: The parser_for_type of this FeatureSet. # noqa: E501 + :rtype: ParserFeatureSet + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this FeatureSet. + + + :param parser_for_type: The parser_for_type of this FeatureSet. # noqa: E501 + :type: ParserFeatureSet + """ + + self._parser_for_type = parser_for_type + + @property + def repeated_field_encoding(self): + """Gets the repeated_field_encoding of this FeatureSet. # noqa: E501 + + + :return: The repeated_field_encoding of this FeatureSet. # noqa: E501 + :rtype: str + """ + return self._repeated_field_encoding + + @repeated_field_encoding.setter + def repeated_field_encoding(self, repeated_field_encoding): + """Sets the repeated_field_encoding of this FeatureSet. + + + :param repeated_field_encoding: The repeated_field_encoding of this FeatureSet. # noqa: E501 + :type: str + """ + allowed_values = ["REPEATED_FIELD_ENCODING_UNKNOWN", "PACKED", "EXPANDED"] # noqa: E501 + if repeated_field_encoding not in allowed_values: + raise ValueError( + "Invalid value for `repeated_field_encoding` ({0}), must be one of {1}" # noqa: E501 + .format(repeated_field_encoding, allowed_values) + ) + + self._repeated_field_encoding = repeated_field_encoding + + @property + def serialized_size(self): + """Gets the serialized_size of this FeatureSet. # noqa: E501 + + + :return: The serialized_size of this FeatureSet. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this FeatureSet. + + + :param serialized_size: The serialized_size of this FeatureSet. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def unknown_fields(self): + """Gets the unknown_fields of this FeatureSet. # noqa: E501 + + + :return: The unknown_fields of this FeatureSet. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this FeatureSet. + + + :param unknown_fields: The unknown_fields of this FeatureSet. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def utf8_validation(self): + """Gets the utf8_validation of this FeatureSet. # noqa: E501 + + + :return: The utf8_validation of this FeatureSet. # noqa: E501 + :rtype: str + """ + return self._utf8_validation + + @utf8_validation.setter + def utf8_validation(self, utf8_validation): + """Sets the utf8_validation of this FeatureSet. + + + :param utf8_validation: The utf8_validation of this FeatureSet. # noqa: E501 + :type: str + """ + allowed_values = ["UTF8_VALIDATION_UNKNOWN", "NONE", "VERIFY"] # noqa: E501 + if utf8_validation not in allowed_values: + raise ValueError( + "Invalid value for `utf8_validation` ({0}), must be one of {1}" # noqa: E501 + .format(utf8_validation, allowed_values) + ) + + self._utf8_validation = utf8_validation + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FeatureSet, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FeatureSet): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/feature_set_or_builder.py b/src/conductor/client/codegen/models/feature_set_or_builder.py new file mode 100644 index 00000000..ce09b506 --- /dev/null +++ b/src/conductor/client/codegen/models/feature_set_or_builder.py @@ -0,0 +1,432 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FeatureSetOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'enum_type': 'str', + 'field_presence': 'str', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'json_format': 'str', + 'message_encoding': 'str', + 'repeated_field_encoding': 'str', + 'unknown_fields': 'UnknownFieldSet', + 'utf8_validation': 'str' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'enum_type': 'enumType', + 'field_presence': 'fieldPresence', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'json_format': 'jsonFormat', + 'message_encoding': 'messageEncoding', + 'repeated_field_encoding': 'repeatedFieldEncoding', + 'unknown_fields': 'unknownFields', + 'utf8_validation': 'utf8Validation' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, enum_type=None, field_presence=None, initialization_error_string=None, initialized=None, json_format=None, message_encoding=None, repeated_field_encoding=None, unknown_fields=None, utf8_validation=None): # noqa: E501 + """FeatureSetOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._enum_type = None + self._field_presence = None + self._initialization_error_string = None + self._initialized = None + self._json_format = None + self._message_encoding = None + self._repeated_field_encoding = None + self._unknown_fields = None + self._utf8_validation = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if enum_type is not None: + self.enum_type = enum_type + if field_presence is not None: + self.field_presence = field_presence + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if json_format is not None: + self.json_format = json_format + if message_encoding is not None: + self.message_encoding = message_encoding + if repeated_field_encoding is not None: + self.repeated_field_encoding = repeated_field_encoding + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if utf8_validation is not None: + self.utf8_validation = utf8_validation + + @property + def all_fields(self): + """Gets the all_fields of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The all_fields of this FeatureSetOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this FeatureSetOrBuilder. + + + :param all_fields: The all_fields of this FeatureSetOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this FeatureSetOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this FeatureSetOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this FeatureSetOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this FeatureSetOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this FeatureSetOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this FeatureSetOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def enum_type(self): + """Gets the enum_type of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The enum_type of this FeatureSetOrBuilder. # noqa: E501 + :rtype: str + """ + return self._enum_type + + @enum_type.setter + def enum_type(self, enum_type): + """Sets the enum_type of this FeatureSetOrBuilder. + + + :param enum_type: The enum_type of this FeatureSetOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["ENUM_TYPE_UNKNOWN", "OPEN", "CLOSED"] # noqa: E501 + if enum_type not in allowed_values: + raise ValueError( + "Invalid value for `enum_type` ({0}), must be one of {1}" # noqa: E501 + .format(enum_type, allowed_values) + ) + + self._enum_type = enum_type + + @property + def field_presence(self): + """Gets the field_presence of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The field_presence of this FeatureSetOrBuilder. # noqa: E501 + :rtype: str + """ + return self._field_presence + + @field_presence.setter + def field_presence(self, field_presence): + """Sets the field_presence of this FeatureSetOrBuilder. + + + :param field_presence: The field_presence of this FeatureSetOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["FIELD_PRESENCE_UNKNOWN", "EXPLICIT", "IMPLICIT", "LEGACY_REQUIRED"] # noqa: E501 + if field_presence not in allowed_values: + raise ValueError( + "Invalid value for `field_presence` ({0}), must be one of {1}" # noqa: E501 + .format(field_presence, allowed_values) + ) + + self._field_presence = field_presence + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this FeatureSetOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this FeatureSetOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this FeatureSetOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The initialized of this FeatureSetOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this FeatureSetOrBuilder. + + + :param initialized: The initialized of this FeatureSetOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def json_format(self): + """Gets the json_format of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The json_format of this FeatureSetOrBuilder. # noqa: E501 + :rtype: str + """ + return self._json_format + + @json_format.setter + def json_format(self, json_format): + """Sets the json_format of this FeatureSetOrBuilder. + + + :param json_format: The json_format of this FeatureSetOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["JSON_FORMAT_UNKNOWN", "ALLOW", "LEGACY_BEST_EFFORT"] # noqa: E501 + if json_format not in allowed_values: + raise ValueError( + "Invalid value for `json_format` ({0}), must be one of {1}" # noqa: E501 + .format(json_format, allowed_values) + ) + + self._json_format = json_format + + @property + def message_encoding(self): + """Gets the message_encoding of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The message_encoding of this FeatureSetOrBuilder. # noqa: E501 + :rtype: str + """ + return self._message_encoding + + @message_encoding.setter + def message_encoding(self, message_encoding): + """Sets the message_encoding of this FeatureSetOrBuilder. + + + :param message_encoding: The message_encoding of this FeatureSetOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["MESSAGE_ENCODING_UNKNOWN", "LENGTH_PREFIXED", "DELIMITED"] # noqa: E501 + if message_encoding not in allowed_values: + raise ValueError( + "Invalid value for `message_encoding` ({0}), must be one of {1}" # noqa: E501 + .format(message_encoding, allowed_values) + ) + + self._message_encoding = message_encoding + + @property + def repeated_field_encoding(self): + """Gets the repeated_field_encoding of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The repeated_field_encoding of this FeatureSetOrBuilder. # noqa: E501 + :rtype: str + """ + return self._repeated_field_encoding + + @repeated_field_encoding.setter + def repeated_field_encoding(self, repeated_field_encoding): + """Sets the repeated_field_encoding of this FeatureSetOrBuilder. + + + :param repeated_field_encoding: The repeated_field_encoding of this FeatureSetOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["REPEATED_FIELD_ENCODING_UNKNOWN", "PACKED", "EXPANDED"] # noqa: E501 + if repeated_field_encoding not in allowed_values: + raise ValueError( + "Invalid value for `repeated_field_encoding` ({0}), must be one of {1}" # noqa: E501 + .format(repeated_field_encoding, allowed_values) + ) + + self._repeated_field_encoding = repeated_field_encoding + + @property + def unknown_fields(self): + """Gets the unknown_fields of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this FeatureSetOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this FeatureSetOrBuilder. + + + :param unknown_fields: The unknown_fields of this FeatureSetOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def utf8_validation(self): + """Gets the utf8_validation of this FeatureSetOrBuilder. # noqa: E501 + + + :return: The utf8_validation of this FeatureSetOrBuilder. # noqa: E501 + :rtype: str + """ + return self._utf8_validation + + @utf8_validation.setter + def utf8_validation(self, utf8_validation): + """Sets the utf8_validation of this FeatureSetOrBuilder. + + + :param utf8_validation: The utf8_validation of this FeatureSetOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["UTF8_VALIDATION_UNKNOWN", "NONE", "VERIFY"] # noqa: E501 + if utf8_validation not in allowed_values: + raise ValueError( + "Invalid value for `utf8_validation` ({0}), must be one of {1}" # noqa: E501 + .format(utf8_validation, allowed_values) + ) + + self._utf8_validation = utf8_validation + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FeatureSetOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FeatureSetOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/field_descriptor.py b/src/conductor/client/codegen/models/field_descriptor.py new file mode 100644 index 00000000..012d312e --- /dev/null +++ b/src/conductor/client/codegen/models/field_descriptor.py @@ -0,0 +1,784 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FieldDescriptor(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'containing_oneof': 'OneofDescriptor', + 'containing_type': 'Descriptor', + 'default_value': 'object', + 'enum_type': 'EnumDescriptor', + 'extension': 'bool', + 'extension_scope': 'Descriptor', + 'file': 'FileDescriptor', + 'full_name': 'str', + 'index': 'int', + 'java_type': 'str', + 'json_name': 'str', + 'lite_java_type': 'str', + 'lite_type': 'str', + 'map_field': 'bool', + 'message_type': 'Descriptor', + 'name': 'str', + 'number': 'int', + 'optional': 'bool', + 'options': 'FieldOptions', + 'packable': 'bool', + 'packed': 'bool', + 'proto': 'FieldDescriptorProto', + 'real_containing_oneof': 'OneofDescriptor', + 'repeated': 'bool', + 'required': 'bool', + 'type': 'str' + } + + attribute_map = { + 'containing_oneof': 'containingOneof', + 'containing_type': 'containingType', + 'default_value': 'defaultValue', + 'enum_type': 'enumType', + 'extension': 'extension', + 'extension_scope': 'extensionScope', + 'file': 'file', + 'full_name': 'fullName', + 'index': 'index', + 'java_type': 'javaType', + 'json_name': 'jsonName', + 'lite_java_type': 'liteJavaType', + 'lite_type': 'liteType', + 'map_field': 'mapField', + 'message_type': 'messageType', + 'name': 'name', + 'number': 'number', + 'optional': 'optional', + 'options': 'options', + 'packable': 'packable', + 'packed': 'packed', + 'proto': 'proto', + 'real_containing_oneof': 'realContainingOneof', + 'repeated': 'repeated', + 'required': 'required', + 'type': 'type' + } + + def __init__(self, containing_oneof=None, containing_type=None, default_value=None, enum_type=None, extension=None, extension_scope=None, file=None, full_name=None, index=None, java_type=None, json_name=None, lite_java_type=None, lite_type=None, map_field=None, message_type=None, name=None, number=None, optional=None, options=None, packable=None, packed=None, proto=None, real_containing_oneof=None, repeated=None, required=None, type=None): # noqa: E501 + """FieldDescriptor - a model defined in Swagger""" # noqa: E501 + self._containing_oneof = None + self._containing_type = None + self._default_value = None + self._enum_type = None + self._extension = None + self._extension_scope = None + self._file = None + self._full_name = None + self._index = None + self._java_type = None + self._json_name = None + self._lite_java_type = None + self._lite_type = None + self._map_field = None + self._message_type = None + self._name = None + self._number = None + self._optional = None + self._options = None + self._packable = None + self._packed = None + self._proto = None + self._real_containing_oneof = None + self._repeated = None + self._required = None + self._type = None + self.discriminator = None + if containing_oneof is not None: + self.containing_oneof = containing_oneof + if containing_type is not None: + self.containing_type = containing_type + if default_value is not None: + self.default_value = default_value + if enum_type is not None: + self.enum_type = enum_type + if extension is not None: + self.extension = extension + if extension_scope is not None: + self.extension_scope = extension_scope + if file is not None: + self.file = file + if full_name is not None: + self.full_name = full_name + if index is not None: + self.index = index + if java_type is not None: + self.java_type = java_type + if json_name is not None: + self.json_name = json_name + if lite_java_type is not None: + self.lite_java_type = lite_java_type + if lite_type is not None: + self.lite_type = lite_type + if map_field is not None: + self.map_field = map_field + if message_type is not None: + self.message_type = message_type + if name is not None: + self.name = name + if number is not None: + self.number = number + if optional is not None: + self.optional = optional + if options is not None: + self.options = options + if packable is not None: + self.packable = packable + if packed is not None: + self.packed = packed + if proto is not None: + self.proto = proto + if real_containing_oneof is not None: + self.real_containing_oneof = real_containing_oneof + if repeated is not None: + self.repeated = repeated + if required is not None: + self.required = required + if type is not None: + self.type = type + + @property + def containing_oneof(self): + """Gets the containing_oneof of this FieldDescriptor. # noqa: E501 + + + :return: The containing_oneof of this FieldDescriptor. # noqa: E501 + :rtype: OneofDescriptor + """ + return self._containing_oneof + + @containing_oneof.setter + def containing_oneof(self, containing_oneof): + """Sets the containing_oneof of this FieldDescriptor. + + + :param containing_oneof: The containing_oneof of this FieldDescriptor. # noqa: E501 + :type: OneofDescriptor + """ + + self._containing_oneof = containing_oneof + + @property + def containing_type(self): + """Gets the containing_type of this FieldDescriptor. # noqa: E501 + + + :return: The containing_type of this FieldDescriptor. # noqa: E501 + :rtype: Descriptor + """ + return self._containing_type + + @containing_type.setter + def containing_type(self, containing_type): + """Sets the containing_type of this FieldDescriptor. + + + :param containing_type: The containing_type of this FieldDescriptor. # noqa: E501 + :type: Descriptor + """ + + self._containing_type = containing_type + + @property + def default_value(self): + """Gets the default_value of this FieldDescriptor. # noqa: E501 + + + :return: The default_value of this FieldDescriptor. # noqa: E501 + :rtype: object + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this FieldDescriptor. + + + :param default_value: The default_value of this FieldDescriptor. # noqa: E501 + :type: object + """ + + self._default_value = default_value + + @property + def enum_type(self): + """Gets the enum_type of this FieldDescriptor. # noqa: E501 + + + :return: The enum_type of this FieldDescriptor. # noqa: E501 + :rtype: EnumDescriptor + """ + return self._enum_type + + @enum_type.setter + def enum_type(self, enum_type): + """Sets the enum_type of this FieldDescriptor. + + + :param enum_type: The enum_type of this FieldDescriptor. # noqa: E501 + :type: EnumDescriptor + """ + + self._enum_type = enum_type + + @property + def extension(self): + """Gets the extension of this FieldDescriptor. # noqa: E501 + + + :return: The extension of this FieldDescriptor. # noqa: E501 + :rtype: bool + """ + return self._extension + + @extension.setter + def extension(self, extension): + """Sets the extension of this FieldDescriptor. + + + :param extension: The extension of this FieldDescriptor. # noqa: E501 + :type: bool + """ + + self._extension = extension + + @property + def extension_scope(self): + """Gets the extension_scope of this FieldDescriptor. # noqa: E501 + + + :return: The extension_scope of this FieldDescriptor. # noqa: E501 + :rtype: Descriptor + """ + return self._extension_scope + + @extension_scope.setter + def extension_scope(self, extension_scope): + """Sets the extension_scope of this FieldDescriptor. + + + :param extension_scope: The extension_scope of this FieldDescriptor. # noqa: E501 + :type: Descriptor + """ + + self._extension_scope = extension_scope + + @property + def file(self): + """Gets the file of this FieldDescriptor. # noqa: E501 + + + :return: The file of this FieldDescriptor. # noqa: E501 + :rtype: FileDescriptor + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this FieldDescriptor. + + + :param file: The file of this FieldDescriptor. # noqa: E501 + :type: FileDescriptor + """ + + self._file = file + + @property + def full_name(self): + """Gets the full_name of this FieldDescriptor. # noqa: E501 + + + :return: The full_name of this FieldDescriptor. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this FieldDescriptor. + + + :param full_name: The full_name of this FieldDescriptor. # noqa: E501 + :type: str + """ + + self._full_name = full_name + + @property + def index(self): + """Gets the index of this FieldDescriptor. # noqa: E501 + + + :return: The index of this FieldDescriptor. # noqa: E501 + :rtype: int + """ + return self._index + + @index.setter + def index(self, index): + """Sets the index of this FieldDescriptor. + + + :param index: The index of this FieldDescriptor. # noqa: E501 + :type: int + """ + + self._index = index + + @property + def java_type(self): + """Gets the java_type of this FieldDescriptor. # noqa: E501 + + + :return: The java_type of this FieldDescriptor. # noqa: E501 + :rtype: str + """ + return self._java_type + + @java_type.setter + def java_type(self, java_type): + """Sets the java_type of this FieldDescriptor. + + + :param java_type: The java_type of this FieldDescriptor. # noqa: E501 + :type: str + """ + allowed_values = ["INT", "LONG", "FLOAT", "DOUBLE", "BOOLEAN", "STRING", "BYTE_STRING", "ENUM", "MESSAGE"] # noqa: E501 + if java_type not in allowed_values: + raise ValueError( + "Invalid value for `java_type` ({0}), must be one of {1}" # noqa: E501 + .format(java_type, allowed_values) + ) + + self._java_type = java_type + + @property + def json_name(self): + """Gets the json_name of this FieldDescriptor. # noqa: E501 + + + :return: The json_name of this FieldDescriptor. # noqa: E501 + :rtype: str + """ + return self._json_name + + @json_name.setter + def json_name(self, json_name): + """Sets the json_name of this FieldDescriptor. + + + :param json_name: The json_name of this FieldDescriptor. # noqa: E501 + :type: str + """ + + self._json_name = json_name + + @property + def lite_java_type(self): + """Gets the lite_java_type of this FieldDescriptor. # noqa: E501 + + + :return: The lite_java_type of this FieldDescriptor. # noqa: E501 + :rtype: str + """ + return self._lite_java_type + + @lite_java_type.setter + def lite_java_type(self, lite_java_type): + """Sets the lite_java_type of this FieldDescriptor. + + + :param lite_java_type: The lite_java_type of this FieldDescriptor. # noqa: E501 + :type: str + """ + allowed_values = ["INT", "LONG", "FLOAT", "DOUBLE", "BOOLEAN", "STRING", "BYTE_STRING", "ENUM", "MESSAGE"] # noqa: E501 + if lite_java_type not in allowed_values: + raise ValueError( + "Invalid value for `lite_java_type` ({0}), must be one of {1}" # noqa: E501 + .format(lite_java_type, allowed_values) + ) + + self._lite_java_type = lite_java_type + + @property + def lite_type(self): + """Gets the lite_type of this FieldDescriptor. # noqa: E501 + + + :return: The lite_type of this FieldDescriptor. # noqa: E501 + :rtype: str + """ + return self._lite_type + + @lite_type.setter + def lite_type(self, lite_type): + """Sets the lite_type of this FieldDescriptor. + + + :param lite_type: The lite_type of this FieldDescriptor. # noqa: E501 + :type: str + """ + allowed_values = ["DOUBLE", "FLOAT", "INT64", "UINT64", "INT32", "FIXED64", "FIXED32", "BOOL", "STRING", "GROUP", "MESSAGE", "BYTES", "UINT32", "ENUM", "SFIXED32", "SFIXED64", "SINT32", "SINT64"] # noqa: E501 + if lite_type not in allowed_values: + raise ValueError( + "Invalid value for `lite_type` ({0}), must be one of {1}" # noqa: E501 + .format(lite_type, allowed_values) + ) + + self._lite_type = lite_type + + @property + def map_field(self): + """Gets the map_field of this FieldDescriptor. # noqa: E501 + + + :return: The map_field of this FieldDescriptor. # noqa: E501 + :rtype: bool + """ + return self._map_field + + @map_field.setter + def map_field(self, map_field): + """Sets the map_field of this FieldDescriptor. + + + :param map_field: The map_field of this FieldDescriptor. # noqa: E501 + :type: bool + """ + + self._map_field = map_field + + @property + def message_type(self): + """Gets the message_type of this FieldDescriptor. # noqa: E501 + + + :return: The message_type of this FieldDescriptor. # noqa: E501 + :rtype: Descriptor + """ + return self._message_type + + @message_type.setter + def message_type(self, message_type): + """Sets the message_type of this FieldDescriptor. + + + :param message_type: The message_type of this FieldDescriptor. # noqa: E501 + :type: Descriptor + """ + + self._message_type = message_type + + @property + def name(self): + """Gets the name of this FieldDescriptor. # noqa: E501 + + + :return: The name of this FieldDescriptor. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this FieldDescriptor. + + + :param name: The name of this FieldDescriptor. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def number(self): + """Gets the number of this FieldDescriptor. # noqa: E501 + + + :return: The number of this FieldDescriptor. # noqa: E501 + :rtype: int + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this FieldDescriptor. + + + :param number: The number of this FieldDescriptor. # noqa: E501 + :type: int + """ + + self._number = number + + @property + def optional(self): + """Gets the optional of this FieldDescriptor. # noqa: E501 + + + :return: The optional of this FieldDescriptor. # noqa: E501 + :rtype: bool + """ + return self._optional + + @optional.setter + def optional(self, optional): + """Sets the optional of this FieldDescriptor. + + + :param optional: The optional of this FieldDescriptor. # noqa: E501 + :type: bool + """ + + self._optional = optional + + @property + def options(self): + """Gets the options of this FieldDescriptor. # noqa: E501 + + + :return: The options of this FieldDescriptor. # noqa: E501 + :rtype: FieldOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this FieldDescriptor. + + + :param options: The options of this FieldDescriptor. # noqa: E501 + :type: FieldOptions + """ + + self._options = options + + @property + def packable(self): + """Gets the packable of this FieldDescriptor. # noqa: E501 + + + :return: The packable of this FieldDescriptor. # noqa: E501 + :rtype: bool + """ + return self._packable + + @packable.setter + def packable(self, packable): + """Sets the packable of this FieldDescriptor. + + + :param packable: The packable of this FieldDescriptor. # noqa: E501 + :type: bool + """ + + self._packable = packable + + @property + def packed(self): + """Gets the packed of this FieldDescriptor. # noqa: E501 + + + :return: The packed of this FieldDescriptor. # noqa: E501 + :rtype: bool + """ + return self._packed + + @packed.setter + def packed(self, packed): + """Sets the packed of this FieldDescriptor. + + + :param packed: The packed of this FieldDescriptor. # noqa: E501 + :type: bool + """ + + self._packed = packed + + @property + def proto(self): + """Gets the proto of this FieldDescriptor. # noqa: E501 + + + :return: The proto of this FieldDescriptor. # noqa: E501 + :rtype: FieldDescriptorProto + """ + return self._proto + + @proto.setter + def proto(self, proto): + """Sets the proto of this FieldDescriptor. + + + :param proto: The proto of this FieldDescriptor. # noqa: E501 + :type: FieldDescriptorProto + """ + + self._proto = proto + + @property + def real_containing_oneof(self): + """Gets the real_containing_oneof of this FieldDescriptor. # noqa: E501 + + + :return: The real_containing_oneof of this FieldDescriptor. # noqa: E501 + :rtype: OneofDescriptor + """ + return self._real_containing_oneof + + @real_containing_oneof.setter + def real_containing_oneof(self, real_containing_oneof): + """Sets the real_containing_oneof of this FieldDescriptor. + + + :param real_containing_oneof: The real_containing_oneof of this FieldDescriptor. # noqa: E501 + :type: OneofDescriptor + """ + + self._real_containing_oneof = real_containing_oneof + + @property + def repeated(self): + """Gets the repeated of this FieldDescriptor. # noqa: E501 + + + :return: The repeated of this FieldDescriptor. # noqa: E501 + :rtype: bool + """ + return self._repeated + + @repeated.setter + def repeated(self, repeated): + """Sets the repeated of this FieldDescriptor. + + + :param repeated: The repeated of this FieldDescriptor. # noqa: E501 + :type: bool + """ + + self._repeated = repeated + + @property + def required(self): + """Gets the required of this FieldDescriptor. # noqa: E501 + + + :return: The required of this FieldDescriptor. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this FieldDescriptor. + + + :param required: The required of this FieldDescriptor. # noqa: E501 + :type: bool + """ + + self._required = required + + @property + def type(self): + """Gets the type of this FieldDescriptor. # noqa: E501 + + + :return: The type of this FieldDescriptor. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this FieldDescriptor. + + + :param type: The type of this FieldDescriptor. # noqa: E501 + :type: str + """ + allowed_values = ["DOUBLE", "FLOAT", "INT64", "UINT64", "INT32", "FIXED64", "FIXED32", "BOOL", "STRING", "GROUP", "MESSAGE", "BYTES", "UINT32", "ENUM", "SFIXED32", "SFIXED64", "SINT32", "SINT64"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FieldDescriptor, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FieldDescriptor): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/field_descriptor_proto.py b/src/conductor/client/codegen/models/field_descriptor_proto.py new file mode 100644 index 00000000..90f9dc1e --- /dev/null +++ b/src/conductor/client/codegen/models/field_descriptor_proto.py @@ -0,0 +1,772 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FieldDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'FieldDescriptorProto', + 'default_value': 'str', + 'default_value_bytes': 'ByteString', + 'descriptor_for_type': 'Descriptor', + 'extendee': 'str', + 'extendee_bytes': 'ByteString', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'json_name': 'str', + 'json_name_bytes': 'ByteString', + 'label': 'str', + 'memoized_serialized_size': 'int', + 'name': 'str', + 'name_bytes': 'ByteString', + 'number': 'int', + 'oneof_index': 'int', + 'options': 'FieldOptions', + 'options_or_builder': 'FieldOptionsOrBuilder', + 'parser_for_type': 'ParserFieldDescriptorProto', + 'proto3_optional': 'bool', + 'serialized_size': 'int', + 'type': 'str', + 'type_name': 'str', + 'type_name_bytes': 'ByteString', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'default_value': 'defaultValue', + 'default_value_bytes': 'defaultValueBytes', + 'descriptor_for_type': 'descriptorForType', + 'extendee': 'extendee', + 'extendee_bytes': 'extendeeBytes', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'json_name': 'jsonName', + 'json_name_bytes': 'jsonNameBytes', + 'label': 'label', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'number': 'number', + 'oneof_index': 'oneofIndex', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'parser_for_type': 'parserForType', + 'proto3_optional': 'proto3Optional', + 'serialized_size': 'serializedSize', + 'type': 'type', + 'type_name': 'typeName', + 'type_name_bytes': 'typeNameBytes', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, default_value=None, default_value_bytes=None, descriptor_for_type=None, extendee=None, extendee_bytes=None, initialization_error_string=None, initialized=None, json_name=None, json_name_bytes=None, label=None, memoized_serialized_size=None, name=None, name_bytes=None, number=None, oneof_index=None, options=None, options_or_builder=None, parser_for_type=None, proto3_optional=None, serialized_size=None, type=None, type_name=None, type_name_bytes=None, unknown_fields=None): # noqa: E501 + """FieldDescriptorProto - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._default_value = None + self._default_value_bytes = None + self._descriptor_for_type = None + self._extendee = None + self._extendee_bytes = None + self._initialization_error_string = None + self._initialized = None + self._json_name = None + self._json_name_bytes = None + self._label = None + self._memoized_serialized_size = None + self._name = None + self._name_bytes = None + self._number = None + self._oneof_index = None + self._options = None + self._options_or_builder = None + self._parser_for_type = None + self._proto3_optional = None + self._serialized_size = None + self._type = None + self._type_name = None + self._type_name_bytes = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if default_value is not None: + self.default_value = default_value + if default_value_bytes is not None: + self.default_value_bytes = default_value_bytes + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if extendee is not None: + self.extendee = extendee + if extendee_bytes is not None: + self.extendee_bytes = extendee_bytes + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if json_name is not None: + self.json_name = json_name + if json_name_bytes is not None: + self.json_name_bytes = json_name_bytes + if label is not None: + self.label = label + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if number is not None: + self.number = number + if oneof_index is not None: + self.oneof_index = oneof_index + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if proto3_optional is not None: + self.proto3_optional = proto3_optional + if serialized_size is not None: + self.serialized_size = serialized_size + if type is not None: + self.type = type + if type_name is not None: + self.type_name = type_name + if type_name_bytes is not None: + self.type_name_bytes = type_name_bytes + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this FieldDescriptorProto. # noqa: E501 + + + :return: The all_fields of this FieldDescriptorProto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this FieldDescriptorProto. + + + :param all_fields: The all_fields of this FieldDescriptorProto. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this FieldDescriptorProto. # noqa: E501 + + + :return: The default_instance_for_type of this FieldDescriptorProto. # noqa: E501 + :rtype: FieldDescriptorProto + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this FieldDescriptorProto. + + + :param default_instance_for_type: The default_instance_for_type of this FieldDescriptorProto. # noqa: E501 + :type: FieldDescriptorProto + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def default_value(self): + """Gets the default_value of this FieldDescriptorProto. # noqa: E501 + + + :return: The default_value of this FieldDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this FieldDescriptorProto. + + + :param default_value: The default_value of this FieldDescriptorProto. # noqa: E501 + :type: str + """ + + self._default_value = default_value + + @property + def default_value_bytes(self): + """Gets the default_value_bytes of this FieldDescriptorProto. # noqa: E501 + + + :return: The default_value_bytes of this FieldDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._default_value_bytes + + @default_value_bytes.setter + def default_value_bytes(self, default_value_bytes): + """Sets the default_value_bytes of this FieldDescriptorProto. + + + :param default_value_bytes: The default_value_bytes of this FieldDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._default_value_bytes = default_value_bytes + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this FieldDescriptorProto. # noqa: E501 + + + :return: The descriptor_for_type of this FieldDescriptorProto. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this FieldDescriptorProto. + + + :param descriptor_for_type: The descriptor_for_type of this FieldDescriptorProto. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def extendee(self): + """Gets the extendee of this FieldDescriptorProto. # noqa: E501 + + + :return: The extendee of this FieldDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._extendee + + @extendee.setter + def extendee(self, extendee): + """Sets the extendee of this FieldDescriptorProto. + + + :param extendee: The extendee of this FieldDescriptorProto. # noqa: E501 + :type: str + """ + + self._extendee = extendee + + @property + def extendee_bytes(self): + """Gets the extendee_bytes of this FieldDescriptorProto. # noqa: E501 + + + :return: The extendee_bytes of this FieldDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._extendee_bytes + + @extendee_bytes.setter + def extendee_bytes(self, extendee_bytes): + """Sets the extendee_bytes of this FieldDescriptorProto. + + + :param extendee_bytes: The extendee_bytes of this FieldDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._extendee_bytes = extendee_bytes + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this FieldDescriptorProto. # noqa: E501 + + + :return: The initialization_error_string of this FieldDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this FieldDescriptorProto. + + + :param initialization_error_string: The initialization_error_string of this FieldDescriptorProto. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this FieldDescriptorProto. # noqa: E501 + + + :return: The initialized of this FieldDescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this FieldDescriptorProto. + + + :param initialized: The initialized of this FieldDescriptorProto. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def json_name(self): + """Gets the json_name of this FieldDescriptorProto. # noqa: E501 + + + :return: The json_name of this FieldDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._json_name + + @json_name.setter + def json_name(self, json_name): + """Sets the json_name of this FieldDescriptorProto. + + + :param json_name: The json_name of this FieldDescriptorProto. # noqa: E501 + :type: str + """ + + self._json_name = json_name + + @property + def json_name_bytes(self): + """Gets the json_name_bytes of this FieldDescriptorProto. # noqa: E501 + + + :return: The json_name_bytes of this FieldDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._json_name_bytes + + @json_name_bytes.setter + def json_name_bytes(self, json_name_bytes): + """Sets the json_name_bytes of this FieldDescriptorProto. + + + :param json_name_bytes: The json_name_bytes of this FieldDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._json_name_bytes = json_name_bytes + + @property + def label(self): + """Gets the label of this FieldDescriptorProto. # noqa: E501 + + + :return: The label of this FieldDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this FieldDescriptorProto. + + + :param label: The label of this FieldDescriptorProto. # noqa: E501 + :type: str + """ + allowed_values = ["LABEL_OPTIONAL", "LABEL_REPEATED", "LABEL_REQUIRED"] # noqa: E501 + if label not in allowed_values: + raise ValueError( + "Invalid value for `label` ({0}), must be one of {1}" # noqa: E501 + .format(label, allowed_values) + ) + + self._label = label + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this FieldDescriptorProto. # noqa: E501 + + + :return: The memoized_serialized_size of this FieldDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this FieldDescriptorProto. + + + :param memoized_serialized_size: The memoized_serialized_size of this FieldDescriptorProto. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def name(self): + """Gets the name of this FieldDescriptorProto. # noqa: E501 + + + :return: The name of this FieldDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this FieldDescriptorProto. + + + :param name: The name of this FieldDescriptorProto. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this FieldDescriptorProto. # noqa: E501 + + + :return: The name_bytes of this FieldDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this FieldDescriptorProto. + + + :param name_bytes: The name_bytes of this FieldDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def number(self): + """Gets the number of this FieldDescriptorProto. # noqa: E501 + + + :return: The number of this FieldDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this FieldDescriptorProto. + + + :param number: The number of this FieldDescriptorProto. # noqa: E501 + :type: int + """ + + self._number = number + + @property + def oneof_index(self): + """Gets the oneof_index of this FieldDescriptorProto. # noqa: E501 + + + :return: The oneof_index of this FieldDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._oneof_index + + @oneof_index.setter + def oneof_index(self, oneof_index): + """Sets the oneof_index of this FieldDescriptorProto. + + + :param oneof_index: The oneof_index of this FieldDescriptorProto. # noqa: E501 + :type: int + """ + + self._oneof_index = oneof_index + + @property + def options(self): + """Gets the options of this FieldDescriptorProto. # noqa: E501 + + + :return: The options of this FieldDescriptorProto. # noqa: E501 + :rtype: FieldOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this FieldDescriptorProto. + + + :param options: The options of this FieldDescriptorProto. # noqa: E501 + :type: FieldOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this FieldDescriptorProto. # noqa: E501 + + + :return: The options_or_builder of this FieldDescriptorProto. # noqa: E501 + :rtype: FieldOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this FieldDescriptorProto. + + + :param options_or_builder: The options_or_builder of this FieldDescriptorProto. # noqa: E501 + :type: FieldOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def parser_for_type(self): + """Gets the parser_for_type of this FieldDescriptorProto. # noqa: E501 + + + :return: The parser_for_type of this FieldDescriptorProto. # noqa: E501 + :rtype: ParserFieldDescriptorProto + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this FieldDescriptorProto. + + + :param parser_for_type: The parser_for_type of this FieldDescriptorProto. # noqa: E501 + :type: ParserFieldDescriptorProto + """ + + self._parser_for_type = parser_for_type + + @property + def proto3_optional(self): + """Gets the proto3_optional of this FieldDescriptorProto. # noqa: E501 + + + :return: The proto3_optional of this FieldDescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._proto3_optional + + @proto3_optional.setter + def proto3_optional(self, proto3_optional): + """Sets the proto3_optional of this FieldDescriptorProto. + + + :param proto3_optional: The proto3_optional of this FieldDescriptorProto. # noqa: E501 + :type: bool + """ + + self._proto3_optional = proto3_optional + + @property + def serialized_size(self): + """Gets the serialized_size of this FieldDescriptorProto. # noqa: E501 + + + :return: The serialized_size of this FieldDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this FieldDescriptorProto. + + + :param serialized_size: The serialized_size of this FieldDescriptorProto. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def type(self): + """Gets the type of this FieldDescriptorProto. # noqa: E501 + + + :return: The type of this FieldDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this FieldDescriptorProto. + + + :param type: The type of this FieldDescriptorProto. # noqa: E501 + :type: str + """ + allowed_values = ["TYPE_DOUBLE", "TYPE_FLOAT", "TYPE_INT64", "TYPE_UINT64", "TYPE_INT32", "TYPE_FIXED64", "TYPE_FIXED32", "TYPE_BOOL", "TYPE_STRING", "TYPE_GROUP", "TYPE_MESSAGE", "TYPE_BYTES", "TYPE_UINT32", "TYPE_ENUM", "TYPE_SFIXED32", "TYPE_SFIXED64", "TYPE_SINT32", "TYPE_SINT64"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def type_name(self): + """Gets the type_name of this FieldDescriptorProto. # noqa: E501 + + + :return: The type_name of this FieldDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name): + """Sets the type_name of this FieldDescriptorProto. + + + :param type_name: The type_name of this FieldDescriptorProto. # noqa: E501 + :type: str + """ + + self._type_name = type_name + + @property + def type_name_bytes(self): + """Gets the type_name_bytes of this FieldDescriptorProto. # noqa: E501 + + + :return: The type_name_bytes of this FieldDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._type_name_bytes + + @type_name_bytes.setter + def type_name_bytes(self, type_name_bytes): + """Sets the type_name_bytes of this FieldDescriptorProto. + + + :param type_name_bytes: The type_name_bytes of this FieldDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._type_name_bytes = type_name_bytes + + @property + def unknown_fields(self): + """Gets the unknown_fields of this FieldDescriptorProto. # noqa: E501 + + + :return: The unknown_fields of this FieldDescriptorProto. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this FieldDescriptorProto. + + + :param unknown_fields: The unknown_fields of this FieldDescriptorProto. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FieldDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FieldDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/field_descriptor_proto_or_builder.py b/src/conductor/client/codegen/models/field_descriptor_proto_or_builder.py new file mode 100644 index 00000000..4d37d171 --- /dev/null +++ b/src/conductor/client/codegen/models/field_descriptor_proto_or_builder.py @@ -0,0 +1,694 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FieldDescriptorProtoOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'default_value': 'str', + 'default_value_bytes': 'ByteString', + 'descriptor_for_type': 'Descriptor', + 'extendee': 'str', + 'extendee_bytes': 'ByteString', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'json_name': 'str', + 'json_name_bytes': 'ByteString', + 'label': 'str', + 'name': 'str', + 'name_bytes': 'ByteString', + 'number': 'int', + 'oneof_index': 'int', + 'options': 'FieldOptions', + 'options_or_builder': 'FieldOptionsOrBuilder', + 'proto3_optional': 'bool', + 'type': 'str', + 'type_name': 'str', + 'type_name_bytes': 'ByteString', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'default_value': 'defaultValue', + 'default_value_bytes': 'defaultValueBytes', + 'descriptor_for_type': 'descriptorForType', + 'extendee': 'extendee', + 'extendee_bytes': 'extendeeBytes', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'json_name': 'jsonName', + 'json_name_bytes': 'jsonNameBytes', + 'label': 'label', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'number': 'number', + 'oneof_index': 'oneofIndex', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'proto3_optional': 'proto3Optional', + 'type': 'type', + 'type_name': 'typeName', + 'type_name_bytes': 'typeNameBytes', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, default_value=None, default_value_bytes=None, descriptor_for_type=None, extendee=None, extendee_bytes=None, initialization_error_string=None, initialized=None, json_name=None, json_name_bytes=None, label=None, name=None, name_bytes=None, number=None, oneof_index=None, options=None, options_or_builder=None, proto3_optional=None, type=None, type_name=None, type_name_bytes=None, unknown_fields=None): # noqa: E501 + """FieldDescriptorProtoOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._default_value = None + self._default_value_bytes = None + self._descriptor_for_type = None + self._extendee = None + self._extendee_bytes = None + self._initialization_error_string = None + self._initialized = None + self._json_name = None + self._json_name_bytes = None + self._label = None + self._name = None + self._name_bytes = None + self._number = None + self._oneof_index = None + self._options = None + self._options_or_builder = None + self._proto3_optional = None + self._type = None + self._type_name = None + self._type_name_bytes = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if default_value is not None: + self.default_value = default_value + if default_value_bytes is not None: + self.default_value_bytes = default_value_bytes + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if extendee is not None: + self.extendee = extendee + if extendee_bytes is not None: + self.extendee_bytes = extendee_bytes + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if json_name is not None: + self.json_name = json_name + if json_name_bytes is not None: + self.json_name_bytes = json_name_bytes + if label is not None: + self.label = label + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if number is not None: + self.number = number + if oneof_index is not None: + self.oneof_index = oneof_index + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if proto3_optional is not None: + self.proto3_optional = proto3_optional + if type is not None: + self.type = type + if type_name is not None: + self.type_name = type_name + if type_name_bytes is not None: + self.type_name_bytes = type_name_bytes + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The all_fields of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this FieldDescriptorProtoOrBuilder. + + + :param all_fields: The all_fields of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this FieldDescriptorProtoOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def default_value(self): + """Gets the default_value of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The default_value of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this FieldDescriptorProtoOrBuilder. + + + :param default_value: The default_value of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._default_value = default_value + + @property + def default_value_bytes(self): + """Gets the default_value_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The default_value_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._default_value_bytes + + @default_value_bytes.setter + def default_value_bytes(self, default_value_bytes): + """Sets the default_value_bytes of this FieldDescriptorProtoOrBuilder. + + + :param default_value_bytes: The default_value_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._default_value_bytes = default_value_bytes + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this FieldDescriptorProtoOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def extendee(self): + """Gets the extendee of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The extendee of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._extendee + + @extendee.setter + def extendee(self, extendee): + """Sets the extendee of this FieldDescriptorProtoOrBuilder. + + + :param extendee: The extendee of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._extendee = extendee + + @property + def extendee_bytes(self): + """Gets the extendee_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The extendee_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._extendee_bytes + + @extendee_bytes.setter + def extendee_bytes(self, extendee_bytes): + """Sets the extendee_bytes of this FieldDescriptorProtoOrBuilder. + + + :param extendee_bytes: The extendee_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._extendee_bytes = extendee_bytes + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this FieldDescriptorProtoOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialized of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this FieldDescriptorProtoOrBuilder. + + + :param initialized: The initialized of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def json_name(self): + """Gets the json_name of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The json_name of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._json_name + + @json_name.setter + def json_name(self, json_name): + """Sets the json_name of this FieldDescriptorProtoOrBuilder. + + + :param json_name: The json_name of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._json_name = json_name + + @property + def json_name_bytes(self): + """Gets the json_name_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The json_name_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._json_name_bytes + + @json_name_bytes.setter + def json_name_bytes(self, json_name_bytes): + """Sets the json_name_bytes of this FieldDescriptorProtoOrBuilder. + + + :param json_name_bytes: The json_name_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._json_name_bytes = json_name_bytes + + @property + def label(self): + """Gets the label of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The label of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this FieldDescriptorProtoOrBuilder. + + + :param label: The label of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["LABEL_OPTIONAL", "LABEL_REPEATED", "LABEL_REQUIRED"] # noqa: E501 + if label not in allowed_values: + raise ValueError( + "Invalid value for `label` ({0}), must be one of {1}" # noqa: E501 + .format(label, allowed_values) + ) + + self._label = label + + @property + def name(self): + """Gets the name of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this FieldDescriptorProtoOrBuilder. + + + :param name: The name of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this FieldDescriptorProtoOrBuilder. + + + :param name_bytes: The name_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def number(self): + """Gets the number of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The number of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this FieldDescriptorProtoOrBuilder. + + + :param number: The number of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._number = number + + @property + def oneof_index(self): + """Gets the oneof_index of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The oneof_index of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._oneof_index + + @oneof_index.setter + def oneof_index(self, oneof_index): + """Sets the oneof_index of this FieldDescriptorProtoOrBuilder. + + + :param oneof_index: The oneof_index of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._oneof_index = oneof_index + + @property + def options(self): + """Gets the options of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: FieldOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this FieldDescriptorProtoOrBuilder. + + + :param options: The options of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: FieldOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options_or_builder of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: FieldOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this FieldDescriptorProtoOrBuilder. + + + :param options_or_builder: The options_or_builder of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: FieldOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def proto3_optional(self): + """Gets the proto3_optional of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The proto3_optional of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._proto3_optional + + @proto3_optional.setter + def proto3_optional(self, proto3_optional): + """Sets the proto3_optional of this FieldDescriptorProtoOrBuilder. + + + :param proto3_optional: The proto3_optional of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: bool + """ + + self._proto3_optional = proto3_optional + + @property + def type(self): + """Gets the type of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The type of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this FieldDescriptorProtoOrBuilder. + + + :param type: The type of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["TYPE_DOUBLE", "TYPE_FLOAT", "TYPE_INT64", "TYPE_UINT64", "TYPE_INT32", "TYPE_FIXED64", "TYPE_FIXED32", "TYPE_BOOL", "TYPE_STRING", "TYPE_GROUP", "TYPE_MESSAGE", "TYPE_BYTES", "TYPE_UINT32", "TYPE_ENUM", "TYPE_SFIXED32", "TYPE_SFIXED64", "TYPE_SINT32", "TYPE_SINT64"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def type_name(self): + """Gets the type_name of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The type_name of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name): + """Sets the type_name of this FieldDescriptorProtoOrBuilder. + + + :param type_name: The type_name of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._type_name = type_name + + @property + def type_name_bytes(self): + """Gets the type_name_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The type_name_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._type_name_bytes + + @type_name_bytes.setter + def type_name_bytes(self, type_name_bytes): + """Sets the type_name_bytes of this FieldDescriptorProtoOrBuilder. + + + :param type_name_bytes: The type_name_bytes of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._type_name_bytes = type_name_bytes + + @property + def unknown_fields(self): + """Gets the unknown_fields of this FieldDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this FieldDescriptorProtoOrBuilder. + + + :param unknown_fields: The unknown_fields of this FieldDescriptorProtoOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FieldDescriptorProtoOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FieldDescriptorProtoOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/field_options.py b/src/conductor/client/codegen/models/field_options.py new file mode 100644 index 00000000..2daaf2d8 --- /dev/null +++ b/src/conductor/client/codegen/models/field_options.py @@ -0,0 +1,863 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FieldOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'all_fields_raw': 'dict(str, object)', + 'ctype': 'str', + 'debug_redact': 'bool', + 'default_instance_for_type': 'FieldOptions', + 'deprecated': 'bool', + 'descriptor_for_type': 'Descriptor', + 'edition_defaults_count': 'int', + 'edition_defaults_list': 'list[EditionDefault]', + 'edition_defaults_or_builder_list': 'list[EditionDefaultOrBuilder]', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'jstype': 'str', + 'lazy': 'bool', + 'memoized_serialized_size': 'int', + 'packed': 'bool', + 'parser_for_type': 'ParserFieldOptions', + 'retention': 'str', + 'serialized_size': 'int', + 'targets_count': 'int', + 'targets_list': 'list[str]', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet', + 'unverified_lazy': 'bool', + 'weak': 'bool' + } + + attribute_map = { + 'all_fields': 'allFields', + 'all_fields_raw': 'allFieldsRaw', + 'ctype': 'ctype', + 'debug_redact': 'debugRedact', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'descriptor_for_type': 'descriptorForType', + 'edition_defaults_count': 'editionDefaultsCount', + 'edition_defaults_list': 'editionDefaultsList', + 'edition_defaults_or_builder_list': 'editionDefaultsOrBuilderList', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'jstype': 'jstype', + 'lazy': 'lazy', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'packed': 'packed', + 'parser_for_type': 'parserForType', + 'retention': 'retention', + 'serialized_size': 'serializedSize', + 'targets_count': 'targetsCount', + 'targets_list': 'targetsList', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields', + 'unverified_lazy': 'unverifiedLazy', + 'weak': 'weak' + } + + def __init__(self, all_fields=None, all_fields_raw=None, ctype=None, debug_redact=None, default_instance_for_type=None, deprecated=None, descriptor_for_type=None, edition_defaults_count=None, edition_defaults_list=None, edition_defaults_or_builder_list=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, jstype=None, lazy=None, memoized_serialized_size=None, packed=None, parser_for_type=None, retention=None, serialized_size=None, targets_count=None, targets_list=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None, unverified_lazy=None, weak=None): # noqa: E501 + """FieldOptions - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._all_fields_raw = None + self._ctype = None + self._debug_redact = None + self._default_instance_for_type = None + self._deprecated = None + self._descriptor_for_type = None + self._edition_defaults_count = None + self._edition_defaults_list = None + self._edition_defaults_or_builder_list = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._jstype = None + self._lazy = None + self._memoized_serialized_size = None + self._packed = None + self._parser_for_type = None + self._retention = None + self._serialized_size = None + self._targets_count = None + self._targets_list = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self._unverified_lazy = None + self._weak = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if all_fields_raw is not None: + self.all_fields_raw = all_fields_raw + if ctype is not None: + self.ctype = ctype + if debug_redact is not None: + self.debug_redact = debug_redact + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if edition_defaults_count is not None: + self.edition_defaults_count = edition_defaults_count + if edition_defaults_list is not None: + self.edition_defaults_list = edition_defaults_list + if edition_defaults_or_builder_list is not None: + self.edition_defaults_or_builder_list = edition_defaults_or_builder_list + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if jstype is not None: + self.jstype = jstype + if lazy is not None: + self.lazy = lazy + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if packed is not None: + self.packed = packed + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if retention is not None: + self.retention = retention + if serialized_size is not None: + self.serialized_size = serialized_size + if targets_count is not None: + self.targets_count = targets_count + if targets_list is not None: + self.targets_list = targets_list + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if unverified_lazy is not None: + self.unverified_lazy = unverified_lazy + if weak is not None: + self.weak = weak + + @property + def all_fields(self): + """Gets the all_fields of this FieldOptions. # noqa: E501 + + + :return: The all_fields of this FieldOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this FieldOptions. + + + :param all_fields: The all_fields of this FieldOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def all_fields_raw(self): + """Gets the all_fields_raw of this FieldOptions. # noqa: E501 + + + :return: The all_fields_raw of this FieldOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields_raw + + @all_fields_raw.setter + def all_fields_raw(self, all_fields_raw): + """Sets the all_fields_raw of this FieldOptions. + + + :param all_fields_raw: The all_fields_raw of this FieldOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields_raw = all_fields_raw + + @property + def ctype(self): + """Gets the ctype of this FieldOptions. # noqa: E501 + + + :return: The ctype of this FieldOptions. # noqa: E501 + :rtype: str + """ + return self._ctype + + @ctype.setter + def ctype(self, ctype): + """Sets the ctype of this FieldOptions. + + + :param ctype: The ctype of this FieldOptions. # noqa: E501 + :type: str + """ + allowed_values = ["STRING", "CORD", "STRING_PIECE"] # noqa: E501 + if ctype not in allowed_values: + raise ValueError( + "Invalid value for `ctype` ({0}), must be one of {1}" # noqa: E501 + .format(ctype, allowed_values) + ) + + self._ctype = ctype + + @property + def debug_redact(self): + """Gets the debug_redact of this FieldOptions. # noqa: E501 + + + :return: The debug_redact of this FieldOptions. # noqa: E501 + :rtype: bool + """ + return self._debug_redact + + @debug_redact.setter + def debug_redact(self, debug_redact): + """Sets the debug_redact of this FieldOptions. + + + :param debug_redact: The debug_redact of this FieldOptions. # noqa: E501 + :type: bool + """ + + self._debug_redact = debug_redact + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this FieldOptions. # noqa: E501 + + + :return: The default_instance_for_type of this FieldOptions. # noqa: E501 + :rtype: FieldOptions + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this FieldOptions. + + + :param default_instance_for_type: The default_instance_for_type of this FieldOptions. # noqa: E501 + :type: FieldOptions + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this FieldOptions. # noqa: E501 + + + :return: The deprecated of this FieldOptions. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this FieldOptions. + + + :param deprecated: The deprecated of this FieldOptions. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this FieldOptions. # noqa: E501 + + + :return: The descriptor_for_type of this FieldOptions. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this FieldOptions. + + + :param descriptor_for_type: The descriptor_for_type of this FieldOptions. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def edition_defaults_count(self): + """Gets the edition_defaults_count of this FieldOptions. # noqa: E501 + + + :return: The edition_defaults_count of this FieldOptions. # noqa: E501 + :rtype: int + """ + return self._edition_defaults_count + + @edition_defaults_count.setter + def edition_defaults_count(self, edition_defaults_count): + """Sets the edition_defaults_count of this FieldOptions. + + + :param edition_defaults_count: The edition_defaults_count of this FieldOptions. # noqa: E501 + :type: int + """ + + self._edition_defaults_count = edition_defaults_count + + @property + def edition_defaults_list(self): + """Gets the edition_defaults_list of this FieldOptions. # noqa: E501 + + + :return: The edition_defaults_list of this FieldOptions. # noqa: E501 + :rtype: list[EditionDefault] + """ + return self._edition_defaults_list + + @edition_defaults_list.setter + def edition_defaults_list(self, edition_defaults_list): + """Sets the edition_defaults_list of this FieldOptions. + + + :param edition_defaults_list: The edition_defaults_list of this FieldOptions. # noqa: E501 + :type: list[EditionDefault] + """ + + self._edition_defaults_list = edition_defaults_list + + @property + def edition_defaults_or_builder_list(self): + """Gets the edition_defaults_or_builder_list of this FieldOptions. # noqa: E501 + + + :return: The edition_defaults_or_builder_list of this FieldOptions. # noqa: E501 + :rtype: list[EditionDefaultOrBuilder] + """ + return self._edition_defaults_or_builder_list + + @edition_defaults_or_builder_list.setter + def edition_defaults_or_builder_list(self, edition_defaults_or_builder_list): + """Sets the edition_defaults_or_builder_list of this FieldOptions. + + + :param edition_defaults_or_builder_list: The edition_defaults_or_builder_list of this FieldOptions. # noqa: E501 + :type: list[EditionDefaultOrBuilder] + """ + + self._edition_defaults_or_builder_list = edition_defaults_or_builder_list + + @property + def features(self): + """Gets the features of this FieldOptions. # noqa: E501 + + + :return: The features of this FieldOptions. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this FieldOptions. + + + :param features: The features of this FieldOptions. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this FieldOptions. # noqa: E501 + + + :return: The features_or_builder of this FieldOptions. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this FieldOptions. + + + :param features_or_builder: The features_or_builder of this FieldOptions. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this FieldOptions. # noqa: E501 + + + :return: The initialization_error_string of this FieldOptions. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this FieldOptions. + + + :param initialization_error_string: The initialization_error_string of this FieldOptions. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this FieldOptions. # noqa: E501 + + + :return: The initialized of this FieldOptions. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this FieldOptions. + + + :param initialized: The initialized of this FieldOptions. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def jstype(self): + """Gets the jstype of this FieldOptions. # noqa: E501 + + + :return: The jstype of this FieldOptions. # noqa: E501 + :rtype: str + """ + return self._jstype + + @jstype.setter + def jstype(self, jstype): + """Sets the jstype of this FieldOptions. + + + :param jstype: The jstype of this FieldOptions. # noqa: E501 + :type: str + """ + allowed_values = ["JS_NORMAL", "JS_STRING", "JS_NUMBER"] # noqa: E501 + if jstype not in allowed_values: + raise ValueError( + "Invalid value for `jstype` ({0}), must be one of {1}" # noqa: E501 + .format(jstype, allowed_values) + ) + + self._jstype = jstype + + @property + def lazy(self): + """Gets the lazy of this FieldOptions. # noqa: E501 + + + :return: The lazy of this FieldOptions. # noqa: E501 + :rtype: bool + """ + return self._lazy + + @lazy.setter + def lazy(self, lazy): + """Sets the lazy of this FieldOptions. + + + :param lazy: The lazy of this FieldOptions. # noqa: E501 + :type: bool + """ + + self._lazy = lazy + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this FieldOptions. # noqa: E501 + + + :return: The memoized_serialized_size of this FieldOptions. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this FieldOptions. + + + :param memoized_serialized_size: The memoized_serialized_size of this FieldOptions. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def packed(self): + """Gets the packed of this FieldOptions. # noqa: E501 + + + :return: The packed of this FieldOptions. # noqa: E501 + :rtype: bool + """ + return self._packed + + @packed.setter + def packed(self, packed): + """Sets the packed of this FieldOptions. + + + :param packed: The packed of this FieldOptions. # noqa: E501 + :type: bool + """ + + self._packed = packed + + @property + def parser_for_type(self): + """Gets the parser_for_type of this FieldOptions. # noqa: E501 + + + :return: The parser_for_type of this FieldOptions. # noqa: E501 + :rtype: ParserFieldOptions + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this FieldOptions. + + + :param parser_for_type: The parser_for_type of this FieldOptions. # noqa: E501 + :type: ParserFieldOptions + """ + + self._parser_for_type = parser_for_type + + @property + def retention(self): + """Gets the retention of this FieldOptions. # noqa: E501 + + + :return: The retention of this FieldOptions. # noqa: E501 + :rtype: str + """ + return self._retention + + @retention.setter + def retention(self, retention): + """Sets the retention of this FieldOptions. + + + :param retention: The retention of this FieldOptions. # noqa: E501 + :type: str + """ + allowed_values = ["RETENTION_UNKNOWN", "RETENTION_RUNTIME", "RETENTION_SOURCE"] # noqa: E501 + if retention not in allowed_values: + raise ValueError( + "Invalid value for `retention` ({0}), must be one of {1}" # noqa: E501 + .format(retention, allowed_values) + ) + + self._retention = retention + + @property + def serialized_size(self): + """Gets the serialized_size of this FieldOptions. # noqa: E501 + + + :return: The serialized_size of this FieldOptions. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this FieldOptions. + + + :param serialized_size: The serialized_size of this FieldOptions. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def targets_count(self): + """Gets the targets_count of this FieldOptions. # noqa: E501 + + + :return: The targets_count of this FieldOptions. # noqa: E501 + :rtype: int + """ + return self._targets_count + + @targets_count.setter + def targets_count(self, targets_count): + """Sets the targets_count of this FieldOptions. + + + :param targets_count: The targets_count of this FieldOptions. # noqa: E501 + :type: int + """ + + self._targets_count = targets_count + + @property + def targets_list(self): + """Gets the targets_list of this FieldOptions. # noqa: E501 + + + :return: The targets_list of this FieldOptions. # noqa: E501 + :rtype: list[str] + """ + return self._targets_list + + @targets_list.setter + def targets_list(self, targets_list): + """Sets the targets_list of this FieldOptions. + + + :param targets_list: The targets_list of this FieldOptions. # noqa: E501 + :type: list[str] + """ + allowed_values = ["TARGET_TYPE_UNKNOWN", "TARGET_TYPE_FILE", "TARGET_TYPE_EXTENSION_RANGE", "TARGET_TYPE_MESSAGE", "TARGET_TYPE_FIELD", "TARGET_TYPE_ONEOF", "TARGET_TYPE_ENUM", "TARGET_TYPE_ENUM_ENTRY", "TARGET_TYPE_SERVICE", "TARGET_TYPE_METHOD"] # noqa: E501 + if not set(targets_list).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `targets_list` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(targets_list) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._targets_list = targets_list + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this FieldOptions. # noqa: E501 + + + :return: The uninterpreted_option_count of this FieldOptions. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this FieldOptions. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this FieldOptions. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this FieldOptions. # noqa: E501 + + + :return: The uninterpreted_option_list of this FieldOptions. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this FieldOptions. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this FieldOptions. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this FieldOptions. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this FieldOptions. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this FieldOptions. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this FieldOptions. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this FieldOptions. # noqa: E501 + + + :return: The unknown_fields of this FieldOptions. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this FieldOptions. + + + :param unknown_fields: The unknown_fields of this FieldOptions. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def unverified_lazy(self): + """Gets the unverified_lazy of this FieldOptions. # noqa: E501 + + + :return: The unverified_lazy of this FieldOptions. # noqa: E501 + :rtype: bool + """ + return self._unverified_lazy + + @unverified_lazy.setter + def unverified_lazy(self, unverified_lazy): + """Sets the unverified_lazy of this FieldOptions. + + + :param unverified_lazy: The unverified_lazy of this FieldOptions. # noqa: E501 + :type: bool + """ + + self._unverified_lazy = unverified_lazy + + @property + def weak(self): + """Gets the weak of this FieldOptions. # noqa: E501 + + + :return: The weak of this FieldOptions. # noqa: E501 + :rtype: bool + """ + return self._weak + + @weak.setter + def weak(self, weak): + """Sets the weak of this FieldOptions. + + + :param weak: The weak of this FieldOptions. # noqa: E501 + :type: bool + """ + + self._weak = weak + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FieldOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FieldOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/field_options_or_builder.py b/src/conductor/client/codegen/models/field_options_or_builder.py new file mode 100644 index 00000000..452d6a30 --- /dev/null +++ b/src/conductor/client/codegen/models/field_options_or_builder.py @@ -0,0 +1,759 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FieldOptionsOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'ctype': 'str', + 'debug_redact': 'bool', + 'default_instance_for_type': 'Message', + 'deprecated': 'bool', + 'descriptor_for_type': 'Descriptor', + 'edition_defaults_count': 'int', + 'edition_defaults_list': 'list[EditionDefault]', + 'edition_defaults_or_builder_list': 'list[EditionDefaultOrBuilder]', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'jstype': 'str', + 'lazy': 'bool', + 'packed': 'bool', + 'retention': 'str', + 'targets_count': 'int', + 'targets_list': 'list[str]', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet', + 'unverified_lazy': 'bool', + 'weak': 'bool' + } + + attribute_map = { + 'all_fields': 'allFields', + 'ctype': 'ctype', + 'debug_redact': 'debugRedact', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'descriptor_for_type': 'descriptorForType', + 'edition_defaults_count': 'editionDefaultsCount', + 'edition_defaults_list': 'editionDefaultsList', + 'edition_defaults_or_builder_list': 'editionDefaultsOrBuilderList', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'jstype': 'jstype', + 'lazy': 'lazy', + 'packed': 'packed', + 'retention': 'retention', + 'targets_count': 'targetsCount', + 'targets_list': 'targetsList', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields', + 'unverified_lazy': 'unverifiedLazy', + 'weak': 'weak' + } + + def __init__(self, all_fields=None, ctype=None, debug_redact=None, default_instance_for_type=None, deprecated=None, descriptor_for_type=None, edition_defaults_count=None, edition_defaults_list=None, edition_defaults_or_builder_list=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, jstype=None, lazy=None, packed=None, retention=None, targets_count=None, targets_list=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None, unverified_lazy=None, weak=None): # noqa: E501 + """FieldOptionsOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._ctype = None + self._debug_redact = None + self._default_instance_for_type = None + self._deprecated = None + self._descriptor_for_type = None + self._edition_defaults_count = None + self._edition_defaults_list = None + self._edition_defaults_or_builder_list = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._jstype = None + self._lazy = None + self._packed = None + self._retention = None + self._targets_count = None + self._targets_list = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self._unverified_lazy = None + self._weak = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if ctype is not None: + self.ctype = ctype + if debug_redact is not None: + self.debug_redact = debug_redact + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if edition_defaults_count is not None: + self.edition_defaults_count = edition_defaults_count + if edition_defaults_list is not None: + self.edition_defaults_list = edition_defaults_list + if edition_defaults_or_builder_list is not None: + self.edition_defaults_or_builder_list = edition_defaults_or_builder_list + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if jstype is not None: + self.jstype = jstype + if lazy is not None: + self.lazy = lazy + if packed is not None: + self.packed = packed + if retention is not None: + self.retention = retention + if targets_count is not None: + self.targets_count = targets_count + if targets_list is not None: + self.targets_list = targets_list + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if unverified_lazy is not None: + self.unverified_lazy = unverified_lazy + if weak is not None: + self.weak = weak + + @property + def all_fields(self): + """Gets the all_fields of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The all_fields of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this FieldOptionsOrBuilder. + + + :param all_fields: The all_fields of this FieldOptionsOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def ctype(self): + """Gets the ctype of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The ctype of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._ctype + + @ctype.setter + def ctype(self, ctype): + """Sets the ctype of this FieldOptionsOrBuilder. + + + :param ctype: The ctype of this FieldOptionsOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["STRING", "CORD", "STRING_PIECE"] # noqa: E501 + if ctype not in allowed_values: + raise ValueError( + "Invalid value for `ctype` ({0}), must be one of {1}" # noqa: E501 + .format(ctype, allowed_values) + ) + + self._ctype = ctype + + @property + def debug_redact(self): + """Gets the debug_redact of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The debug_redact of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._debug_redact + + @debug_redact.setter + def debug_redact(self, debug_redact): + """Sets the debug_redact of this FieldOptionsOrBuilder. + + + :param debug_redact: The debug_redact of this FieldOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._debug_redact = debug_redact + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this FieldOptionsOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this FieldOptionsOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The deprecated of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this FieldOptionsOrBuilder. + + + :param deprecated: The deprecated of this FieldOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this FieldOptionsOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this FieldOptionsOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def edition_defaults_count(self): + """Gets the edition_defaults_count of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The edition_defaults_count of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._edition_defaults_count + + @edition_defaults_count.setter + def edition_defaults_count(self, edition_defaults_count): + """Sets the edition_defaults_count of this FieldOptionsOrBuilder. + + + :param edition_defaults_count: The edition_defaults_count of this FieldOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._edition_defaults_count = edition_defaults_count + + @property + def edition_defaults_list(self): + """Gets the edition_defaults_list of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The edition_defaults_list of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: list[EditionDefault] + """ + return self._edition_defaults_list + + @edition_defaults_list.setter + def edition_defaults_list(self, edition_defaults_list): + """Sets the edition_defaults_list of this FieldOptionsOrBuilder. + + + :param edition_defaults_list: The edition_defaults_list of this FieldOptionsOrBuilder. # noqa: E501 + :type: list[EditionDefault] + """ + + self._edition_defaults_list = edition_defaults_list + + @property + def edition_defaults_or_builder_list(self): + """Gets the edition_defaults_or_builder_list of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The edition_defaults_or_builder_list of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: list[EditionDefaultOrBuilder] + """ + return self._edition_defaults_or_builder_list + + @edition_defaults_or_builder_list.setter + def edition_defaults_or_builder_list(self, edition_defaults_or_builder_list): + """Sets the edition_defaults_or_builder_list of this FieldOptionsOrBuilder. + + + :param edition_defaults_or_builder_list: The edition_defaults_or_builder_list of this FieldOptionsOrBuilder. # noqa: E501 + :type: list[EditionDefaultOrBuilder] + """ + + self._edition_defaults_or_builder_list = edition_defaults_or_builder_list + + @property + def features(self): + """Gets the features of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The features of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this FieldOptionsOrBuilder. + + + :param features: The features of this FieldOptionsOrBuilder. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The features_or_builder of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this FieldOptionsOrBuilder. + + + :param features_or_builder: The features_or_builder of this FieldOptionsOrBuilder. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this FieldOptionsOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this FieldOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The initialized of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this FieldOptionsOrBuilder. + + + :param initialized: The initialized of this FieldOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def jstype(self): + """Gets the jstype of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The jstype of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._jstype + + @jstype.setter + def jstype(self, jstype): + """Sets the jstype of this FieldOptionsOrBuilder. + + + :param jstype: The jstype of this FieldOptionsOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["JS_NORMAL", "JS_STRING", "JS_NUMBER"] # noqa: E501 + if jstype not in allowed_values: + raise ValueError( + "Invalid value for `jstype` ({0}), must be one of {1}" # noqa: E501 + .format(jstype, allowed_values) + ) + + self._jstype = jstype + + @property + def lazy(self): + """Gets the lazy of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The lazy of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._lazy + + @lazy.setter + def lazy(self, lazy): + """Sets the lazy of this FieldOptionsOrBuilder. + + + :param lazy: The lazy of this FieldOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._lazy = lazy + + @property + def packed(self): + """Gets the packed of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The packed of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._packed + + @packed.setter + def packed(self, packed): + """Sets the packed of this FieldOptionsOrBuilder. + + + :param packed: The packed of this FieldOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._packed = packed + + @property + def retention(self): + """Gets the retention of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The retention of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._retention + + @retention.setter + def retention(self, retention): + """Sets the retention of this FieldOptionsOrBuilder. + + + :param retention: The retention of this FieldOptionsOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["RETENTION_UNKNOWN", "RETENTION_RUNTIME", "RETENTION_SOURCE"] # noqa: E501 + if retention not in allowed_values: + raise ValueError( + "Invalid value for `retention` ({0}), must be one of {1}" # noqa: E501 + .format(retention, allowed_values) + ) + + self._retention = retention + + @property + def targets_count(self): + """Gets the targets_count of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The targets_count of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._targets_count + + @targets_count.setter + def targets_count(self, targets_count): + """Sets the targets_count of this FieldOptionsOrBuilder. + + + :param targets_count: The targets_count of this FieldOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._targets_count = targets_count + + @property + def targets_list(self): + """Gets the targets_list of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The targets_list of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: list[str] + """ + return self._targets_list + + @targets_list.setter + def targets_list(self, targets_list): + """Sets the targets_list of this FieldOptionsOrBuilder. + + + :param targets_list: The targets_list of this FieldOptionsOrBuilder. # noqa: E501 + :type: list[str] + """ + allowed_values = ["TARGET_TYPE_UNKNOWN", "TARGET_TYPE_FILE", "TARGET_TYPE_EXTENSION_RANGE", "TARGET_TYPE_MESSAGE", "TARGET_TYPE_FIELD", "TARGET_TYPE_ONEOF", "TARGET_TYPE_ENUM", "TARGET_TYPE_ENUM_ENTRY", "TARGET_TYPE_SERVICE", "TARGET_TYPE_METHOD"] # noqa: E501 + if not set(targets_list).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `targets_list` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(targets_list) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._targets_list = targets_list + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_count of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this FieldOptionsOrBuilder. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this FieldOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_list of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this FieldOptionsOrBuilder. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this FieldOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this FieldOptionsOrBuilder. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this FieldOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this FieldOptionsOrBuilder. + + + :param unknown_fields: The unknown_fields of this FieldOptionsOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def unverified_lazy(self): + """Gets the unverified_lazy of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The unverified_lazy of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._unverified_lazy + + @unverified_lazy.setter + def unverified_lazy(self, unverified_lazy): + """Sets the unverified_lazy of this FieldOptionsOrBuilder. + + + :param unverified_lazy: The unverified_lazy of this FieldOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._unverified_lazy = unverified_lazy + + @property + def weak(self): + """Gets the weak of this FieldOptionsOrBuilder. # noqa: E501 + + + :return: The weak of this FieldOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._weak + + @weak.setter + def weak(self, weak): + """Sets the weak of this FieldOptionsOrBuilder. + + + :param weak: The weak of this FieldOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._weak = weak + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FieldOptionsOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FieldOptionsOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/file_descriptor.py b/src/conductor/client/codegen/models/file_descriptor.py new file mode 100644 index 00000000..4994bd4a --- /dev/null +++ b/src/conductor/client/codegen/models/file_descriptor.py @@ -0,0 +1,486 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FileDescriptor(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'dependencies': 'list[FileDescriptor]', + 'edition': 'str', + 'edition_name': 'str', + 'enum_types': 'list[EnumDescriptor]', + 'extensions': 'list[FieldDescriptor]', + 'file': 'FileDescriptor', + 'full_name': 'str', + 'message_types': 'list[Descriptor]', + 'name': 'str', + 'options': 'FileOptions', + 'package': 'str', + 'proto': 'FileDescriptorProto', + 'public_dependencies': 'list[FileDescriptor]', + 'services': 'list[ServiceDescriptor]', + 'syntax': 'str' + } + + attribute_map = { + 'dependencies': 'dependencies', + 'edition': 'edition', + 'edition_name': 'editionName', + 'enum_types': 'enumTypes', + 'extensions': 'extensions', + 'file': 'file', + 'full_name': 'fullName', + 'message_types': 'messageTypes', + 'name': 'name', + 'options': 'options', + 'package': 'package', + 'proto': 'proto', + 'public_dependencies': 'publicDependencies', + 'services': 'services', + 'syntax': 'syntax' + } + + def __init__(self, dependencies=None, edition=None, edition_name=None, enum_types=None, extensions=None, file=None, full_name=None, message_types=None, name=None, options=None, package=None, proto=None, public_dependencies=None, services=None, syntax=None): # noqa: E501 + """FileDescriptor - a model defined in Swagger""" # noqa: E501 + self._dependencies = None + self._edition = None + self._edition_name = None + self._enum_types = None + self._extensions = None + self._file = None + self._full_name = None + self._message_types = None + self._name = None + self._options = None + self._package = None + self._proto = None + self._public_dependencies = None + self._services = None + self._syntax = None + self.discriminator = None + if dependencies is not None: + self.dependencies = dependencies + if edition is not None: + self.edition = edition + if edition_name is not None: + self.edition_name = edition_name + if enum_types is not None: + self.enum_types = enum_types + if extensions is not None: + self.extensions = extensions + if file is not None: + self.file = file + if full_name is not None: + self.full_name = full_name + if message_types is not None: + self.message_types = message_types + if name is not None: + self.name = name + if options is not None: + self.options = options + if package is not None: + self.package = package + if proto is not None: + self.proto = proto + if public_dependencies is not None: + self.public_dependencies = public_dependencies + if services is not None: + self.services = services + if syntax is not None: + self.syntax = syntax + + @property + def dependencies(self): + """Gets the dependencies of this FileDescriptor. # noqa: E501 + + + :return: The dependencies of this FileDescriptor. # noqa: E501 + :rtype: list[FileDescriptor] + """ + return self._dependencies + + @dependencies.setter + def dependencies(self, dependencies): + """Sets the dependencies of this FileDescriptor. + + + :param dependencies: The dependencies of this FileDescriptor. # noqa: E501 + :type: list[FileDescriptor] + """ + + self._dependencies = dependencies + + @property + def edition(self): + """Gets the edition of this FileDescriptor. # noqa: E501 + + + :return: The edition of this FileDescriptor. # noqa: E501 + :rtype: str + """ + return self._edition + + @edition.setter + def edition(self, edition): + """Sets the edition of this FileDescriptor. + + + :param edition: The edition of this FileDescriptor. # noqa: E501 + :type: str + """ + allowed_values = ["EDITION_UNKNOWN", "EDITION_PROTO2", "EDITION_PROTO3", "EDITION_2023", "EDITION_1_TEST_ONLY", "EDITION_2_TEST_ONLY", "EDITION_99997_TEST_ONLY", "EDITION_99998_TEST_ONLY", "EDITION_99999_TEST_ONLY"] # noqa: E501 + if edition not in allowed_values: + raise ValueError( + "Invalid value for `edition` ({0}), must be one of {1}" # noqa: E501 + .format(edition, allowed_values) + ) + + self._edition = edition + + @property + def edition_name(self): + """Gets the edition_name of this FileDescriptor. # noqa: E501 + + + :return: The edition_name of this FileDescriptor. # noqa: E501 + :rtype: str + """ + return self._edition_name + + @edition_name.setter + def edition_name(self, edition_name): + """Sets the edition_name of this FileDescriptor. + + + :param edition_name: The edition_name of this FileDescriptor. # noqa: E501 + :type: str + """ + + self._edition_name = edition_name + + @property + def enum_types(self): + """Gets the enum_types of this FileDescriptor. # noqa: E501 + + + :return: The enum_types of this FileDescriptor. # noqa: E501 + :rtype: list[EnumDescriptor] + """ + return self._enum_types + + @enum_types.setter + def enum_types(self, enum_types): + """Sets the enum_types of this FileDescriptor. + + + :param enum_types: The enum_types of this FileDescriptor. # noqa: E501 + :type: list[EnumDescriptor] + """ + + self._enum_types = enum_types + + @property + def extensions(self): + """Gets the extensions of this FileDescriptor. # noqa: E501 + + + :return: The extensions of this FileDescriptor. # noqa: E501 + :rtype: list[FieldDescriptor] + """ + return self._extensions + + @extensions.setter + def extensions(self, extensions): + """Sets the extensions of this FileDescriptor. + + + :param extensions: The extensions of this FileDescriptor. # noqa: E501 + :type: list[FieldDescriptor] + """ + + self._extensions = extensions + + @property + def file(self): + """Gets the file of this FileDescriptor. # noqa: E501 + + + :return: The file of this FileDescriptor. # noqa: E501 + :rtype: FileDescriptor + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this FileDescriptor. + + + :param file: The file of this FileDescriptor. # noqa: E501 + :type: FileDescriptor + """ + + self._file = file + + @property + def full_name(self): + """Gets the full_name of this FileDescriptor. # noqa: E501 + + + :return: The full_name of this FileDescriptor. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this FileDescriptor. + + + :param full_name: The full_name of this FileDescriptor. # noqa: E501 + :type: str + """ + + self._full_name = full_name + + @property + def message_types(self): + """Gets the message_types of this FileDescriptor. # noqa: E501 + + + :return: The message_types of this FileDescriptor. # noqa: E501 + :rtype: list[Descriptor] + """ + return self._message_types + + @message_types.setter + def message_types(self, message_types): + """Sets the message_types of this FileDescriptor. + + + :param message_types: The message_types of this FileDescriptor. # noqa: E501 + :type: list[Descriptor] + """ + + self._message_types = message_types + + @property + def name(self): + """Gets the name of this FileDescriptor. # noqa: E501 + + + :return: The name of this FileDescriptor. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this FileDescriptor. + + + :param name: The name of this FileDescriptor. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def options(self): + """Gets the options of this FileDescriptor. # noqa: E501 + + + :return: The options of this FileDescriptor. # noqa: E501 + :rtype: FileOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this FileDescriptor. + + + :param options: The options of this FileDescriptor. # noqa: E501 + :type: FileOptions + """ + + self._options = options + + @property + def package(self): + """Gets the package of this FileDescriptor. # noqa: E501 + + + :return: The package of this FileDescriptor. # noqa: E501 + :rtype: str + """ + return self._package + + @package.setter + def package(self, package): + """Sets the package of this FileDescriptor. + + + :param package: The package of this FileDescriptor. # noqa: E501 + :type: str + """ + + self._package = package + + @property + def proto(self): + """Gets the proto of this FileDescriptor. # noqa: E501 + + + :return: The proto of this FileDescriptor. # noqa: E501 + :rtype: FileDescriptorProto + """ + return self._proto + + @proto.setter + def proto(self, proto): + """Sets the proto of this FileDescriptor. + + + :param proto: The proto of this FileDescriptor. # noqa: E501 + :type: FileDescriptorProto + """ + + self._proto = proto + + @property + def public_dependencies(self): + """Gets the public_dependencies of this FileDescriptor. # noqa: E501 + + + :return: The public_dependencies of this FileDescriptor. # noqa: E501 + :rtype: list[FileDescriptor] + """ + return self._public_dependencies + + @public_dependencies.setter + def public_dependencies(self, public_dependencies): + """Sets the public_dependencies of this FileDescriptor. + + + :param public_dependencies: The public_dependencies of this FileDescriptor. # noqa: E501 + :type: list[FileDescriptor] + """ + + self._public_dependencies = public_dependencies + + @property + def services(self): + """Gets the services of this FileDescriptor. # noqa: E501 + + + :return: The services of this FileDescriptor. # noqa: E501 + :rtype: list[ServiceDescriptor] + """ + return self._services + + @services.setter + def services(self, services): + """Sets the services of this FileDescriptor. + + + :param services: The services of this FileDescriptor. # noqa: E501 + :type: list[ServiceDescriptor] + """ + + self._services = services + + @property + def syntax(self): + """Gets the syntax of this FileDescriptor. # noqa: E501 + + + :return: The syntax of this FileDescriptor. # noqa: E501 + :rtype: str + """ + return self._syntax + + @syntax.setter + def syntax(self, syntax): + """Sets the syntax of this FileDescriptor. + + + :param syntax: The syntax of this FileDescriptor. # noqa: E501 + :type: str + """ + allowed_values = ["UNKNOWN", "PROTO2", "PROTO3", "EDITIONS"] # noqa: E501 + if syntax not in allowed_values: + raise ValueError( + "Invalid value for `syntax` ({0}), must be one of {1}" # noqa: E501 + .format(syntax, allowed_values) + ) + + self._syntax = syntax + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FileDescriptor, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FileDescriptor): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/file_descriptor_proto.py b/src/conductor/client/codegen/models/file_descriptor_proto.py new file mode 100644 index 00000000..b837041f --- /dev/null +++ b/src/conductor/client/codegen/models/file_descriptor_proto.py @@ -0,0 +1,1078 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FileDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'FileDescriptorProto', + 'dependency_count': 'int', + 'dependency_list': 'list[str]', + 'descriptor_for_type': 'Descriptor', + 'edition': 'str', + 'enum_type_count': 'int', + 'enum_type_list': 'list[EnumDescriptorProto]', + 'enum_type_or_builder_list': 'list[EnumDescriptorProtoOrBuilder]', + 'extension_count': 'int', + 'extension_list': 'list[FieldDescriptorProto]', + 'extension_or_builder_list': 'list[FieldDescriptorProtoOrBuilder]', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'message_type_count': 'int', + 'message_type_list': 'list[DescriptorProto]', + 'message_type_or_builder_list': 'list[DescriptorProtoOrBuilder]', + 'name': 'str', + 'name_bytes': 'ByteString', + 'options': 'FileOptions', + 'options_or_builder': 'FileOptionsOrBuilder', + 'package': 'str', + 'package_bytes': 'ByteString', + 'parser_for_type': 'ParserFileDescriptorProto', + 'public_dependency_count': 'int', + 'public_dependency_list': 'list[int]', + 'serialized_size': 'int', + 'service_count': 'int', + 'service_list': 'list[ServiceDescriptorProto]', + 'service_or_builder_list': 'list[ServiceDescriptorProtoOrBuilder]', + 'source_code_info': 'SourceCodeInfo', + 'source_code_info_or_builder': 'SourceCodeInfoOrBuilder', + 'syntax': 'str', + 'syntax_bytes': 'ByteString', + 'unknown_fields': 'UnknownFieldSet', + 'weak_dependency_count': 'int', + 'weak_dependency_list': 'list[int]' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'dependency_count': 'dependencyCount', + 'dependency_list': 'dependencyList', + 'descriptor_for_type': 'descriptorForType', + 'edition': 'edition', + 'enum_type_count': 'enumTypeCount', + 'enum_type_list': 'enumTypeList', + 'enum_type_or_builder_list': 'enumTypeOrBuilderList', + 'extension_count': 'extensionCount', + 'extension_list': 'extensionList', + 'extension_or_builder_list': 'extensionOrBuilderList', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'message_type_count': 'messageTypeCount', + 'message_type_list': 'messageTypeList', + 'message_type_or_builder_list': 'messageTypeOrBuilderList', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'package': 'package', + 'package_bytes': 'packageBytes', + 'parser_for_type': 'parserForType', + 'public_dependency_count': 'publicDependencyCount', + 'public_dependency_list': 'publicDependencyList', + 'serialized_size': 'serializedSize', + 'service_count': 'serviceCount', + 'service_list': 'serviceList', + 'service_or_builder_list': 'serviceOrBuilderList', + 'source_code_info': 'sourceCodeInfo', + 'source_code_info_or_builder': 'sourceCodeInfoOrBuilder', + 'syntax': 'syntax', + 'syntax_bytes': 'syntaxBytes', + 'unknown_fields': 'unknownFields', + 'weak_dependency_count': 'weakDependencyCount', + 'weak_dependency_list': 'weakDependencyList' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, dependency_count=None, dependency_list=None, descriptor_for_type=None, edition=None, enum_type_count=None, enum_type_list=None, enum_type_or_builder_list=None, extension_count=None, extension_list=None, extension_or_builder_list=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, message_type_count=None, message_type_list=None, message_type_or_builder_list=None, name=None, name_bytes=None, options=None, options_or_builder=None, package=None, package_bytes=None, parser_for_type=None, public_dependency_count=None, public_dependency_list=None, serialized_size=None, service_count=None, service_list=None, service_or_builder_list=None, source_code_info=None, source_code_info_or_builder=None, syntax=None, syntax_bytes=None, unknown_fields=None, weak_dependency_count=None, weak_dependency_list=None): # noqa: E501 + """FileDescriptorProto - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._dependency_count = None + self._dependency_list = None + self._descriptor_for_type = None + self._edition = None + self._enum_type_count = None + self._enum_type_list = None + self._enum_type_or_builder_list = None + self._extension_count = None + self._extension_list = None + self._extension_or_builder_list = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._message_type_count = None + self._message_type_list = None + self._message_type_or_builder_list = None + self._name = None + self._name_bytes = None + self._options = None + self._options_or_builder = None + self._package = None + self._package_bytes = None + self._parser_for_type = None + self._public_dependency_count = None + self._public_dependency_list = None + self._serialized_size = None + self._service_count = None + self._service_list = None + self._service_or_builder_list = None + self._source_code_info = None + self._source_code_info_or_builder = None + self._syntax = None + self._syntax_bytes = None + self._unknown_fields = None + self._weak_dependency_count = None + self._weak_dependency_list = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if dependency_count is not None: + self.dependency_count = dependency_count + if dependency_list is not None: + self.dependency_list = dependency_list + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if edition is not None: + self.edition = edition + if enum_type_count is not None: + self.enum_type_count = enum_type_count + if enum_type_list is not None: + self.enum_type_list = enum_type_list + if enum_type_or_builder_list is not None: + self.enum_type_or_builder_list = enum_type_or_builder_list + if extension_count is not None: + self.extension_count = extension_count + if extension_list is not None: + self.extension_list = extension_list + if extension_or_builder_list is not None: + self.extension_or_builder_list = extension_or_builder_list + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if message_type_count is not None: + self.message_type_count = message_type_count + if message_type_list is not None: + self.message_type_list = message_type_list + if message_type_or_builder_list is not None: + self.message_type_or_builder_list = message_type_or_builder_list + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if package is not None: + self.package = package + if package_bytes is not None: + self.package_bytes = package_bytes + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if public_dependency_count is not None: + self.public_dependency_count = public_dependency_count + if public_dependency_list is not None: + self.public_dependency_list = public_dependency_list + if serialized_size is not None: + self.serialized_size = serialized_size + if service_count is not None: + self.service_count = service_count + if service_list is not None: + self.service_list = service_list + if service_or_builder_list is not None: + self.service_or_builder_list = service_or_builder_list + if source_code_info is not None: + self.source_code_info = source_code_info + if source_code_info_or_builder is not None: + self.source_code_info_or_builder = source_code_info_or_builder + if syntax is not None: + self.syntax = syntax + if syntax_bytes is not None: + self.syntax_bytes = syntax_bytes + if unknown_fields is not None: + self.unknown_fields = unknown_fields + if weak_dependency_count is not None: + self.weak_dependency_count = weak_dependency_count + if weak_dependency_list is not None: + self.weak_dependency_list = weak_dependency_list + + @property + def all_fields(self): + """Gets the all_fields of this FileDescriptorProto. # noqa: E501 + + + :return: The all_fields of this FileDescriptorProto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this FileDescriptorProto. + + + :param all_fields: The all_fields of this FileDescriptorProto. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this FileDescriptorProto. # noqa: E501 + + + :return: The default_instance_for_type of this FileDescriptorProto. # noqa: E501 + :rtype: FileDescriptorProto + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this FileDescriptorProto. + + + :param default_instance_for_type: The default_instance_for_type of this FileDescriptorProto. # noqa: E501 + :type: FileDescriptorProto + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def dependency_count(self): + """Gets the dependency_count of this FileDescriptorProto. # noqa: E501 + + + :return: The dependency_count of this FileDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._dependency_count + + @dependency_count.setter + def dependency_count(self, dependency_count): + """Sets the dependency_count of this FileDescriptorProto. + + + :param dependency_count: The dependency_count of this FileDescriptorProto. # noqa: E501 + :type: int + """ + + self._dependency_count = dependency_count + + @property + def dependency_list(self): + """Gets the dependency_list of this FileDescriptorProto. # noqa: E501 + + + :return: The dependency_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[str] + """ + return self._dependency_list + + @dependency_list.setter + def dependency_list(self, dependency_list): + """Sets the dependency_list of this FileDescriptorProto. + + + :param dependency_list: The dependency_list of this FileDescriptorProto. # noqa: E501 + :type: list[str] + """ + + self._dependency_list = dependency_list + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this FileDescriptorProto. # noqa: E501 + + + :return: The descriptor_for_type of this FileDescriptorProto. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this FileDescriptorProto. + + + :param descriptor_for_type: The descriptor_for_type of this FileDescriptorProto. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def edition(self): + """Gets the edition of this FileDescriptorProto. # noqa: E501 + + + :return: The edition of this FileDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._edition + + @edition.setter + def edition(self, edition): + """Sets the edition of this FileDescriptorProto. + + + :param edition: The edition of this FileDescriptorProto. # noqa: E501 + :type: str + """ + allowed_values = ["EDITION_UNKNOWN", "EDITION_PROTO2", "EDITION_PROTO3", "EDITION_2023", "EDITION_1_TEST_ONLY", "EDITION_2_TEST_ONLY", "EDITION_99997_TEST_ONLY", "EDITION_99998_TEST_ONLY", "EDITION_99999_TEST_ONLY"] # noqa: E501 + if edition not in allowed_values: + raise ValueError( + "Invalid value for `edition` ({0}), must be one of {1}" # noqa: E501 + .format(edition, allowed_values) + ) + + self._edition = edition + + @property + def enum_type_count(self): + """Gets the enum_type_count of this FileDescriptorProto. # noqa: E501 + + + :return: The enum_type_count of this FileDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._enum_type_count + + @enum_type_count.setter + def enum_type_count(self, enum_type_count): + """Sets the enum_type_count of this FileDescriptorProto. + + + :param enum_type_count: The enum_type_count of this FileDescriptorProto. # noqa: E501 + :type: int + """ + + self._enum_type_count = enum_type_count + + @property + def enum_type_list(self): + """Gets the enum_type_list of this FileDescriptorProto. # noqa: E501 + + + :return: The enum_type_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[EnumDescriptorProto] + """ + return self._enum_type_list + + @enum_type_list.setter + def enum_type_list(self, enum_type_list): + """Sets the enum_type_list of this FileDescriptorProto. + + + :param enum_type_list: The enum_type_list of this FileDescriptorProto. # noqa: E501 + :type: list[EnumDescriptorProto] + """ + + self._enum_type_list = enum_type_list + + @property + def enum_type_or_builder_list(self): + """Gets the enum_type_or_builder_list of this FileDescriptorProto. # noqa: E501 + + + :return: The enum_type_or_builder_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[EnumDescriptorProtoOrBuilder] + """ + return self._enum_type_or_builder_list + + @enum_type_or_builder_list.setter + def enum_type_or_builder_list(self, enum_type_or_builder_list): + """Sets the enum_type_or_builder_list of this FileDescriptorProto. + + + :param enum_type_or_builder_list: The enum_type_or_builder_list of this FileDescriptorProto. # noqa: E501 + :type: list[EnumDescriptorProtoOrBuilder] + """ + + self._enum_type_or_builder_list = enum_type_or_builder_list + + @property + def extension_count(self): + """Gets the extension_count of this FileDescriptorProto. # noqa: E501 + + + :return: The extension_count of this FileDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._extension_count + + @extension_count.setter + def extension_count(self, extension_count): + """Sets the extension_count of this FileDescriptorProto. + + + :param extension_count: The extension_count of this FileDescriptorProto. # noqa: E501 + :type: int + """ + + self._extension_count = extension_count + + @property + def extension_list(self): + """Gets the extension_list of this FileDescriptorProto. # noqa: E501 + + + :return: The extension_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[FieldDescriptorProto] + """ + return self._extension_list + + @extension_list.setter + def extension_list(self, extension_list): + """Sets the extension_list of this FileDescriptorProto. + + + :param extension_list: The extension_list of this FileDescriptorProto. # noqa: E501 + :type: list[FieldDescriptorProto] + """ + + self._extension_list = extension_list + + @property + def extension_or_builder_list(self): + """Gets the extension_or_builder_list of this FileDescriptorProto. # noqa: E501 + + + :return: The extension_or_builder_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[FieldDescriptorProtoOrBuilder] + """ + return self._extension_or_builder_list + + @extension_or_builder_list.setter + def extension_or_builder_list(self, extension_or_builder_list): + """Sets the extension_or_builder_list of this FileDescriptorProto. + + + :param extension_or_builder_list: The extension_or_builder_list of this FileDescriptorProto. # noqa: E501 + :type: list[FieldDescriptorProtoOrBuilder] + """ + + self._extension_or_builder_list = extension_or_builder_list + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this FileDescriptorProto. # noqa: E501 + + + :return: The initialization_error_string of this FileDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this FileDescriptorProto. + + + :param initialization_error_string: The initialization_error_string of this FileDescriptorProto. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this FileDescriptorProto. # noqa: E501 + + + :return: The initialized of this FileDescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this FileDescriptorProto. + + + :param initialized: The initialized of this FileDescriptorProto. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this FileDescriptorProto. # noqa: E501 + + + :return: The memoized_serialized_size of this FileDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this FileDescriptorProto. + + + :param memoized_serialized_size: The memoized_serialized_size of this FileDescriptorProto. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def message_type_count(self): + """Gets the message_type_count of this FileDescriptorProto. # noqa: E501 + + + :return: The message_type_count of this FileDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._message_type_count + + @message_type_count.setter + def message_type_count(self, message_type_count): + """Sets the message_type_count of this FileDescriptorProto. + + + :param message_type_count: The message_type_count of this FileDescriptorProto. # noqa: E501 + :type: int + """ + + self._message_type_count = message_type_count + + @property + def message_type_list(self): + """Gets the message_type_list of this FileDescriptorProto. # noqa: E501 + + + :return: The message_type_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[DescriptorProto] + """ + return self._message_type_list + + @message_type_list.setter + def message_type_list(self, message_type_list): + """Sets the message_type_list of this FileDescriptorProto. + + + :param message_type_list: The message_type_list of this FileDescriptorProto. # noqa: E501 + :type: list[DescriptorProto] + """ + + self._message_type_list = message_type_list + + @property + def message_type_or_builder_list(self): + """Gets the message_type_or_builder_list of this FileDescriptorProto. # noqa: E501 + + + :return: The message_type_or_builder_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[DescriptorProtoOrBuilder] + """ + return self._message_type_or_builder_list + + @message_type_or_builder_list.setter + def message_type_or_builder_list(self, message_type_or_builder_list): + """Sets the message_type_or_builder_list of this FileDescriptorProto. + + + :param message_type_or_builder_list: The message_type_or_builder_list of this FileDescriptorProto. # noqa: E501 + :type: list[DescriptorProtoOrBuilder] + """ + + self._message_type_or_builder_list = message_type_or_builder_list + + @property + def name(self): + """Gets the name of this FileDescriptorProto. # noqa: E501 + + + :return: The name of this FileDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this FileDescriptorProto. + + + :param name: The name of this FileDescriptorProto. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this FileDescriptorProto. # noqa: E501 + + + :return: The name_bytes of this FileDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this FileDescriptorProto. + + + :param name_bytes: The name_bytes of this FileDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def options(self): + """Gets the options of this FileDescriptorProto. # noqa: E501 + + + :return: The options of this FileDescriptorProto. # noqa: E501 + :rtype: FileOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this FileDescriptorProto. + + + :param options: The options of this FileDescriptorProto. # noqa: E501 + :type: FileOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this FileDescriptorProto. # noqa: E501 + + + :return: The options_or_builder of this FileDescriptorProto. # noqa: E501 + :rtype: FileOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this FileDescriptorProto. + + + :param options_or_builder: The options_or_builder of this FileDescriptorProto. # noqa: E501 + :type: FileOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def package(self): + """Gets the package of this FileDescriptorProto. # noqa: E501 + + + :return: The package of this FileDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._package + + @package.setter + def package(self, package): + """Sets the package of this FileDescriptorProto. + + + :param package: The package of this FileDescriptorProto. # noqa: E501 + :type: str + """ + + self._package = package + + @property + def package_bytes(self): + """Gets the package_bytes of this FileDescriptorProto. # noqa: E501 + + + :return: The package_bytes of this FileDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._package_bytes + + @package_bytes.setter + def package_bytes(self, package_bytes): + """Sets the package_bytes of this FileDescriptorProto. + + + :param package_bytes: The package_bytes of this FileDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._package_bytes = package_bytes + + @property + def parser_for_type(self): + """Gets the parser_for_type of this FileDescriptorProto. # noqa: E501 + + + :return: The parser_for_type of this FileDescriptorProto. # noqa: E501 + :rtype: ParserFileDescriptorProto + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this FileDescriptorProto. + + + :param parser_for_type: The parser_for_type of this FileDescriptorProto. # noqa: E501 + :type: ParserFileDescriptorProto + """ + + self._parser_for_type = parser_for_type + + @property + def public_dependency_count(self): + """Gets the public_dependency_count of this FileDescriptorProto. # noqa: E501 + + + :return: The public_dependency_count of this FileDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._public_dependency_count + + @public_dependency_count.setter + def public_dependency_count(self, public_dependency_count): + """Sets the public_dependency_count of this FileDescriptorProto. + + + :param public_dependency_count: The public_dependency_count of this FileDescriptorProto. # noqa: E501 + :type: int + """ + + self._public_dependency_count = public_dependency_count + + @property + def public_dependency_list(self): + """Gets the public_dependency_list of this FileDescriptorProto. # noqa: E501 + + + :return: The public_dependency_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[int] + """ + return self._public_dependency_list + + @public_dependency_list.setter + def public_dependency_list(self, public_dependency_list): + """Sets the public_dependency_list of this FileDescriptorProto. + + + :param public_dependency_list: The public_dependency_list of this FileDescriptorProto. # noqa: E501 + :type: list[int] + """ + + self._public_dependency_list = public_dependency_list + + @property + def serialized_size(self): + """Gets the serialized_size of this FileDescriptorProto. # noqa: E501 + + + :return: The serialized_size of this FileDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this FileDescriptorProto. + + + :param serialized_size: The serialized_size of this FileDescriptorProto. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def service_count(self): + """Gets the service_count of this FileDescriptorProto. # noqa: E501 + + + :return: The service_count of this FileDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._service_count + + @service_count.setter + def service_count(self, service_count): + """Sets the service_count of this FileDescriptorProto. + + + :param service_count: The service_count of this FileDescriptorProto. # noqa: E501 + :type: int + """ + + self._service_count = service_count + + @property + def service_list(self): + """Gets the service_list of this FileDescriptorProto. # noqa: E501 + + + :return: The service_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[ServiceDescriptorProto] + """ + return self._service_list + + @service_list.setter + def service_list(self, service_list): + """Sets the service_list of this FileDescriptorProto. + + + :param service_list: The service_list of this FileDescriptorProto. # noqa: E501 + :type: list[ServiceDescriptorProto] + """ + + self._service_list = service_list + + @property + def service_or_builder_list(self): + """Gets the service_or_builder_list of this FileDescriptorProto. # noqa: E501 + + + :return: The service_or_builder_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[ServiceDescriptorProtoOrBuilder] + """ + return self._service_or_builder_list + + @service_or_builder_list.setter + def service_or_builder_list(self, service_or_builder_list): + """Sets the service_or_builder_list of this FileDescriptorProto. + + + :param service_or_builder_list: The service_or_builder_list of this FileDescriptorProto. # noqa: E501 + :type: list[ServiceDescriptorProtoOrBuilder] + """ + + self._service_or_builder_list = service_or_builder_list + + @property + def source_code_info(self): + """Gets the source_code_info of this FileDescriptorProto. # noqa: E501 + + + :return: The source_code_info of this FileDescriptorProto. # noqa: E501 + :rtype: SourceCodeInfo + """ + return self._source_code_info + + @source_code_info.setter + def source_code_info(self, source_code_info): + """Sets the source_code_info of this FileDescriptorProto. + + + :param source_code_info: The source_code_info of this FileDescriptorProto. # noqa: E501 + :type: SourceCodeInfo + """ + + self._source_code_info = source_code_info + + @property + def source_code_info_or_builder(self): + """Gets the source_code_info_or_builder of this FileDescriptorProto. # noqa: E501 + + + :return: The source_code_info_or_builder of this FileDescriptorProto. # noqa: E501 + :rtype: SourceCodeInfoOrBuilder + """ + return self._source_code_info_or_builder + + @source_code_info_or_builder.setter + def source_code_info_or_builder(self, source_code_info_or_builder): + """Sets the source_code_info_or_builder of this FileDescriptorProto. + + + :param source_code_info_or_builder: The source_code_info_or_builder of this FileDescriptorProto. # noqa: E501 + :type: SourceCodeInfoOrBuilder + """ + + self._source_code_info_or_builder = source_code_info_or_builder + + @property + def syntax(self): + """Gets the syntax of this FileDescriptorProto. # noqa: E501 + + + :return: The syntax of this FileDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._syntax + + @syntax.setter + def syntax(self, syntax): + """Sets the syntax of this FileDescriptorProto. + + + :param syntax: The syntax of this FileDescriptorProto. # noqa: E501 + :type: str + """ + + self._syntax = syntax + + @property + def syntax_bytes(self): + """Gets the syntax_bytes of this FileDescriptorProto. # noqa: E501 + + + :return: The syntax_bytes of this FileDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._syntax_bytes + + @syntax_bytes.setter + def syntax_bytes(self, syntax_bytes): + """Sets the syntax_bytes of this FileDescriptorProto. + + + :param syntax_bytes: The syntax_bytes of this FileDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._syntax_bytes = syntax_bytes + + @property + def unknown_fields(self): + """Gets the unknown_fields of this FileDescriptorProto. # noqa: E501 + + + :return: The unknown_fields of this FileDescriptorProto. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this FileDescriptorProto. + + + :param unknown_fields: The unknown_fields of this FileDescriptorProto. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + @property + def weak_dependency_count(self): + """Gets the weak_dependency_count of this FileDescriptorProto. # noqa: E501 + + + :return: The weak_dependency_count of this FileDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._weak_dependency_count + + @weak_dependency_count.setter + def weak_dependency_count(self, weak_dependency_count): + """Sets the weak_dependency_count of this FileDescriptorProto. + + + :param weak_dependency_count: The weak_dependency_count of this FileDescriptorProto. # noqa: E501 + :type: int + """ + + self._weak_dependency_count = weak_dependency_count + + @property + def weak_dependency_list(self): + """Gets the weak_dependency_list of this FileDescriptorProto. # noqa: E501 + + + :return: The weak_dependency_list of this FileDescriptorProto. # noqa: E501 + :rtype: list[int] + """ + return self._weak_dependency_list + + @weak_dependency_list.setter + def weak_dependency_list(self, weak_dependency_list): + """Sets the weak_dependency_list of this FileDescriptorProto. + + + :param weak_dependency_list: The weak_dependency_list of this FileDescriptorProto. # noqa: E501 + :type: list[int] + """ + + self._weak_dependency_list = weak_dependency_list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FileDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FileDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/file_options.py b/src/conductor/client/codegen/models/file_options.py new file mode 100644 index 00000000..c369f048 --- /dev/null +++ b/src/conductor/client/codegen/models/file_options.py @@ -0,0 +1,1260 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FileOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'all_fields_raw': 'dict(str, object)', + 'cc_enable_arenas': 'bool', + 'cc_generic_services': 'bool', + 'csharp_namespace': 'str', + 'csharp_namespace_bytes': 'ByteString', + 'default_instance_for_type': 'FileOptions', + 'deprecated': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'go_package': 'str', + 'go_package_bytes': 'ByteString', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'java_generate_equals_and_hash': 'bool', + 'java_generic_services': 'bool', + 'java_multiple_files': 'bool', + 'java_outer_classname': 'str', + 'java_outer_classname_bytes': 'ByteString', + 'java_package': 'str', + 'java_package_bytes': 'ByteString', + 'java_string_check_utf8': 'bool', + 'memoized_serialized_size': 'int', + 'objc_class_prefix': 'str', + 'objc_class_prefix_bytes': 'ByteString', + 'optimize_for': 'str', + 'parser_for_type': 'ParserFileOptions', + 'php_class_prefix': 'str', + 'php_class_prefix_bytes': 'ByteString', + 'php_generic_services': 'bool', + 'php_metadata_namespace': 'str', + 'php_metadata_namespace_bytes': 'ByteString', + 'php_namespace': 'str', + 'php_namespace_bytes': 'ByteString', + 'py_generic_services': 'bool', + 'ruby_package': 'str', + 'ruby_package_bytes': 'ByteString', + 'serialized_size': 'int', + 'swift_prefix': 'str', + 'swift_prefix_bytes': 'ByteString', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'all_fields_raw': 'allFieldsRaw', + 'cc_enable_arenas': 'ccEnableArenas', + 'cc_generic_services': 'ccGenericServices', + 'csharp_namespace': 'csharpNamespace', + 'csharp_namespace_bytes': 'csharpNamespaceBytes', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'go_package': 'goPackage', + 'go_package_bytes': 'goPackageBytes', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'java_generate_equals_and_hash': 'javaGenerateEqualsAndHash', + 'java_generic_services': 'javaGenericServices', + 'java_multiple_files': 'javaMultipleFiles', + 'java_outer_classname': 'javaOuterClassname', + 'java_outer_classname_bytes': 'javaOuterClassnameBytes', + 'java_package': 'javaPackage', + 'java_package_bytes': 'javaPackageBytes', + 'java_string_check_utf8': 'javaStringCheckUtf8', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'objc_class_prefix': 'objcClassPrefix', + 'objc_class_prefix_bytes': 'objcClassPrefixBytes', + 'optimize_for': 'optimizeFor', + 'parser_for_type': 'parserForType', + 'php_class_prefix': 'phpClassPrefix', + 'php_class_prefix_bytes': 'phpClassPrefixBytes', + 'php_generic_services': 'phpGenericServices', + 'php_metadata_namespace': 'phpMetadataNamespace', + 'php_metadata_namespace_bytes': 'phpMetadataNamespaceBytes', + 'php_namespace': 'phpNamespace', + 'php_namespace_bytes': 'phpNamespaceBytes', + 'py_generic_services': 'pyGenericServices', + 'ruby_package': 'rubyPackage', + 'ruby_package_bytes': 'rubyPackageBytes', + 'serialized_size': 'serializedSize', + 'swift_prefix': 'swiftPrefix', + 'swift_prefix_bytes': 'swiftPrefixBytes', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, all_fields_raw=None, cc_enable_arenas=None, cc_generic_services=None, csharp_namespace=None, csharp_namespace_bytes=None, default_instance_for_type=None, deprecated=None, descriptor_for_type=None, features=None, features_or_builder=None, go_package=None, go_package_bytes=None, initialization_error_string=None, initialized=None, java_generate_equals_and_hash=None, java_generic_services=None, java_multiple_files=None, java_outer_classname=None, java_outer_classname_bytes=None, java_package=None, java_package_bytes=None, java_string_check_utf8=None, memoized_serialized_size=None, objc_class_prefix=None, objc_class_prefix_bytes=None, optimize_for=None, parser_for_type=None, php_class_prefix=None, php_class_prefix_bytes=None, php_generic_services=None, php_metadata_namespace=None, php_metadata_namespace_bytes=None, php_namespace=None, php_namespace_bytes=None, py_generic_services=None, ruby_package=None, ruby_package_bytes=None, serialized_size=None, swift_prefix=None, swift_prefix_bytes=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """FileOptions - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._all_fields_raw = None + self._cc_enable_arenas = None + self._cc_generic_services = None + self._csharp_namespace = None + self._csharp_namespace_bytes = None + self._default_instance_for_type = None + self._deprecated = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._go_package = None + self._go_package_bytes = None + self._initialization_error_string = None + self._initialized = None + self._java_generate_equals_and_hash = None + self._java_generic_services = None + self._java_multiple_files = None + self._java_outer_classname = None + self._java_outer_classname_bytes = None + self._java_package = None + self._java_package_bytes = None + self._java_string_check_utf8 = None + self._memoized_serialized_size = None + self._objc_class_prefix = None + self._objc_class_prefix_bytes = None + self._optimize_for = None + self._parser_for_type = None + self._php_class_prefix = None + self._php_class_prefix_bytes = None + self._php_generic_services = None + self._php_metadata_namespace = None + self._php_metadata_namespace_bytes = None + self._php_namespace = None + self._php_namespace_bytes = None + self._py_generic_services = None + self._ruby_package = None + self._ruby_package_bytes = None + self._serialized_size = None + self._swift_prefix = None + self._swift_prefix_bytes = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if all_fields_raw is not None: + self.all_fields_raw = all_fields_raw + if cc_enable_arenas is not None: + self.cc_enable_arenas = cc_enable_arenas + if cc_generic_services is not None: + self.cc_generic_services = cc_generic_services + if csharp_namespace is not None: + self.csharp_namespace = csharp_namespace + if csharp_namespace_bytes is not None: + self.csharp_namespace_bytes = csharp_namespace_bytes + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if go_package is not None: + self.go_package = go_package + if go_package_bytes is not None: + self.go_package_bytes = go_package_bytes + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if java_generate_equals_and_hash is not None: + self.java_generate_equals_and_hash = java_generate_equals_and_hash + if java_generic_services is not None: + self.java_generic_services = java_generic_services + if java_multiple_files is not None: + self.java_multiple_files = java_multiple_files + if java_outer_classname is not None: + self.java_outer_classname = java_outer_classname + if java_outer_classname_bytes is not None: + self.java_outer_classname_bytes = java_outer_classname_bytes + if java_package is not None: + self.java_package = java_package + if java_package_bytes is not None: + self.java_package_bytes = java_package_bytes + if java_string_check_utf8 is not None: + self.java_string_check_utf8 = java_string_check_utf8 + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if objc_class_prefix is not None: + self.objc_class_prefix = objc_class_prefix + if objc_class_prefix_bytes is not None: + self.objc_class_prefix_bytes = objc_class_prefix_bytes + if optimize_for is not None: + self.optimize_for = optimize_for + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if php_class_prefix is not None: + self.php_class_prefix = php_class_prefix + if php_class_prefix_bytes is not None: + self.php_class_prefix_bytes = php_class_prefix_bytes + if php_generic_services is not None: + self.php_generic_services = php_generic_services + if php_metadata_namespace is not None: + self.php_metadata_namespace = php_metadata_namespace + if php_metadata_namespace_bytes is not None: + self.php_metadata_namespace_bytes = php_metadata_namespace_bytes + if php_namespace is not None: + self.php_namespace = php_namespace + if php_namespace_bytes is not None: + self.php_namespace_bytes = php_namespace_bytes + if py_generic_services is not None: + self.py_generic_services = py_generic_services + if ruby_package is not None: + self.ruby_package = ruby_package + if ruby_package_bytes is not None: + self.ruby_package_bytes = ruby_package_bytes + if serialized_size is not None: + self.serialized_size = serialized_size + if swift_prefix is not None: + self.swift_prefix = swift_prefix + if swift_prefix_bytes is not None: + self.swift_prefix_bytes = swift_prefix_bytes + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this FileOptions. # noqa: E501 + + + :return: The all_fields of this FileOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this FileOptions. + + + :param all_fields: The all_fields of this FileOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def all_fields_raw(self): + """Gets the all_fields_raw of this FileOptions. # noqa: E501 + + + :return: The all_fields_raw of this FileOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields_raw + + @all_fields_raw.setter + def all_fields_raw(self, all_fields_raw): + """Sets the all_fields_raw of this FileOptions. + + + :param all_fields_raw: The all_fields_raw of this FileOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields_raw = all_fields_raw + + @property + def cc_enable_arenas(self): + """Gets the cc_enable_arenas of this FileOptions. # noqa: E501 + + + :return: The cc_enable_arenas of this FileOptions. # noqa: E501 + :rtype: bool + """ + return self._cc_enable_arenas + + @cc_enable_arenas.setter + def cc_enable_arenas(self, cc_enable_arenas): + """Sets the cc_enable_arenas of this FileOptions. + + + :param cc_enable_arenas: The cc_enable_arenas of this FileOptions. # noqa: E501 + :type: bool + """ + + self._cc_enable_arenas = cc_enable_arenas + + @property + def cc_generic_services(self): + """Gets the cc_generic_services of this FileOptions. # noqa: E501 + + + :return: The cc_generic_services of this FileOptions. # noqa: E501 + :rtype: bool + """ + return self._cc_generic_services + + @cc_generic_services.setter + def cc_generic_services(self, cc_generic_services): + """Sets the cc_generic_services of this FileOptions. + + + :param cc_generic_services: The cc_generic_services of this FileOptions. # noqa: E501 + :type: bool + """ + + self._cc_generic_services = cc_generic_services + + @property + def csharp_namespace(self): + """Gets the csharp_namespace of this FileOptions. # noqa: E501 + + + :return: The csharp_namespace of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._csharp_namespace + + @csharp_namespace.setter + def csharp_namespace(self, csharp_namespace): + """Sets the csharp_namespace of this FileOptions. + + + :param csharp_namespace: The csharp_namespace of this FileOptions. # noqa: E501 + :type: str + """ + + self._csharp_namespace = csharp_namespace + + @property + def csharp_namespace_bytes(self): + """Gets the csharp_namespace_bytes of this FileOptions. # noqa: E501 + + + :return: The csharp_namespace_bytes of this FileOptions. # noqa: E501 + :rtype: ByteString + """ + return self._csharp_namespace_bytes + + @csharp_namespace_bytes.setter + def csharp_namespace_bytes(self, csharp_namespace_bytes): + """Sets the csharp_namespace_bytes of this FileOptions. + + + :param csharp_namespace_bytes: The csharp_namespace_bytes of this FileOptions. # noqa: E501 + :type: ByteString + """ + + self._csharp_namespace_bytes = csharp_namespace_bytes + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this FileOptions. # noqa: E501 + + + :return: The default_instance_for_type of this FileOptions. # noqa: E501 + :rtype: FileOptions + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this FileOptions. + + + :param default_instance_for_type: The default_instance_for_type of this FileOptions. # noqa: E501 + :type: FileOptions + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this FileOptions. # noqa: E501 + + + :return: The deprecated of this FileOptions. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this FileOptions. + + + :param deprecated: The deprecated of this FileOptions. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this FileOptions. # noqa: E501 + + + :return: The descriptor_for_type of this FileOptions. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this FileOptions. + + + :param descriptor_for_type: The descriptor_for_type of this FileOptions. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this FileOptions. # noqa: E501 + + + :return: The features of this FileOptions. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this FileOptions. + + + :param features: The features of this FileOptions. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this FileOptions. # noqa: E501 + + + :return: The features_or_builder of this FileOptions. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this FileOptions. + + + :param features_or_builder: The features_or_builder of this FileOptions. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def go_package(self): + """Gets the go_package of this FileOptions. # noqa: E501 + + + :return: The go_package of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._go_package + + @go_package.setter + def go_package(self, go_package): + """Sets the go_package of this FileOptions. + + + :param go_package: The go_package of this FileOptions. # noqa: E501 + :type: str + """ + + self._go_package = go_package + + @property + def go_package_bytes(self): + """Gets the go_package_bytes of this FileOptions. # noqa: E501 + + + :return: The go_package_bytes of this FileOptions. # noqa: E501 + :rtype: ByteString + """ + return self._go_package_bytes + + @go_package_bytes.setter + def go_package_bytes(self, go_package_bytes): + """Sets the go_package_bytes of this FileOptions. + + + :param go_package_bytes: The go_package_bytes of this FileOptions. # noqa: E501 + :type: ByteString + """ + + self._go_package_bytes = go_package_bytes + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this FileOptions. # noqa: E501 + + + :return: The initialization_error_string of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this FileOptions. + + + :param initialization_error_string: The initialization_error_string of this FileOptions. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this FileOptions. # noqa: E501 + + + :return: The initialized of this FileOptions. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this FileOptions. + + + :param initialized: The initialized of this FileOptions. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def java_generate_equals_and_hash(self): + """Gets the java_generate_equals_and_hash of this FileOptions. # noqa: E501 + + + :return: The java_generate_equals_and_hash of this FileOptions. # noqa: E501 + :rtype: bool + """ + return self._java_generate_equals_and_hash + + @java_generate_equals_and_hash.setter + def java_generate_equals_and_hash(self, java_generate_equals_and_hash): + """Sets the java_generate_equals_and_hash of this FileOptions. + + + :param java_generate_equals_and_hash: The java_generate_equals_and_hash of this FileOptions. # noqa: E501 + :type: bool + """ + + self._java_generate_equals_and_hash = java_generate_equals_and_hash + + @property + def java_generic_services(self): + """Gets the java_generic_services of this FileOptions. # noqa: E501 + + + :return: The java_generic_services of this FileOptions. # noqa: E501 + :rtype: bool + """ + return self._java_generic_services + + @java_generic_services.setter + def java_generic_services(self, java_generic_services): + """Sets the java_generic_services of this FileOptions. + + + :param java_generic_services: The java_generic_services of this FileOptions. # noqa: E501 + :type: bool + """ + + self._java_generic_services = java_generic_services + + @property + def java_multiple_files(self): + """Gets the java_multiple_files of this FileOptions. # noqa: E501 + + + :return: The java_multiple_files of this FileOptions. # noqa: E501 + :rtype: bool + """ + return self._java_multiple_files + + @java_multiple_files.setter + def java_multiple_files(self, java_multiple_files): + """Sets the java_multiple_files of this FileOptions. + + + :param java_multiple_files: The java_multiple_files of this FileOptions. # noqa: E501 + :type: bool + """ + + self._java_multiple_files = java_multiple_files + + @property + def java_outer_classname(self): + """Gets the java_outer_classname of this FileOptions. # noqa: E501 + + + :return: The java_outer_classname of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._java_outer_classname + + @java_outer_classname.setter + def java_outer_classname(self, java_outer_classname): + """Sets the java_outer_classname of this FileOptions. + + + :param java_outer_classname: The java_outer_classname of this FileOptions. # noqa: E501 + :type: str + """ + + self._java_outer_classname = java_outer_classname + + @property + def java_outer_classname_bytes(self): + """Gets the java_outer_classname_bytes of this FileOptions. # noqa: E501 + + + :return: The java_outer_classname_bytes of this FileOptions. # noqa: E501 + :rtype: ByteString + """ + return self._java_outer_classname_bytes + + @java_outer_classname_bytes.setter + def java_outer_classname_bytes(self, java_outer_classname_bytes): + """Sets the java_outer_classname_bytes of this FileOptions. + + + :param java_outer_classname_bytes: The java_outer_classname_bytes of this FileOptions. # noqa: E501 + :type: ByteString + """ + + self._java_outer_classname_bytes = java_outer_classname_bytes + + @property + def java_package(self): + """Gets the java_package of this FileOptions. # noqa: E501 + + + :return: The java_package of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._java_package + + @java_package.setter + def java_package(self, java_package): + """Sets the java_package of this FileOptions. + + + :param java_package: The java_package of this FileOptions. # noqa: E501 + :type: str + """ + + self._java_package = java_package + + @property + def java_package_bytes(self): + """Gets the java_package_bytes of this FileOptions. # noqa: E501 + + + :return: The java_package_bytes of this FileOptions. # noqa: E501 + :rtype: ByteString + """ + return self._java_package_bytes + + @java_package_bytes.setter + def java_package_bytes(self, java_package_bytes): + """Sets the java_package_bytes of this FileOptions. + + + :param java_package_bytes: The java_package_bytes of this FileOptions. # noqa: E501 + :type: ByteString + """ + + self._java_package_bytes = java_package_bytes + + @property + def java_string_check_utf8(self): + """Gets the java_string_check_utf8 of this FileOptions. # noqa: E501 + + + :return: The java_string_check_utf8 of this FileOptions. # noqa: E501 + :rtype: bool + """ + return self._java_string_check_utf8 + + @java_string_check_utf8.setter + def java_string_check_utf8(self, java_string_check_utf8): + """Sets the java_string_check_utf8 of this FileOptions. + + + :param java_string_check_utf8: The java_string_check_utf8 of this FileOptions. # noqa: E501 + :type: bool + """ + + self._java_string_check_utf8 = java_string_check_utf8 + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this FileOptions. # noqa: E501 + + + :return: The memoized_serialized_size of this FileOptions. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this FileOptions. + + + :param memoized_serialized_size: The memoized_serialized_size of this FileOptions. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def objc_class_prefix(self): + """Gets the objc_class_prefix of this FileOptions. # noqa: E501 + + + :return: The objc_class_prefix of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._objc_class_prefix + + @objc_class_prefix.setter + def objc_class_prefix(self, objc_class_prefix): + """Sets the objc_class_prefix of this FileOptions. + + + :param objc_class_prefix: The objc_class_prefix of this FileOptions. # noqa: E501 + :type: str + """ + + self._objc_class_prefix = objc_class_prefix + + @property + def objc_class_prefix_bytes(self): + """Gets the objc_class_prefix_bytes of this FileOptions. # noqa: E501 + + + :return: The objc_class_prefix_bytes of this FileOptions. # noqa: E501 + :rtype: ByteString + """ + return self._objc_class_prefix_bytes + + @objc_class_prefix_bytes.setter + def objc_class_prefix_bytes(self, objc_class_prefix_bytes): + """Sets the objc_class_prefix_bytes of this FileOptions. + + + :param objc_class_prefix_bytes: The objc_class_prefix_bytes of this FileOptions. # noqa: E501 + :type: ByteString + """ + + self._objc_class_prefix_bytes = objc_class_prefix_bytes + + @property + def optimize_for(self): + """Gets the optimize_for of this FileOptions. # noqa: E501 + + + :return: The optimize_for of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._optimize_for + + @optimize_for.setter + def optimize_for(self, optimize_for): + """Sets the optimize_for of this FileOptions. + + + :param optimize_for: The optimize_for of this FileOptions. # noqa: E501 + :type: str + """ + allowed_values = ["SPEED", "CODE_SIZE", "LITE_RUNTIME"] # noqa: E501 + if optimize_for not in allowed_values: + raise ValueError( + "Invalid value for `optimize_for` ({0}), must be one of {1}" # noqa: E501 + .format(optimize_for, allowed_values) + ) + + self._optimize_for = optimize_for + + @property + def parser_for_type(self): + """Gets the parser_for_type of this FileOptions. # noqa: E501 + + + :return: The parser_for_type of this FileOptions. # noqa: E501 + :rtype: ParserFileOptions + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this FileOptions. + + + :param parser_for_type: The parser_for_type of this FileOptions. # noqa: E501 + :type: ParserFileOptions + """ + + self._parser_for_type = parser_for_type + + @property + def php_class_prefix(self): + """Gets the php_class_prefix of this FileOptions. # noqa: E501 + + + :return: The php_class_prefix of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._php_class_prefix + + @php_class_prefix.setter + def php_class_prefix(self, php_class_prefix): + """Sets the php_class_prefix of this FileOptions. + + + :param php_class_prefix: The php_class_prefix of this FileOptions. # noqa: E501 + :type: str + """ + + self._php_class_prefix = php_class_prefix + + @property + def php_class_prefix_bytes(self): + """Gets the php_class_prefix_bytes of this FileOptions. # noqa: E501 + + + :return: The php_class_prefix_bytes of this FileOptions. # noqa: E501 + :rtype: ByteString + """ + return self._php_class_prefix_bytes + + @php_class_prefix_bytes.setter + def php_class_prefix_bytes(self, php_class_prefix_bytes): + """Sets the php_class_prefix_bytes of this FileOptions. + + + :param php_class_prefix_bytes: The php_class_prefix_bytes of this FileOptions. # noqa: E501 + :type: ByteString + """ + + self._php_class_prefix_bytes = php_class_prefix_bytes + + @property + def php_generic_services(self): + """Gets the php_generic_services of this FileOptions. # noqa: E501 + + + :return: The php_generic_services of this FileOptions. # noqa: E501 + :rtype: bool + """ + return self._php_generic_services + + @php_generic_services.setter + def php_generic_services(self, php_generic_services): + """Sets the php_generic_services of this FileOptions. + + + :param php_generic_services: The php_generic_services of this FileOptions. # noqa: E501 + :type: bool + """ + + self._php_generic_services = php_generic_services + + @property + def php_metadata_namespace(self): + """Gets the php_metadata_namespace of this FileOptions. # noqa: E501 + + + :return: The php_metadata_namespace of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._php_metadata_namespace + + @php_metadata_namespace.setter + def php_metadata_namespace(self, php_metadata_namespace): + """Sets the php_metadata_namespace of this FileOptions. + + + :param php_metadata_namespace: The php_metadata_namespace of this FileOptions. # noqa: E501 + :type: str + """ + + self._php_metadata_namespace = php_metadata_namespace + + @property + def php_metadata_namespace_bytes(self): + """Gets the php_metadata_namespace_bytes of this FileOptions. # noqa: E501 + + + :return: The php_metadata_namespace_bytes of this FileOptions. # noqa: E501 + :rtype: ByteString + """ + return self._php_metadata_namespace_bytes + + @php_metadata_namespace_bytes.setter + def php_metadata_namespace_bytes(self, php_metadata_namespace_bytes): + """Sets the php_metadata_namespace_bytes of this FileOptions. + + + :param php_metadata_namespace_bytes: The php_metadata_namespace_bytes of this FileOptions. # noqa: E501 + :type: ByteString + """ + + self._php_metadata_namespace_bytes = php_metadata_namespace_bytes + + @property + def php_namespace(self): + """Gets the php_namespace of this FileOptions. # noqa: E501 + + + :return: The php_namespace of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._php_namespace + + @php_namespace.setter + def php_namespace(self, php_namespace): + """Sets the php_namespace of this FileOptions. + + + :param php_namespace: The php_namespace of this FileOptions. # noqa: E501 + :type: str + """ + + self._php_namespace = php_namespace + + @property + def php_namespace_bytes(self): + """Gets the php_namespace_bytes of this FileOptions. # noqa: E501 + + + :return: The php_namespace_bytes of this FileOptions. # noqa: E501 + :rtype: ByteString + """ + return self._php_namespace_bytes + + @php_namespace_bytes.setter + def php_namespace_bytes(self, php_namespace_bytes): + """Sets the php_namespace_bytes of this FileOptions. + + + :param php_namespace_bytes: The php_namespace_bytes of this FileOptions. # noqa: E501 + :type: ByteString + """ + + self._php_namespace_bytes = php_namespace_bytes + + @property + def py_generic_services(self): + """Gets the py_generic_services of this FileOptions. # noqa: E501 + + + :return: The py_generic_services of this FileOptions. # noqa: E501 + :rtype: bool + """ + return self._py_generic_services + + @py_generic_services.setter + def py_generic_services(self, py_generic_services): + """Sets the py_generic_services of this FileOptions. + + + :param py_generic_services: The py_generic_services of this FileOptions. # noqa: E501 + :type: bool + """ + + self._py_generic_services = py_generic_services + + @property + def ruby_package(self): + """Gets the ruby_package of this FileOptions. # noqa: E501 + + + :return: The ruby_package of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._ruby_package + + @ruby_package.setter + def ruby_package(self, ruby_package): + """Sets the ruby_package of this FileOptions. + + + :param ruby_package: The ruby_package of this FileOptions. # noqa: E501 + :type: str + """ + + self._ruby_package = ruby_package + + @property + def ruby_package_bytes(self): + """Gets the ruby_package_bytes of this FileOptions. # noqa: E501 + + + :return: The ruby_package_bytes of this FileOptions. # noqa: E501 + :rtype: ByteString + """ + return self._ruby_package_bytes + + @ruby_package_bytes.setter + def ruby_package_bytes(self, ruby_package_bytes): + """Sets the ruby_package_bytes of this FileOptions. + + + :param ruby_package_bytes: The ruby_package_bytes of this FileOptions. # noqa: E501 + :type: ByteString + """ + + self._ruby_package_bytes = ruby_package_bytes + + @property + def serialized_size(self): + """Gets the serialized_size of this FileOptions. # noqa: E501 + + + :return: The serialized_size of this FileOptions. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this FileOptions. + + + :param serialized_size: The serialized_size of this FileOptions. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def swift_prefix(self): + """Gets the swift_prefix of this FileOptions. # noqa: E501 + + + :return: The swift_prefix of this FileOptions. # noqa: E501 + :rtype: str + """ + return self._swift_prefix + + @swift_prefix.setter + def swift_prefix(self, swift_prefix): + """Sets the swift_prefix of this FileOptions. + + + :param swift_prefix: The swift_prefix of this FileOptions. # noqa: E501 + :type: str + """ + + self._swift_prefix = swift_prefix + + @property + def swift_prefix_bytes(self): + """Gets the swift_prefix_bytes of this FileOptions. # noqa: E501 + + + :return: The swift_prefix_bytes of this FileOptions. # noqa: E501 + :rtype: ByteString + """ + return self._swift_prefix_bytes + + @swift_prefix_bytes.setter + def swift_prefix_bytes(self, swift_prefix_bytes): + """Sets the swift_prefix_bytes of this FileOptions. + + + :param swift_prefix_bytes: The swift_prefix_bytes of this FileOptions. # noqa: E501 + :type: ByteString + """ + + self._swift_prefix_bytes = swift_prefix_bytes + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this FileOptions. # noqa: E501 + + + :return: The uninterpreted_option_count of this FileOptions. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this FileOptions. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this FileOptions. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this FileOptions. # noqa: E501 + + + :return: The uninterpreted_option_list of this FileOptions. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this FileOptions. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this FileOptions. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this FileOptions. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this FileOptions. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this FileOptions. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this FileOptions. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this FileOptions. # noqa: E501 + + + :return: The unknown_fields of this FileOptions. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this FileOptions. + + + :param unknown_fields: The unknown_fields of this FileOptions. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FileOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FileOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/file_options_or_builder.py b/src/conductor/client/codegen/models/file_options_or_builder.py new file mode 100644 index 00000000..fbb67490 --- /dev/null +++ b/src/conductor/client/codegen/models/file_options_or_builder.py @@ -0,0 +1,1156 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FileOptionsOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'cc_enable_arenas': 'bool', + 'cc_generic_services': 'bool', + 'csharp_namespace': 'str', + 'csharp_namespace_bytes': 'ByteString', + 'default_instance_for_type': 'Message', + 'deprecated': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'go_package': 'str', + 'go_package_bytes': 'ByteString', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'java_generate_equals_and_hash': 'bool', + 'java_generic_services': 'bool', + 'java_multiple_files': 'bool', + 'java_outer_classname': 'str', + 'java_outer_classname_bytes': 'ByteString', + 'java_package': 'str', + 'java_package_bytes': 'ByteString', + 'java_string_check_utf8': 'bool', + 'objc_class_prefix': 'str', + 'objc_class_prefix_bytes': 'ByteString', + 'optimize_for': 'str', + 'php_class_prefix': 'str', + 'php_class_prefix_bytes': 'ByteString', + 'php_generic_services': 'bool', + 'php_metadata_namespace': 'str', + 'php_metadata_namespace_bytes': 'ByteString', + 'php_namespace': 'str', + 'php_namespace_bytes': 'ByteString', + 'py_generic_services': 'bool', + 'ruby_package': 'str', + 'ruby_package_bytes': 'ByteString', + 'swift_prefix': 'str', + 'swift_prefix_bytes': 'ByteString', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'cc_enable_arenas': 'ccEnableArenas', + 'cc_generic_services': 'ccGenericServices', + 'csharp_namespace': 'csharpNamespace', + 'csharp_namespace_bytes': 'csharpNamespaceBytes', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'go_package': 'goPackage', + 'go_package_bytes': 'goPackageBytes', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'java_generate_equals_and_hash': 'javaGenerateEqualsAndHash', + 'java_generic_services': 'javaGenericServices', + 'java_multiple_files': 'javaMultipleFiles', + 'java_outer_classname': 'javaOuterClassname', + 'java_outer_classname_bytes': 'javaOuterClassnameBytes', + 'java_package': 'javaPackage', + 'java_package_bytes': 'javaPackageBytes', + 'java_string_check_utf8': 'javaStringCheckUtf8', + 'objc_class_prefix': 'objcClassPrefix', + 'objc_class_prefix_bytes': 'objcClassPrefixBytes', + 'optimize_for': 'optimizeFor', + 'php_class_prefix': 'phpClassPrefix', + 'php_class_prefix_bytes': 'phpClassPrefixBytes', + 'php_generic_services': 'phpGenericServices', + 'php_metadata_namespace': 'phpMetadataNamespace', + 'php_metadata_namespace_bytes': 'phpMetadataNamespaceBytes', + 'php_namespace': 'phpNamespace', + 'php_namespace_bytes': 'phpNamespaceBytes', + 'py_generic_services': 'pyGenericServices', + 'ruby_package': 'rubyPackage', + 'ruby_package_bytes': 'rubyPackageBytes', + 'swift_prefix': 'swiftPrefix', + 'swift_prefix_bytes': 'swiftPrefixBytes', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, cc_enable_arenas=None, cc_generic_services=None, csharp_namespace=None, csharp_namespace_bytes=None, default_instance_for_type=None, deprecated=None, descriptor_for_type=None, features=None, features_or_builder=None, go_package=None, go_package_bytes=None, initialization_error_string=None, initialized=None, java_generate_equals_and_hash=None, java_generic_services=None, java_multiple_files=None, java_outer_classname=None, java_outer_classname_bytes=None, java_package=None, java_package_bytes=None, java_string_check_utf8=None, objc_class_prefix=None, objc_class_prefix_bytes=None, optimize_for=None, php_class_prefix=None, php_class_prefix_bytes=None, php_generic_services=None, php_metadata_namespace=None, php_metadata_namespace_bytes=None, php_namespace=None, php_namespace_bytes=None, py_generic_services=None, ruby_package=None, ruby_package_bytes=None, swift_prefix=None, swift_prefix_bytes=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """FileOptionsOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._cc_enable_arenas = None + self._cc_generic_services = None + self._csharp_namespace = None + self._csharp_namespace_bytes = None + self._default_instance_for_type = None + self._deprecated = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._go_package = None + self._go_package_bytes = None + self._initialization_error_string = None + self._initialized = None + self._java_generate_equals_and_hash = None + self._java_generic_services = None + self._java_multiple_files = None + self._java_outer_classname = None + self._java_outer_classname_bytes = None + self._java_package = None + self._java_package_bytes = None + self._java_string_check_utf8 = None + self._objc_class_prefix = None + self._objc_class_prefix_bytes = None + self._optimize_for = None + self._php_class_prefix = None + self._php_class_prefix_bytes = None + self._php_generic_services = None + self._php_metadata_namespace = None + self._php_metadata_namespace_bytes = None + self._php_namespace = None + self._php_namespace_bytes = None + self._py_generic_services = None + self._ruby_package = None + self._ruby_package_bytes = None + self._swift_prefix = None + self._swift_prefix_bytes = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if cc_enable_arenas is not None: + self.cc_enable_arenas = cc_enable_arenas + if cc_generic_services is not None: + self.cc_generic_services = cc_generic_services + if csharp_namespace is not None: + self.csharp_namespace = csharp_namespace + if csharp_namespace_bytes is not None: + self.csharp_namespace_bytes = csharp_namespace_bytes + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if go_package is not None: + self.go_package = go_package + if go_package_bytes is not None: + self.go_package_bytes = go_package_bytes + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if java_generate_equals_and_hash is not None: + self.java_generate_equals_and_hash = java_generate_equals_and_hash + if java_generic_services is not None: + self.java_generic_services = java_generic_services + if java_multiple_files is not None: + self.java_multiple_files = java_multiple_files + if java_outer_classname is not None: + self.java_outer_classname = java_outer_classname + if java_outer_classname_bytes is not None: + self.java_outer_classname_bytes = java_outer_classname_bytes + if java_package is not None: + self.java_package = java_package + if java_package_bytes is not None: + self.java_package_bytes = java_package_bytes + if java_string_check_utf8 is not None: + self.java_string_check_utf8 = java_string_check_utf8 + if objc_class_prefix is not None: + self.objc_class_prefix = objc_class_prefix + if objc_class_prefix_bytes is not None: + self.objc_class_prefix_bytes = objc_class_prefix_bytes + if optimize_for is not None: + self.optimize_for = optimize_for + if php_class_prefix is not None: + self.php_class_prefix = php_class_prefix + if php_class_prefix_bytes is not None: + self.php_class_prefix_bytes = php_class_prefix_bytes + if php_generic_services is not None: + self.php_generic_services = php_generic_services + if php_metadata_namespace is not None: + self.php_metadata_namespace = php_metadata_namespace + if php_metadata_namespace_bytes is not None: + self.php_metadata_namespace_bytes = php_metadata_namespace_bytes + if php_namespace is not None: + self.php_namespace = php_namespace + if php_namespace_bytes is not None: + self.php_namespace_bytes = php_namespace_bytes + if py_generic_services is not None: + self.py_generic_services = py_generic_services + if ruby_package is not None: + self.ruby_package = ruby_package + if ruby_package_bytes is not None: + self.ruby_package_bytes = ruby_package_bytes + if swift_prefix is not None: + self.swift_prefix = swift_prefix + if swift_prefix_bytes is not None: + self.swift_prefix_bytes = swift_prefix_bytes + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The all_fields of this FileOptionsOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this FileOptionsOrBuilder. + + + :param all_fields: The all_fields of this FileOptionsOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def cc_enable_arenas(self): + """Gets the cc_enable_arenas of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The cc_enable_arenas of this FileOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._cc_enable_arenas + + @cc_enable_arenas.setter + def cc_enable_arenas(self, cc_enable_arenas): + """Sets the cc_enable_arenas of this FileOptionsOrBuilder. + + + :param cc_enable_arenas: The cc_enable_arenas of this FileOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._cc_enable_arenas = cc_enable_arenas + + @property + def cc_generic_services(self): + """Gets the cc_generic_services of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The cc_generic_services of this FileOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._cc_generic_services + + @cc_generic_services.setter + def cc_generic_services(self, cc_generic_services): + """Sets the cc_generic_services of this FileOptionsOrBuilder. + + + :param cc_generic_services: The cc_generic_services of this FileOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._cc_generic_services = cc_generic_services + + @property + def csharp_namespace(self): + """Gets the csharp_namespace of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The csharp_namespace of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._csharp_namespace + + @csharp_namespace.setter + def csharp_namespace(self, csharp_namespace): + """Sets the csharp_namespace of this FileOptionsOrBuilder. + + + :param csharp_namespace: The csharp_namespace of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._csharp_namespace = csharp_namespace + + @property + def csharp_namespace_bytes(self): + """Gets the csharp_namespace_bytes of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The csharp_namespace_bytes of this FileOptionsOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._csharp_namespace_bytes + + @csharp_namespace_bytes.setter + def csharp_namespace_bytes(self, csharp_namespace_bytes): + """Sets the csharp_namespace_bytes of this FileOptionsOrBuilder. + + + :param csharp_namespace_bytes: The csharp_namespace_bytes of this FileOptionsOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._csharp_namespace_bytes = csharp_namespace_bytes + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this FileOptionsOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this FileOptionsOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this FileOptionsOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The deprecated of this FileOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this FileOptionsOrBuilder. + + + :param deprecated: The deprecated of this FileOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this FileOptionsOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this FileOptionsOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this FileOptionsOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The features of this FileOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this FileOptionsOrBuilder. + + + :param features: The features of this FileOptionsOrBuilder. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The features_or_builder of this FileOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this FileOptionsOrBuilder. + + + :param features_or_builder: The features_or_builder of this FileOptionsOrBuilder. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def go_package(self): + """Gets the go_package of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The go_package of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._go_package + + @go_package.setter + def go_package(self, go_package): + """Sets the go_package of this FileOptionsOrBuilder. + + + :param go_package: The go_package of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._go_package = go_package + + @property + def go_package_bytes(self): + """Gets the go_package_bytes of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The go_package_bytes of this FileOptionsOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._go_package_bytes + + @go_package_bytes.setter + def go_package_bytes(self, go_package_bytes): + """Sets the go_package_bytes of this FileOptionsOrBuilder. + + + :param go_package_bytes: The go_package_bytes of this FileOptionsOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._go_package_bytes = go_package_bytes + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this FileOptionsOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The initialized of this FileOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this FileOptionsOrBuilder. + + + :param initialized: The initialized of this FileOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def java_generate_equals_and_hash(self): + """Gets the java_generate_equals_and_hash of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The java_generate_equals_and_hash of this FileOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._java_generate_equals_and_hash + + @java_generate_equals_and_hash.setter + def java_generate_equals_and_hash(self, java_generate_equals_and_hash): + """Sets the java_generate_equals_and_hash of this FileOptionsOrBuilder. + + + :param java_generate_equals_and_hash: The java_generate_equals_and_hash of this FileOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._java_generate_equals_and_hash = java_generate_equals_and_hash + + @property + def java_generic_services(self): + """Gets the java_generic_services of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The java_generic_services of this FileOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._java_generic_services + + @java_generic_services.setter + def java_generic_services(self, java_generic_services): + """Sets the java_generic_services of this FileOptionsOrBuilder. + + + :param java_generic_services: The java_generic_services of this FileOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._java_generic_services = java_generic_services + + @property + def java_multiple_files(self): + """Gets the java_multiple_files of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The java_multiple_files of this FileOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._java_multiple_files + + @java_multiple_files.setter + def java_multiple_files(self, java_multiple_files): + """Sets the java_multiple_files of this FileOptionsOrBuilder. + + + :param java_multiple_files: The java_multiple_files of this FileOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._java_multiple_files = java_multiple_files + + @property + def java_outer_classname(self): + """Gets the java_outer_classname of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The java_outer_classname of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._java_outer_classname + + @java_outer_classname.setter + def java_outer_classname(self, java_outer_classname): + """Sets the java_outer_classname of this FileOptionsOrBuilder. + + + :param java_outer_classname: The java_outer_classname of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._java_outer_classname = java_outer_classname + + @property + def java_outer_classname_bytes(self): + """Gets the java_outer_classname_bytes of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The java_outer_classname_bytes of this FileOptionsOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._java_outer_classname_bytes + + @java_outer_classname_bytes.setter + def java_outer_classname_bytes(self, java_outer_classname_bytes): + """Sets the java_outer_classname_bytes of this FileOptionsOrBuilder. + + + :param java_outer_classname_bytes: The java_outer_classname_bytes of this FileOptionsOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._java_outer_classname_bytes = java_outer_classname_bytes + + @property + def java_package(self): + """Gets the java_package of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The java_package of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._java_package + + @java_package.setter + def java_package(self, java_package): + """Sets the java_package of this FileOptionsOrBuilder. + + + :param java_package: The java_package of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._java_package = java_package + + @property + def java_package_bytes(self): + """Gets the java_package_bytes of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The java_package_bytes of this FileOptionsOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._java_package_bytes + + @java_package_bytes.setter + def java_package_bytes(self, java_package_bytes): + """Sets the java_package_bytes of this FileOptionsOrBuilder. + + + :param java_package_bytes: The java_package_bytes of this FileOptionsOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._java_package_bytes = java_package_bytes + + @property + def java_string_check_utf8(self): + """Gets the java_string_check_utf8 of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The java_string_check_utf8 of this FileOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._java_string_check_utf8 + + @java_string_check_utf8.setter + def java_string_check_utf8(self, java_string_check_utf8): + """Sets the java_string_check_utf8 of this FileOptionsOrBuilder. + + + :param java_string_check_utf8: The java_string_check_utf8 of this FileOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._java_string_check_utf8 = java_string_check_utf8 + + @property + def objc_class_prefix(self): + """Gets the objc_class_prefix of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The objc_class_prefix of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._objc_class_prefix + + @objc_class_prefix.setter + def objc_class_prefix(self, objc_class_prefix): + """Sets the objc_class_prefix of this FileOptionsOrBuilder. + + + :param objc_class_prefix: The objc_class_prefix of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._objc_class_prefix = objc_class_prefix + + @property + def objc_class_prefix_bytes(self): + """Gets the objc_class_prefix_bytes of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The objc_class_prefix_bytes of this FileOptionsOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._objc_class_prefix_bytes + + @objc_class_prefix_bytes.setter + def objc_class_prefix_bytes(self, objc_class_prefix_bytes): + """Sets the objc_class_prefix_bytes of this FileOptionsOrBuilder. + + + :param objc_class_prefix_bytes: The objc_class_prefix_bytes of this FileOptionsOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._objc_class_prefix_bytes = objc_class_prefix_bytes + + @property + def optimize_for(self): + """Gets the optimize_for of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The optimize_for of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._optimize_for + + @optimize_for.setter + def optimize_for(self, optimize_for): + """Sets the optimize_for of this FileOptionsOrBuilder. + + + :param optimize_for: The optimize_for of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["SPEED", "CODE_SIZE", "LITE_RUNTIME"] # noqa: E501 + if optimize_for not in allowed_values: + raise ValueError( + "Invalid value for `optimize_for` ({0}), must be one of {1}" # noqa: E501 + .format(optimize_for, allowed_values) + ) + + self._optimize_for = optimize_for + + @property + def php_class_prefix(self): + """Gets the php_class_prefix of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The php_class_prefix of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._php_class_prefix + + @php_class_prefix.setter + def php_class_prefix(self, php_class_prefix): + """Sets the php_class_prefix of this FileOptionsOrBuilder. + + + :param php_class_prefix: The php_class_prefix of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._php_class_prefix = php_class_prefix + + @property + def php_class_prefix_bytes(self): + """Gets the php_class_prefix_bytes of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The php_class_prefix_bytes of this FileOptionsOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._php_class_prefix_bytes + + @php_class_prefix_bytes.setter + def php_class_prefix_bytes(self, php_class_prefix_bytes): + """Sets the php_class_prefix_bytes of this FileOptionsOrBuilder. + + + :param php_class_prefix_bytes: The php_class_prefix_bytes of this FileOptionsOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._php_class_prefix_bytes = php_class_prefix_bytes + + @property + def php_generic_services(self): + """Gets the php_generic_services of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The php_generic_services of this FileOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._php_generic_services + + @php_generic_services.setter + def php_generic_services(self, php_generic_services): + """Sets the php_generic_services of this FileOptionsOrBuilder. + + + :param php_generic_services: The php_generic_services of this FileOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._php_generic_services = php_generic_services + + @property + def php_metadata_namespace(self): + """Gets the php_metadata_namespace of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The php_metadata_namespace of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._php_metadata_namespace + + @php_metadata_namespace.setter + def php_metadata_namespace(self, php_metadata_namespace): + """Sets the php_metadata_namespace of this FileOptionsOrBuilder. + + + :param php_metadata_namespace: The php_metadata_namespace of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._php_metadata_namespace = php_metadata_namespace + + @property + def php_metadata_namespace_bytes(self): + """Gets the php_metadata_namespace_bytes of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The php_metadata_namespace_bytes of this FileOptionsOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._php_metadata_namespace_bytes + + @php_metadata_namespace_bytes.setter + def php_metadata_namespace_bytes(self, php_metadata_namespace_bytes): + """Sets the php_metadata_namespace_bytes of this FileOptionsOrBuilder. + + + :param php_metadata_namespace_bytes: The php_metadata_namespace_bytes of this FileOptionsOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._php_metadata_namespace_bytes = php_metadata_namespace_bytes + + @property + def php_namespace(self): + """Gets the php_namespace of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The php_namespace of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._php_namespace + + @php_namespace.setter + def php_namespace(self, php_namespace): + """Sets the php_namespace of this FileOptionsOrBuilder. + + + :param php_namespace: The php_namespace of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._php_namespace = php_namespace + + @property + def php_namespace_bytes(self): + """Gets the php_namespace_bytes of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The php_namespace_bytes of this FileOptionsOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._php_namespace_bytes + + @php_namespace_bytes.setter + def php_namespace_bytes(self, php_namespace_bytes): + """Sets the php_namespace_bytes of this FileOptionsOrBuilder. + + + :param php_namespace_bytes: The php_namespace_bytes of this FileOptionsOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._php_namespace_bytes = php_namespace_bytes + + @property + def py_generic_services(self): + """Gets the py_generic_services of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The py_generic_services of this FileOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._py_generic_services + + @py_generic_services.setter + def py_generic_services(self, py_generic_services): + """Sets the py_generic_services of this FileOptionsOrBuilder. + + + :param py_generic_services: The py_generic_services of this FileOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._py_generic_services = py_generic_services + + @property + def ruby_package(self): + """Gets the ruby_package of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The ruby_package of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._ruby_package + + @ruby_package.setter + def ruby_package(self, ruby_package): + """Sets the ruby_package of this FileOptionsOrBuilder. + + + :param ruby_package: The ruby_package of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._ruby_package = ruby_package + + @property + def ruby_package_bytes(self): + """Gets the ruby_package_bytes of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The ruby_package_bytes of this FileOptionsOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._ruby_package_bytes + + @ruby_package_bytes.setter + def ruby_package_bytes(self, ruby_package_bytes): + """Sets the ruby_package_bytes of this FileOptionsOrBuilder. + + + :param ruby_package_bytes: The ruby_package_bytes of this FileOptionsOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._ruby_package_bytes = ruby_package_bytes + + @property + def swift_prefix(self): + """Gets the swift_prefix of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The swift_prefix of this FileOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._swift_prefix + + @swift_prefix.setter + def swift_prefix(self, swift_prefix): + """Sets the swift_prefix of this FileOptionsOrBuilder. + + + :param swift_prefix: The swift_prefix of this FileOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._swift_prefix = swift_prefix + + @property + def swift_prefix_bytes(self): + """Gets the swift_prefix_bytes of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The swift_prefix_bytes of this FileOptionsOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._swift_prefix_bytes + + @swift_prefix_bytes.setter + def swift_prefix_bytes(self, swift_prefix_bytes): + """Sets the swift_prefix_bytes of this FileOptionsOrBuilder. + + + :param swift_prefix_bytes: The swift_prefix_bytes of this FileOptionsOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._swift_prefix_bytes = swift_prefix_bytes + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_count of this FileOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this FileOptionsOrBuilder. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this FileOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_list of this FileOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this FileOptionsOrBuilder. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this FileOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this FileOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this FileOptionsOrBuilder. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this FileOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this FileOptionsOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this FileOptionsOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this FileOptionsOrBuilder. + + + :param unknown_fields: The unknown_fields of this FileOptionsOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FileOptionsOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FileOptionsOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/generate_token_request.py b/src/conductor/client/codegen/models/generate_token_request.py new file mode 100644 index 00000000..7ae634b6 --- /dev/null +++ b/src/conductor/client/codegen/models/generate_token_request.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GenerateTokenRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'key_id': 'str', + 'key_secret': 'str' + } + + attribute_map = { + 'key_id': 'keyId', + 'key_secret': 'keySecret' + } + + def __init__(self, key_id=None, key_secret=None): # noqa: E501 + """GenerateTokenRequest - a model defined in Swagger""" # noqa: E501 + self._key_id = None + self._key_secret = None + self.discriminator = None + if key_id is not None: + self.key_id = key_id + if key_secret is not None: + self.key_secret = key_secret + + @property + def key_id(self): + """Gets the key_id of this GenerateTokenRequest. # noqa: E501 + + + :return: The key_id of this GenerateTokenRequest. # noqa: E501 + :rtype: str + """ + return self._key_id + + @key_id.setter + def key_id(self, key_id): + """Sets the key_id of this GenerateTokenRequest. + + + :param key_id: The key_id of this GenerateTokenRequest. # noqa: E501 + :type: str + """ + + self._key_id = key_id + + @property + def key_secret(self): + """Gets the key_secret of this GenerateTokenRequest. # noqa: E501 + + + :return: The key_secret of this GenerateTokenRequest. # noqa: E501 + :rtype: str + """ + return self._key_secret + + @key_secret.setter + def key_secret(self, key_secret): + """Sets the key_secret of this GenerateTokenRequest. + + + :param key_secret: The key_secret of this GenerateTokenRequest. # noqa: E501 + :type: str + """ + + self._key_secret = key_secret + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GenerateTokenRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GenerateTokenRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/granted_access.py b/src/conductor/client/codegen/models/granted_access.py new file mode 100644 index 00000000..d9d98136 --- /dev/null +++ b/src/conductor/client/codegen/models/granted_access.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GrantedAccess(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'access': 'list[str]', + 'tag': 'str', + 'target': 'TargetRef' + } + + attribute_map = { + 'access': 'access', + 'tag': 'tag', + 'target': 'target' + } + + def __init__(self, access=None, tag=None, target=None): # noqa: E501 + """GrantedAccess - a model defined in Swagger""" # noqa: E501 + self._access = None + self._tag = None + self._target = None + self.discriminator = None + if access is not None: + self.access = access + if tag is not None: + self.tag = tag + if target is not None: + self.target = target + + @property + def access(self): + """Gets the access of this GrantedAccess. # noqa: E501 + + + :return: The access of this GrantedAccess. # noqa: E501 + :rtype: list[str] + """ + return self._access + + @access.setter + def access(self, access): + """Sets the access of this GrantedAccess. + + + :param access: The access of this GrantedAccess. # noqa: E501 + :type: list[str] + """ + allowed_values = ["CREATE", "READ", "EXECUTE", "UPDATE", "DELETE"] # noqa: E501 + if not set(access).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `access` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(access) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._access = access + + @property + def tag(self): + """Gets the tag of this GrantedAccess. # noqa: E501 + + + :return: The tag of this GrantedAccess. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this GrantedAccess. + + + :param tag: The tag of this GrantedAccess. # noqa: E501 + :type: str + """ + + self._tag = tag + + @property + def target(self): + """Gets the target of this GrantedAccess. # noqa: E501 + + + :return: The target of this GrantedAccess. # noqa: E501 + :rtype: TargetRef + """ + return self._target + + @target.setter + def target(self, target): + """Sets the target of this GrantedAccess. + + + :param target: The target of this GrantedAccess. # noqa: E501 + :type: TargetRef + """ + + self._target = target + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GrantedAccess, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GrantedAccess): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/granted_access_response.py b/src/conductor/client/codegen/models/granted_access_response.py new file mode 100644 index 00000000..28a2a5d3 --- /dev/null +++ b/src/conductor/client/codegen/models/granted_access_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GrantedAccessResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'granted_access': 'list[GrantedAccess]' + } + + attribute_map = { + 'granted_access': 'grantedAccess' + } + + def __init__(self, granted_access=None): # noqa: E501 + """GrantedAccessResponse - a model defined in Swagger""" # noqa: E501 + self._granted_access = None + self.discriminator = None + if granted_access is not None: + self.granted_access = granted_access + + @property + def granted_access(self): + """Gets the granted_access of this GrantedAccessResponse. # noqa: E501 + + + :return: The granted_access of this GrantedAccessResponse. # noqa: E501 + :rtype: list[GrantedAccess] + """ + return self._granted_access + + @granted_access.setter + def granted_access(self, granted_access): + """Sets the granted_access of this GrantedAccessResponse. + + + :param granted_access: The granted_access of this GrantedAccessResponse. # noqa: E501 + :type: list[GrantedAccess] + """ + + self._granted_access = granted_access + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GrantedAccessResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GrantedAccessResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/group.py b/src/conductor/client/codegen/models/group.py new file mode 100644 index 00000000..c53ab304 --- /dev/null +++ b/src/conductor/client/codegen/models/group.py @@ -0,0 +1,195 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Group(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'default_access': 'dict(str, list[str])', + 'description': 'str', + 'id': 'str', + 'roles': 'list[Role]' + } + + attribute_map = { + 'default_access': 'defaultAccess', + 'description': 'description', + 'id': 'id', + 'roles': 'roles' + } + + def __init__(self, default_access=None, description=None, id=None, roles=None): # noqa: E501 + """Group - a model defined in Swagger""" # noqa: E501 + self._default_access = None + self._description = None + self._id = None + self._roles = None + self.discriminator = None + if default_access is not None: + self.default_access = default_access + if description is not None: + self.description = description + if id is not None: + self.id = id + if roles is not None: + self.roles = roles + + @property + def default_access(self): + """Gets the default_access of this Group. # noqa: E501 + + + :return: The default_access of this Group. # noqa: E501 + :rtype: dict(str, list[str]) + """ + return self._default_access + + @default_access.setter + def default_access(self, default_access): + """Sets the default_access of this Group. + + + :param default_access: The default_access of this Group. # noqa: E501 + :type: dict(str, list[str]) + """ + allowed_values = [CREATE, READ, EXECUTE, UPDATE, DELETE] # noqa: E501 + if not set(default_access.keys()).issubset(set(allowed_values)): + raise ValueError( + "Invalid keys in `default_access` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(default_access.keys()) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._default_access = default_access + + @property + def description(self): + """Gets the description of this Group. # noqa: E501 + + + :return: The description of this Group. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this Group. + + + :param description: The description of this Group. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def id(self): + """Gets the id of this Group. # noqa: E501 + + + :return: The id of this Group. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Group. + + + :param id: The id of this Group. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def roles(self): + """Gets the roles of this Group. # noqa: E501 + + + :return: The roles of this Group. # noqa: E501 + :rtype: list[Role] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this Group. + + + :param roles: The roles of this Group. # noqa: E501 + :type: list[Role] + """ + + self._roles = roles + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Group, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Group): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/handled_event_response.py b/src/conductor/client/codegen/models/handled_event_response.py new file mode 100644 index 00000000..0d1a3f6f --- /dev/null +++ b/src/conductor/client/codegen/models/handled_event_response.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class HandledEventResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'active': 'bool', + 'event': 'str', + 'name': 'str', + 'number_of_actions': 'int', + 'number_of_messages': 'int' + } + + attribute_map = { + 'active': 'active', + 'event': 'event', + 'name': 'name', + 'number_of_actions': 'numberOfActions', + 'number_of_messages': 'numberOfMessages' + } + + def __init__(self, active=None, event=None, name=None, number_of_actions=None, number_of_messages=None): # noqa: E501 + """HandledEventResponse - a model defined in Swagger""" # noqa: E501 + self._active = None + self._event = None + self._name = None + self._number_of_actions = None + self._number_of_messages = None + self.discriminator = None + if active is not None: + self.active = active + if event is not None: + self.event = event + if name is not None: + self.name = name + if number_of_actions is not None: + self.number_of_actions = number_of_actions + if number_of_messages is not None: + self.number_of_messages = number_of_messages + + @property + def active(self): + """Gets the active of this HandledEventResponse. # noqa: E501 + + + :return: The active of this HandledEventResponse. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this HandledEventResponse. + + + :param active: The active of this HandledEventResponse. # noqa: E501 + :type: bool + """ + + self._active = active + + @property + def event(self): + """Gets the event of this HandledEventResponse. # noqa: E501 + + + :return: The event of this HandledEventResponse. # noqa: E501 + :rtype: str + """ + return self._event + + @event.setter + def event(self, event): + """Sets the event of this HandledEventResponse. + + + :param event: The event of this HandledEventResponse. # noqa: E501 + :type: str + """ + + self._event = event + + @property + def name(self): + """Gets the name of this HandledEventResponse. # noqa: E501 + + + :return: The name of this HandledEventResponse. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this HandledEventResponse. + + + :param name: The name of this HandledEventResponse. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def number_of_actions(self): + """Gets the number_of_actions of this HandledEventResponse. # noqa: E501 + + + :return: The number_of_actions of this HandledEventResponse. # noqa: E501 + :rtype: int + """ + return self._number_of_actions + + @number_of_actions.setter + def number_of_actions(self, number_of_actions): + """Sets the number_of_actions of this HandledEventResponse. + + + :param number_of_actions: The number_of_actions of this HandledEventResponse. # noqa: E501 + :type: int + """ + + self._number_of_actions = number_of_actions + + @property + def number_of_messages(self): + """Gets the number_of_messages of this HandledEventResponse. # noqa: E501 + + + :return: The number_of_messages of this HandledEventResponse. # noqa: E501 + :rtype: int + """ + return self._number_of_messages + + @number_of_messages.setter + def number_of_messages(self, number_of_messages): + """Sets the number_of_messages of this HandledEventResponse. + + + :param number_of_messages: The number_of_messages of this HandledEventResponse. # noqa: E501 + :type: int + """ + + self._number_of_messages = number_of_messages + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(HandledEventResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HandledEventResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/incoming_bpmn_file.py b/src/conductor/client/codegen/models/incoming_bpmn_file.py new file mode 100644 index 00000000..6000ae86 --- /dev/null +++ b/src/conductor/client/codegen/models/incoming_bpmn_file.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IncomingBpmnFile(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'file_content': 'str', + 'file_name': 'str' + } + + attribute_map = { + 'file_content': 'fileContent', + 'file_name': 'fileName' + } + + def __init__(self, file_content=None, file_name=None): # noqa: E501 + """IncomingBpmnFile - a model defined in Swagger""" # noqa: E501 + self._file_content = None + self._file_name = None + self.discriminator = None + self.file_content = file_content + self.file_name = file_name + + @property + def file_content(self): + """Gets the file_content of this IncomingBpmnFile. # noqa: E501 + + + :return: The file_content of this IncomingBpmnFile. # noqa: E501 + :rtype: str + """ + return self._file_content + + @file_content.setter + def file_content(self, file_content): + """Sets the file_content of this IncomingBpmnFile. + + + :param file_content: The file_content of this IncomingBpmnFile. # noqa: E501 + :type: str + """ + if file_content is None: + raise ValueError("Invalid value for `file_content`, must not be `None`") # noqa: E501 + + self._file_content = file_content + + @property + def file_name(self): + """Gets the file_name of this IncomingBpmnFile. # noqa: E501 + + + :return: The file_name of this IncomingBpmnFile. # noqa: E501 + :rtype: str + """ + return self._file_name + + @file_name.setter + def file_name(self, file_name): + """Sets the file_name of this IncomingBpmnFile. + + + :param file_name: The file_name of this IncomingBpmnFile. # noqa: E501 + :type: str + """ + if file_name is None: + raise ValueError("Invalid value for `file_name`, must not be `None`") # noqa: E501 + + self._file_name = file_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IncomingBpmnFile, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IncomingBpmnFile): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/integration.py b/src/conductor/client/codegen/models/integration.py new file mode 100644 index 00000000..8b3f58db --- /dev/null +++ b/src/conductor/client/codegen/models/integration.py @@ -0,0 +1,454 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Integration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'apis': 'list[IntegrationApi]', + 'category': 'str', + 'configuration': 'dict(str, object)', + 'create_time': 'int', + 'created_by': 'str', + 'description': 'str', + 'enabled': 'bool', + 'models_count': 'int', + 'name': 'str', + 'owner_app': 'str', + 'tags': 'list[Tag]', + 'type': 'str', + 'update_time': 'int', + 'updated_by': 'str' + } + + attribute_map = { + 'apis': 'apis', + 'category': 'category', + 'configuration': 'configuration', + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'description': 'description', + 'enabled': 'enabled', + 'models_count': 'modelsCount', + 'name': 'name', + 'owner_app': 'ownerApp', + 'tags': 'tags', + 'type': 'type', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy' + } + + def __init__(self, apis=None, category=None, configuration=None, create_time=None, created_by=None, description=None, enabled=None, models_count=None, name=None, owner_app=None, tags=None, type=None, update_time=None, updated_by=None): # noqa: E501 + """Integration - a model defined in Swagger""" # noqa: E501 + self._apis = None + self._category = None + self._configuration = None + self._create_time = None + self._created_by = None + self._description = None + self._enabled = None + self._models_count = None + self._name = None + self._owner_app = None + self._tags = None + self._type = None + self._update_time = None + self._updated_by = None + self.discriminator = None + if apis is not None: + self.apis = apis + if category is not None: + self.category = category + if configuration is not None: + self.configuration = configuration + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if description is not None: + self.description = description + if enabled is not None: + self.enabled = enabled + if models_count is not None: + self.models_count = models_count + if name is not None: + self.name = name + if owner_app is not None: + self.owner_app = owner_app + if tags is not None: + self.tags = tags + if type is not None: + self.type = type + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + + @property + def apis(self): + """Gets the apis of this Integration. # noqa: E501 + + + :return: The apis of this Integration. # noqa: E501 + :rtype: list[IntegrationApi] + """ + return self._apis + + @apis.setter + def apis(self, apis): + """Sets the apis of this Integration. + + + :param apis: The apis of this Integration. # noqa: E501 + :type: list[IntegrationApi] + """ + + self._apis = apis + + @property + def category(self): + """Gets the category of this Integration. # noqa: E501 + + + :return: The category of this Integration. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this Integration. + + + :param category: The category of this Integration. # noqa: E501 + :type: str + """ + allowed_values = ["API", "AI_MODEL", "VECTOR_DB", "RELATIONAL_DB", "MESSAGE_BROKER", "GIT", "EMAIL"] # noqa: E501 + if category not in allowed_values: + raise ValueError( + "Invalid value for `category` ({0}), must be one of {1}" # noqa: E501 + .format(category, allowed_values) + ) + + self._category = category + + @property + def configuration(self): + """Gets the configuration of this Integration. # noqa: E501 + + + :return: The configuration of this Integration. # noqa: E501 + :rtype: dict(str, object) + """ + return self._configuration + + @configuration.setter + def configuration(self, configuration): + """Sets the configuration of this Integration. + + + :param configuration: The configuration of this Integration. # noqa: E501 + :type: dict(str, object) + """ + + self._configuration = configuration + + @property + def create_time(self): + """Gets the create_time of this Integration. # noqa: E501 + + + :return: The create_time of this Integration. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this Integration. + + + :param create_time: The create_time of this Integration. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this Integration. # noqa: E501 + + + :return: The created_by of this Integration. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this Integration. + + + :param created_by: The created_by of this Integration. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def description(self): + """Gets the description of this Integration. # noqa: E501 + + + :return: The description of this Integration. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this Integration. + + + :param description: The description of this Integration. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def enabled(self): + """Gets the enabled of this Integration. # noqa: E501 + + + :return: The enabled of this Integration. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this Integration. + + + :param enabled: The enabled of this Integration. # noqa: E501 + :type: bool + """ + + self._enabled = enabled + + @property + def models_count(self): + """Gets the models_count of this Integration. # noqa: E501 + + + :return: The models_count of this Integration. # noqa: E501 + :rtype: int + """ + return self._models_count + + @models_count.setter + def models_count(self, models_count): + """Sets the models_count of this Integration. + + + :param models_count: The models_count of this Integration. # noqa: E501 + :type: int + """ + + self._models_count = models_count + + @property + def name(self): + """Gets the name of this Integration. # noqa: E501 + + + :return: The name of this Integration. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Integration. + + + :param name: The name of this Integration. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def owner_app(self): + """Gets the owner_app of this Integration. # noqa: E501 + + + :return: The owner_app of this Integration. # noqa: E501 + :rtype: str + """ + return self._owner_app + + @owner_app.setter + def owner_app(self, owner_app): + """Sets the owner_app of this Integration. + + + :param owner_app: The owner_app of this Integration. # noqa: E501 + :type: str + """ + + self._owner_app = owner_app + + @property + def tags(self): + """Gets the tags of this Integration. # noqa: E501 + + + :return: The tags of this Integration. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this Integration. + + + :param tags: The tags of this Integration. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def type(self): + """Gets the type of this Integration. # noqa: E501 + + + :return: The type of this Integration. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Integration. + + + :param type: The type of this Integration. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def update_time(self): + """Gets the update_time of this Integration. # noqa: E501 + + + :return: The update_time of this Integration. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this Integration. + + + :param update_time: The update_time of this Integration. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this Integration. # noqa: E501 + + + :return: The updated_by of this Integration. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this Integration. + + + :param updated_by: The updated_by of this Integration. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Integration, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Integration): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/integration_api.py b/src/conductor/client/codegen/models/integration_api.py new file mode 100644 index 00000000..7739a1d2 --- /dev/null +++ b/src/conductor/client/codegen/models/integration_api.py @@ -0,0 +1,370 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IntegrationApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'api': 'str', + 'configuration': 'dict(str, object)', + 'create_time': 'int', + 'created_by': 'str', + 'description': 'str', + 'enabled': 'bool', + 'integration_name': 'str', + 'owner_app': 'str', + 'tags': 'list[Tag]', + 'update_time': 'int', + 'updated_by': 'str' + } + + attribute_map = { + 'api': 'api', + 'configuration': 'configuration', + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'description': 'description', + 'enabled': 'enabled', + 'integration_name': 'integrationName', + 'owner_app': 'ownerApp', + 'tags': 'tags', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy' + } + + def __init__(self, api=None, configuration=None, create_time=None, created_by=None, description=None, enabled=None, integration_name=None, owner_app=None, tags=None, update_time=None, updated_by=None): # noqa: E501 + """IntegrationApi - a model defined in Swagger""" # noqa: E501 + self._api = None + self._configuration = None + self._create_time = None + self._created_by = None + self._description = None + self._enabled = None + self._integration_name = None + self._owner_app = None + self._tags = None + self._update_time = None + self._updated_by = None + self.discriminator = None + if api is not None: + self.api = api + if configuration is not None: + self.configuration = configuration + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if description is not None: + self.description = description + if enabled is not None: + self.enabled = enabled + if integration_name is not None: + self.integration_name = integration_name + if owner_app is not None: + self.owner_app = owner_app + if tags is not None: + self.tags = tags + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + + @property + def api(self): + """Gets the api of this IntegrationApi. # noqa: E501 + + + :return: The api of this IntegrationApi. # noqa: E501 + :rtype: str + """ + return self._api + + @api.setter + def api(self, api): + """Sets the api of this IntegrationApi. + + + :param api: The api of this IntegrationApi. # noqa: E501 + :type: str + """ + + self._api = api + + @property + def configuration(self): + """Gets the configuration of this IntegrationApi. # noqa: E501 + + + :return: The configuration of this IntegrationApi. # noqa: E501 + :rtype: dict(str, object) + """ + return self._configuration + + @configuration.setter + def configuration(self, configuration): + """Sets the configuration of this IntegrationApi. + + + :param configuration: The configuration of this IntegrationApi. # noqa: E501 + :type: dict(str, object) + """ + + self._configuration = configuration + + @property + def create_time(self): + """Gets the create_time of this IntegrationApi. # noqa: E501 + + + :return: The create_time of this IntegrationApi. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this IntegrationApi. + + + :param create_time: The create_time of this IntegrationApi. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this IntegrationApi. # noqa: E501 + + + :return: The created_by of this IntegrationApi. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this IntegrationApi. + + + :param created_by: The created_by of this IntegrationApi. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def description(self): + """Gets the description of this IntegrationApi. # noqa: E501 + + + :return: The description of this IntegrationApi. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IntegrationApi. + + + :param description: The description of this IntegrationApi. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def enabled(self): + """Gets the enabled of this IntegrationApi. # noqa: E501 + + + :return: The enabled of this IntegrationApi. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this IntegrationApi. + + + :param enabled: The enabled of this IntegrationApi. # noqa: E501 + :type: bool + """ + + self._enabled = enabled + + @property + def integration_name(self): + """Gets the integration_name of this IntegrationApi. # noqa: E501 + + + :return: The integration_name of this IntegrationApi. # noqa: E501 + :rtype: str + """ + return self._integration_name + + @integration_name.setter + def integration_name(self, integration_name): + """Sets the integration_name of this IntegrationApi. + + + :param integration_name: The integration_name of this IntegrationApi. # noqa: E501 + :type: str + """ + + self._integration_name = integration_name + + @property + def owner_app(self): + """Gets the owner_app of this IntegrationApi. # noqa: E501 + + + :return: The owner_app of this IntegrationApi. # noqa: E501 + :rtype: str + """ + return self._owner_app + + @owner_app.setter + def owner_app(self, owner_app): + """Sets the owner_app of this IntegrationApi. + + + :param owner_app: The owner_app of this IntegrationApi. # noqa: E501 + :type: str + """ + + self._owner_app = owner_app + + @property + def tags(self): + """Gets the tags of this IntegrationApi. # noqa: E501 + + + :return: The tags of this IntegrationApi. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this IntegrationApi. + + + :param tags: The tags of this IntegrationApi. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def update_time(self): + """Gets the update_time of this IntegrationApi. # noqa: E501 + + + :return: The update_time of this IntegrationApi. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this IntegrationApi. + + + :param update_time: The update_time of this IntegrationApi. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this IntegrationApi. # noqa: E501 + + + :return: The updated_by of this IntegrationApi. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this IntegrationApi. + + + :param updated_by: The updated_by of this IntegrationApi. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IntegrationApi, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IntegrationApi): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/integration_api_update.py b/src/conductor/client/codegen/models/integration_api_update.py new file mode 100644 index 00000000..ba233cdf --- /dev/null +++ b/src/conductor/client/codegen/models/integration_api_update.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IntegrationApiUpdate(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'configuration': 'dict(str, object)', + 'description': 'str', + 'enabled': 'bool' + } + + attribute_map = { + 'configuration': 'configuration', + 'description': 'description', + 'enabled': 'enabled' + } + + def __init__(self, configuration=None, description=None, enabled=None): # noqa: E501 + """IntegrationApiUpdate - a model defined in Swagger""" # noqa: E501 + self._configuration = None + self._description = None + self._enabled = None + self.discriminator = None + if configuration is not None: + self.configuration = configuration + if description is not None: + self.description = description + if enabled is not None: + self.enabled = enabled + + @property + def configuration(self): + """Gets the configuration of this IntegrationApiUpdate. # noqa: E501 + + + :return: The configuration of this IntegrationApiUpdate. # noqa: E501 + :rtype: dict(str, object) + """ + return self._configuration + + @configuration.setter + def configuration(self, configuration): + """Sets the configuration of this IntegrationApiUpdate. + + + :param configuration: The configuration of this IntegrationApiUpdate. # noqa: E501 + :type: dict(str, object) + """ + + self._configuration = configuration + + @property + def description(self): + """Gets the description of this IntegrationApiUpdate. # noqa: E501 + + + :return: The description of this IntegrationApiUpdate. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IntegrationApiUpdate. + + + :param description: The description of this IntegrationApiUpdate. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def enabled(self): + """Gets the enabled of this IntegrationApiUpdate. # noqa: E501 + + + :return: The enabled of this IntegrationApiUpdate. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this IntegrationApiUpdate. + + + :param enabled: The enabled of this IntegrationApiUpdate. # noqa: E501 + :type: bool + """ + + self._enabled = enabled + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IntegrationApiUpdate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IntegrationApiUpdate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/integration_def.py b/src/conductor/client/codegen/models/integration_def.py new file mode 100644 index 00000000..99e4d50b --- /dev/null +++ b/src/conductor/client/codegen/models/integration_def.py @@ -0,0 +1,324 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IntegrationDef(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'str', + 'category_label': 'str', + 'configuration': 'list[IntegrationDefFormField]', + 'description': 'str', + 'enabled': 'bool', + 'icon_name': 'str', + 'name': 'str', + 'tags': 'list[str]', + 'type': 'str' + } + + attribute_map = { + 'category': 'category', + 'category_label': 'categoryLabel', + 'configuration': 'configuration', + 'description': 'description', + 'enabled': 'enabled', + 'icon_name': 'iconName', + 'name': 'name', + 'tags': 'tags', + 'type': 'type' + } + + def __init__(self, category=None, category_label=None, configuration=None, description=None, enabled=None, icon_name=None, name=None, tags=None, type=None): # noqa: E501 + """IntegrationDef - a model defined in Swagger""" # noqa: E501 + self._category = None + self._category_label = None + self._configuration = None + self._description = None + self._enabled = None + self._icon_name = None + self._name = None + self._tags = None + self._type = None + self.discriminator = None + if category is not None: + self.category = category + if category_label is not None: + self.category_label = category_label + if configuration is not None: + self.configuration = configuration + if description is not None: + self.description = description + if enabled is not None: + self.enabled = enabled + if icon_name is not None: + self.icon_name = icon_name + if name is not None: + self.name = name + if tags is not None: + self.tags = tags + if type is not None: + self.type = type + + @property + def category(self): + """Gets the category of this IntegrationDef. # noqa: E501 + + + :return: The category of this IntegrationDef. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this IntegrationDef. + + + :param category: The category of this IntegrationDef. # noqa: E501 + :type: str + """ + allowed_values = ["API", "AI_MODEL", "VECTOR_DB", "RELATIONAL_DB", "MESSAGE_BROKER", "GIT", "EMAIL"] # noqa: E501 + if category not in allowed_values: + raise ValueError( + "Invalid value for `category` ({0}), must be one of {1}" # noqa: E501 + .format(category, allowed_values) + ) + + self._category = category + + @property + def category_label(self): + """Gets the category_label of this IntegrationDef. # noqa: E501 + + + :return: The category_label of this IntegrationDef. # noqa: E501 + :rtype: str + """ + return self._category_label + + @category_label.setter + def category_label(self, category_label): + """Sets the category_label of this IntegrationDef. + + + :param category_label: The category_label of this IntegrationDef. # noqa: E501 + :type: str + """ + + self._category_label = category_label + + @property + def configuration(self): + """Gets the configuration of this IntegrationDef. # noqa: E501 + + + :return: The configuration of this IntegrationDef. # noqa: E501 + :rtype: list[IntegrationDefFormField] + """ + return self._configuration + + @configuration.setter + def configuration(self, configuration): + """Sets the configuration of this IntegrationDef. + + + :param configuration: The configuration of this IntegrationDef. # noqa: E501 + :type: list[IntegrationDefFormField] + """ + + self._configuration = configuration + + @property + def description(self): + """Gets the description of this IntegrationDef. # noqa: E501 + + + :return: The description of this IntegrationDef. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IntegrationDef. + + + :param description: The description of this IntegrationDef. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def enabled(self): + """Gets the enabled of this IntegrationDef. # noqa: E501 + + + :return: The enabled of this IntegrationDef. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this IntegrationDef. + + + :param enabled: The enabled of this IntegrationDef. # noqa: E501 + :type: bool + """ + + self._enabled = enabled + + @property + def icon_name(self): + """Gets the icon_name of this IntegrationDef. # noqa: E501 + + + :return: The icon_name of this IntegrationDef. # noqa: E501 + :rtype: str + """ + return self._icon_name + + @icon_name.setter + def icon_name(self, icon_name): + """Sets the icon_name of this IntegrationDef. + + + :param icon_name: The icon_name of this IntegrationDef. # noqa: E501 + :type: str + """ + + self._icon_name = icon_name + + @property + def name(self): + """Gets the name of this IntegrationDef. # noqa: E501 + + + :return: The name of this IntegrationDef. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this IntegrationDef. + + + :param name: The name of this IntegrationDef. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def tags(self): + """Gets the tags of this IntegrationDef. # noqa: E501 + + + :return: The tags of this IntegrationDef. # noqa: E501 + :rtype: list[str] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this IntegrationDef. + + + :param tags: The tags of this IntegrationDef. # noqa: E501 + :type: list[str] + """ + + self._tags = tags + + @property + def type(self): + """Gets the type of this IntegrationDef. # noqa: E501 + + + :return: The type of this IntegrationDef. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this IntegrationDef. + + + :param type: The type of this IntegrationDef. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IntegrationDef, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IntegrationDef): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/integration_def_form_field.py b/src/conductor/client/codegen/models/integration_def_form_field.py new file mode 100644 index 00000000..2aff6305 --- /dev/null +++ b/src/conductor/client/codegen/models/integration_def_form_field.py @@ -0,0 +1,304 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IntegrationDefFormField(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'default_value': 'str', + 'description': 'str', + 'field_name': 'str', + 'field_type': 'str', + 'label': 'str', + 'optional': 'bool', + 'value': 'str', + 'value_options': 'list[Option]' + } + + attribute_map = { + 'default_value': 'defaultValue', + 'description': 'description', + 'field_name': 'fieldName', + 'field_type': 'fieldType', + 'label': 'label', + 'optional': 'optional', + 'value': 'value', + 'value_options': 'valueOptions' + } + + def __init__(self, default_value=None, description=None, field_name=None, field_type=None, label=None, optional=None, value=None, value_options=None): # noqa: E501 + """IntegrationDefFormField - a model defined in Swagger""" # noqa: E501 + self._default_value = None + self._description = None + self._field_name = None + self._field_type = None + self._label = None + self._optional = None + self._value = None + self._value_options = None + self.discriminator = None + if default_value is not None: + self.default_value = default_value + if description is not None: + self.description = description + if field_name is not None: + self.field_name = field_name + if field_type is not None: + self.field_type = field_type + if label is not None: + self.label = label + if optional is not None: + self.optional = optional + if value is not None: + self.value = value + if value_options is not None: + self.value_options = value_options + + @property + def default_value(self): + """Gets the default_value of this IntegrationDefFormField. # noqa: E501 + + + :return: The default_value of this IntegrationDefFormField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this IntegrationDefFormField. + + + :param default_value: The default_value of this IntegrationDefFormField. # noqa: E501 + :type: str + """ + + self._default_value = default_value + + @property + def description(self): + """Gets the description of this IntegrationDefFormField. # noqa: E501 + + + :return: The description of this IntegrationDefFormField. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IntegrationDefFormField. + + + :param description: The description of this IntegrationDefFormField. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def field_name(self): + """Gets the field_name of this IntegrationDefFormField. # noqa: E501 + + + :return: The field_name of this IntegrationDefFormField. # noqa: E501 + :rtype: str + """ + return self._field_name + + @field_name.setter + def field_name(self, field_name): + """Sets the field_name of this IntegrationDefFormField. + + + :param field_name: The field_name of this IntegrationDefFormField. # noqa: E501 + :type: str + """ + allowed_values = ["api_key", "user", "endpoint", "authUrl", "environment", "projectName", "indexName", "publisher", "password", "namespace", "batchSize", "batchWaitTime", "visibilityTimeout", "connectionType", "consumer", "stream", "batchPollConsumersCount", "consumer_type", "region", "awsAccountId", "externalId", "roleArn", "protocol", "mechanism", "port", "schemaRegistryUrl", "schemaRegistryApiKey", "schemaRegistryApiSecret", "authenticationType", "truststoreAuthenticationType", "tls", "cipherSuite", "pubSubMethod", "keyStorePassword", "keyStoreLocation", "schemaRegistryAuthType", "valueSubjectNameStrategy", "datasourceURL", "jdbcDriver", "subscription", "serviceAccountCredentials", "file", "tlsFile", "queueManager", "groupId", "channel", "dimensions", "distance_metric", "indexing_method", "inverted_list_count"] # noqa: E501 + if field_name not in allowed_values: + raise ValueError( + "Invalid value for `field_name` ({0}), must be one of {1}" # noqa: E501 + .format(field_name, allowed_values) + ) + + self._field_name = field_name + + @property + def field_type(self): + """Gets the field_type of this IntegrationDefFormField. # noqa: E501 + + + :return: The field_type of this IntegrationDefFormField. # noqa: E501 + :rtype: str + """ + return self._field_type + + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this IntegrationDefFormField. + + + :param field_type: The field_type of this IntegrationDefFormField. # noqa: E501 + :type: str + """ + allowed_values = ["DROPDOWN", "TEXT", "PASSWORD", "FILE"] # noqa: E501 + if field_type not in allowed_values: + raise ValueError( + "Invalid value for `field_type` ({0}), must be one of {1}" # noqa: E501 + .format(field_type, allowed_values) + ) + + self._field_type = field_type + + @property + def label(self): + """Gets the label of this IntegrationDefFormField. # noqa: E501 + + + :return: The label of this IntegrationDefFormField. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this IntegrationDefFormField. + + + :param label: The label of this IntegrationDefFormField. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def optional(self): + """Gets the optional of this IntegrationDefFormField. # noqa: E501 + + + :return: The optional of this IntegrationDefFormField. # noqa: E501 + :rtype: bool + """ + return self._optional + + @optional.setter + def optional(self, optional): + """Sets the optional of this IntegrationDefFormField. + + + :param optional: The optional of this IntegrationDefFormField. # noqa: E501 + :type: bool + """ + + self._optional = optional + + @property + def value(self): + """Gets the value of this IntegrationDefFormField. # noqa: E501 + + + :return: The value of this IntegrationDefFormField. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this IntegrationDefFormField. + + + :param value: The value of this IntegrationDefFormField. # noqa: E501 + :type: str + """ + + self._value = value + + @property + def value_options(self): + """Gets the value_options of this IntegrationDefFormField. # noqa: E501 + + + :return: The value_options of this IntegrationDefFormField. # noqa: E501 + :rtype: list[Option] + """ + return self._value_options + + @value_options.setter + def value_options(self, value_options): + """Sets the value_options of this IntegrationDefFormField. + + + :param value_options: The value_options of this IntegrationDefFormField. # noqa: E501 + :type: list[Option] + """ + + self._value_options = value_options + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IntegrationDefFormField, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IntegrationDefFormField): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/integration_update.py b/src/conductor/client/codegen/models/integration_update.py new file mode 100644 index 00000000..4da25934 --- /dev/null +++ b/src/conductor/client/codegen/models/integration_update.py @@ -0,0 +1,220 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IntegrationUpdate(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'str', + 'configuration': 'dict(str, object)', + 'description': 'str', + 'enabled': 'bool', + 'type': 'str' + } + + attribute_map = { + 'category': 'category', + 'configuration': 'configuration', + 'description': 'description', + 'enabled': 'enabled', + 'type': 'type' + } + + def __init__(self, category=None, configuration=None, description=None, enabled=None, type=None): # noqa: E501 + """IntegrationUpdate - a model defined in Swagger""" # noqa: E501 + self._category = None + self._configuration = None + self._description = None + self._enabled = None + self._type = None + self.discriminator = None + if category is not None: + self.category = category + if configuration is not None: + self.configuration = configuration + if description is not None: + self.description = description + if enabled is not None: + self.enabled = enabled + if type is not None: + self.type = type + + @property + def category(self): + """Gets the category of this IntegrationUpdate. # noqa: E501 + + + :return: The category of this IntegrationUpdate. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this IntegrationUpdate. + + + :param category: The category of this IntegrationUpdate. # noqa: E501 + :type: str + """ + allowed_values = ["API", "AI_MODEL", "VECTOR_DB", "RELATIONAL_DB", "MESSAGE_BROKER", "GIT", "EMAIL"] # noqa: E501 + if category not in allowed_values: + raise ValueError( + "Invalid value for `category` ({0}), must be one of {1}" # noqa: E501 + .format(category, allowed_values) + ) + + self._category = category + + @property + def configuration(self): + """Gets the configuration of this IntegrationUpdate. # noqa: E501 + + + :return: The configuration of this IntegrationUpdate. # noqa: E501 + :rtype: dict(str, object) + """ + return self._configuration + + @configuration.setter + def configuration(self, configuration): + """Sets the configuration of this IntegrationUpdate. + + + :param configuration: The configuration of this IntegrationUpdate. # noqa: E501 + :type: dict(str, object) + """ + + self._configuration = configuration + + @property + def description(self): + """Gets the description of this IntegrationUpdate. # noqa: E501 + + + :return: The description of this IntegrationUpdate. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IntegrationUpdate. + + + :param description: The description of this IntegrationUpdate. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def enabled(self): + """Gets the enabled of this IntegrationUpdate. # noqa: E501 + + + :return: The enabled of this IntegrationUpdate. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this IntegrationUpdate. + + + :param enabled: The enabled of this IntegrationUpdate. # noqa: E501 + :type: bool + """ + + self._enabled = enabled + + @property + def type(self): + """Gets the type of this IntegrationUpdate. # noqa: E501 + + + :return: The type of this IntegrationUpdate. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this IntegrationUpdate. + + + :param type: The type of this IntegrationUpdate. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IntegrationUpdate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IntegrationUpdate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/json_node.py b/src/conductor/client/codegen/models/json_node.py new file mode 100644 index 00000000..09d03acc --- /dev/null +++ b/src/conductor/client/codegen/models/json_node.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class JsonNode(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """JsonNode - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(JsonNode, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, JsonNode): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/location.py b/src/conductor/client/codegen/models/location.py new file mode 100644 index 00000000..618b5547 --- /dev/null +++ b/src/conductor/client/codegen/models/location.py @@ -0,0 +1,578 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Location(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Location', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'leading_comments': 'str', + 'leading_comments_bytes': 'ByteString', + 'leading_detached_comments_count': 'int', + 'leading_detached_comments_list': 'list[str]', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserLocation', + 'path_count': 'int', + 'path_list': 'list[int]', + 'serialized_size': 'int', + 'span_count': 'int', + 'span_list': 'list[int]', + 'trailing_comments': 'str', + 'trailing_comments_bytes': 'ByteString', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'leading_comments': 'leadingComments', + 'leading_comments_bytes': 'leadingCommentsBytes', + 'leading_detached_comments_count': 'leadingDetachedCommentsCount', + 'leading_detached_comments_list': 'leadingDetachedCommentsList', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'path_count': 'pathCount', + 'path_list': 'pathList', + 'serialized_size': 'serializedSize', + 'span_count': 'spanCount', + 'span_list': 'spanList', + 'trailing_comments': 'trailingComments', + 'trailing_comments_bytes': 'trailingCommentsBytes', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, leading_comments=None, leading_comments_bytes=None, leading_detached_comments_count=None, leading_detached_comments_list=None, memoized_serialized_size=None, parser_for_type=None, path_count=None, path_list=None, serialized_size=None, span_count=None, span_list=None, trailing_comments=None, trailing_comments_bytes=None, unknown_fields=None): # noqa: E501 + """Location - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._leading_comments = None + self._leading_comments_bytes = None + self._leading_detached_comments_count = None + self._leading_detached_comments_list = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._path_count = None + self._path_list = None + self._serialized_size = None + self._span_count = None + self._span_list = None + self._trailing_comments = None + self._trailing_comments_bytes = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if leading_comments is not None: + self.leading_comments = leading_comments + if leading_comments_bytes is not None: + self.leading_comments_bytes = leading_comments_bytes + if leading_detached_comments_count is not None: + self.leading_detached_comments_count = leading_detached_comments_count + if leading_detached_comments_list is not None: + self.leading_detached_comments_list = leading_detached_comments_list + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if path_count is not None: + self.path_count = path_count + if path_list is not None: + self.path_list = path_list + if serialized_size is not None: + self.serialized_size = serialized_size + if span_count is not None: + self.span_count = span_count + if span_list is not None: + self.span_list = span_list + if trailing_comments is not None: + self.trailing_comments = trailing_comments + if trailing_comments_bytes is not None: + self.trailing_comments_bytes = trailing_comments_bytes + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this Location. # noqa: E501 + + + :return: The all_fields of this Location. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this Location. + + + :param all_fields: The all_fields of this Location. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this Location. # noqa: E501 + + + :return: The default_instance_for_type of this Location. # noqa: E501 + :rtype: Location + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this Location. + + + :param default_instance_for_type: The default_instance_for_type of this Location. # noqa: E501 + :type: Location + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this Location. # noqa: E501 + + + :return: The descriptor_for_type of this Location. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this Location. + + + :param descriptor_for_type: The descriptor_for_type of this Location. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this Location. # noqa: E501 + + + :return: The initialization_error_string of this Location. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this Location. + + + :param initialization_error_string: The initialization_error_string of this Location. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this Location. # noqa: E501 + + + :return: The initialized of this Location. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this Location. + + + :param initialized: The initialized of this Location. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def leading_comments(self): + """Gets the leading_comments of this Location. # noqa: E501 + + + :return: The leading_comments of this Location. # noqa: E501 + :rtype: str + """ + return self._leading_comments + + @leading_comments.setter + def leading_comments(self, leading_comments): + """Sets the leading_comments of this Location. + + + :param leading_comments: The leading_comments of this Location. # noqa: E501 + :type: str + """ + + self._leading_comments = leading_comments + + @property + def leading_comments_bytes(self): + """Gets the leading_comments_bytes of this Location. # noqa: E501 + + + :return: The leading_comments_bytes of this Location. # noqa: E501 + :rtype: ByteString + """ + return self._leading_comments_bytes + + @leading_comments_bytes.setter + def leading_comments_bytes(self, leading_comments_bytes): + """Sets the leading_comments_bytes of this Location. + + + :param leading_comments_bytes: The leading_comments_bytes of this Location. # noqa: E501 + :type: ByteString + """ + + self._leading_comments_bytes = leading_comments_bytes + + @property + def leading_detached_comments_count(self): + """Gets the leading_detached_comments_count of this Location. # noqa: E501 + + + :return: The leading_detached_comments_count of this Location. # noqa: E501 + :rtype: int + """ + return self._leading_detached_comments_count + + @leading_detached_comments_count.setter + def leading_detached_comments_count(self, leading_detached_comments_count): + """Sets the leading_detached_comments_count of this Location. + + + :param leading_detached_comments_count: The leading_detached_comments_count of this Location. # noqa: E501 + :type: int + """ + + self._leading_detached_comments_count = leading_detached_comments_count + + @property + def leading_detached_comments_list(self): + """Gets the leading_detached_comments_list of this Location. # noqa: E501 + + + :return: The leading_detached_comments_list of this Location. # noqa: E501 + :rtype: list[str] + """ + return self._leading_detached_comments_list + + @leading_detached_comments_list.setter + def leading_detached_comments_list(self, leading_detached_comments_list): + """Sets the leading_detached_comments_list of this Location. + + + :param leading_detached_comments_list: The leading_detached_comments_list of this Location. # noqa: E501 + :type: list[str] + """ + + self._leading_detached_comments_list = leading_detached_comments_list + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this Location. # noqa: E501 + + + :return: The memoized_serialized_size of this Location. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this Location. + + + :param memoized_serialized_size: The memoized_serialized_size of this Location. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this Location. # noqa: E501 + + + :return: The parser_for_type of this Location. # noqa: E501 + :rtype: ParserLocation + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this Location. + + + :param parser_for_type: The parser_for_type of this Location. # noqa: E501 + :type: ParserLocation + """ + + self._parser_for_type = parser_for_type + + @property + def path_count(self): + """Gets the path_count of this Location. # noqa: E501 + + + :return: The path_count of this Location. # noqa: E501 + :rtype: int + """ + return self._path_count + + @path_count.setter + def path_count(self, path_count): + """Sets the path_count of this Location. + + + :param path_count: The path_count of this Location. # noqa: E501 + :type: int + """ + + self._path_count = path_count + + @property + def path_list(self): + """Gets the path_list of this Location. # noqa: E501 + + + :return: The path_list of this Location. # noqa: E501 + :rtype: list[int] + """ + return self._path_list + + @path_list.setter + def path_list(self, path_list): + """Sets the path_list of this Location. + + + :param path_list: The path_list of this Location. # noqa: E501 + :type: list[int] + """ + + self._path_list = path_list + + @property + def serialized_size(self): + """Gets the serialized_size of this Location. # noqa: E501 + + + :return: The serialized_size of this Location. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this Location. + + + :param serialized_size: The serialized_size of this Location. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def span_count(self): + """Gets the span_count of this Location. # noqa: E501 + + + :return: The span_count of this Location. # noqa: E501 + :rtype: int + """ + return self._span_count + + @span_count.setter + def span_count(self, span_count): + """Sets the span_count of this Location. + + + :param span_count: The span_count of this Location. # noqa: E501 + :type: int + """ + + self._span_count = span_count + + @property + def span_list(self): + """Gets the span_list of this Location. # noqa: E501 + + + :return: The span_list of this Location. # noqa: E501 + :rtype: list[int] + """ + return self._span_list + + @span_list.setter + def span_list(self, span_list): + """Sets the span_list of this Location. + + + :param span_list: The span_list of this Location. # noqa: E501 + :type: list[int] + """ + + self._span_list = span_list + + @property + def trailing_comments(self): + """Gets the trailing_comments of this Location. # noqa: E501 + + + :return: The trailing_comments of this Location. # noqa: E501 + :rtype: str + """ + return self._trailing_comments + + @trailing_comments.setter + def trailing_comments(self, trailing_comments): + """Sets the trailing_comments of this Location. + + + :param trailing_comments: The trailing_comments of this Location. # noqa: E501 + :type: str + """ + + self._trailing_comments = trailing_comments + + @property + def trailing_comments_bytes(self): + """Gets the trailing_comments_bytes of this Location. # noqa: E501 + + + :return: The trailing_comments_bytes of this Location. # noqa: E501 + :rtype: ByteString + """ + return self._trailing_comments_bytes + + @trailing_comments_bytes.setter + def trailing_comments_bytes(self, trailing_comments_bytes): + """Sets the trailing_comments_bytes of this Location. + + + :param trailing_comments_bytes: The trailing_comments_bytes of this Location. # noqa: E501 + :type: ByteString + """ + + self._trailing_comments_bytes = trailing_comments_bytes + + @property + def unknown_fields(self): + """Gets the unknown_fields of this Location. # noqa: E501 + + + :return: The unknown_fields of this Location. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this Location. + + + :param unknown_fields: The unknown_fields of this Location. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Location, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Location): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/location_or_builder.py b/src/conductor/client/codegen/models/location_or_builder.py new file mode 100644 index 00000000..038c9cfb --- /dev/null +++ b/src/conductor/client/codegen/models/location_or_builder.py @@ -0,0 +1,500 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class LocationOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'leading_comments': 'str', + 'leading_comments_bytes': 'ByteString', + 'leading_detached_comments_count': 'int', + 'leading_detached_comments_list': 'list[str]', + 'path_count': 'int', + 'path_list': 'list[int]', + 'span_count': 'int', + 'span_list': 'list[int]', + 'trailing_comments': 'str', + 'trailing_comments_bytes': 'ByteString', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'leading_comments': 'leadingComments', + 'leading_comments_bytes': 'leadingCommentsBytes', + 'leading_detached_comments_count': 'leadingDetachedCommentsCount', + 'leading_detached_comments_list': 'leadingDetachedCommentsList', + 'path_count': 'pathCount', + 'path_list': 'pathList', + 'span_count': 'spanCount', + 'span_list': 'spanList', + 'trailing_comments': 'trailingComments', + 'trailing_comments_bytes': 'trailingCommentsBytes', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, leading_comments=None, leading_comments_bytes=None, leading_detached_comments_count=None, leading_detached_comments_list=None, path_count=None, path_list=None, span_count=None, span_list=None, trailing_comments=None, trailing_comments_bytes=None, unknown_fields=None): # noqa: E501 + """LocationOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._leading_comments = None + self._leading_comments_bytes = None + self._leading_detached_comments_count = None + self._leading_detached_comments_list = None + self._path_count = None + self._path_list = None + self._span_count = None + self._span_list = None + self._trailing_comments = None + self._trailing_comments_bytes = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if leading_comments is not None: + self.leading_comments = leading_comments + if leading_comments_bytes is not None: + self.leading_comments_bytes = leading_comments_bytes + if leading_detached_comments_count is not None: + self.leading_detached_comments_count = leading_detached_comments_count + if leading_detached_comments_list is not None: + self.leading_detached_comments_list = leading_detached_comments_list + if path_count is not None: + self.path_count = path_count + if path_list is not None: + self.path_list = path_list + if span_count is not None: + self.span_count = span_count + if span_list is not None: + self.span_list = span_list + if trailing_comments is not None: + self.trailing_comments = trailing_comments + if trailing_comments_bytes is not None: + self.trailing_comments_bytes = trailing_comments_bytes + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this LocationOrBuilder. # noqa: E501 + + + :return: The all_fields of this LocationOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this LocationOrBuilder. + + + :param all_fields: The all_fields of this LocationOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this LocationOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this LocationOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this LocationOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this LocationOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this LocationOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this LocationOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this LocationOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this LocationOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this LocationOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this LocationOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this LocationOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this LocationOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this LocationOrBuilder. # noqa: E501 + + + :return: The initialized of this LocationOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this LocationOrBuilder. + + + :param initialized: The initialized of this LocationOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def leading_comments(self): + """Gets the leading_comments of this LocationOrBuilder. # noqa: E501 + + + :return: The leading_comments of this LocationOrBuilder. # noqa: E501 + :rtype: str + """ + return self._leading_comments + + @leading_comments.setter + def leading_comments(self, leading_comments): + """Sets the leading_comments of this LocationOrBuilder. + + + :param leading_comments: The leading_comments of this LocationOrBuilder. # noqa: E501 + :type: str + """ + + self._leading_comments = leading_comments + + @property + def leading_comments_bytes(self): + """Gets the leading_comments_bytes of this LocationOrBuilder. # noqa: E501 + + + :return: The leading_comments_bytes of this LocationOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._leading_comments_bytes + + @leading_comments_bytes.setter + def leading_comments_bytes(self, leading_comments_bytes): + """Sets the leading_comments_bytes of this LocationOrBuilder. + + + :param leading_comments_bytes: The leading_comments_bytes of this LocationOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._leading_comments_bytes = leading_comments_bytes + + @property + def leading_detached_comments_count(self): + """Gets the leading_detached_comments_count of this LocationOrBuilder. # noqa: E501 + + + :return: The leading_detached_comments_count of this LocationOrBuilder. # noqa: E501 + :rtype: int + """ + return self._leading_detached_comments_count + + @leading_detached_comments_count.setter + def leading_detached_comments_count(self, leading_detached_comments_count): + """Sets the leading_detached_comments_count of this LocationOrBuilder. + + + :param leading_detached_comments_count: The leading_detached_comments_count of this LocationOrBuilder. # noqa: E501 + :type: int + """ + + self._leading_detached_comments_count = leading_detached_comments_count + + @property + def leading_detached_comments_list(self): + """Gets the leading_detached_comments_list of this LocationOrBuilder. # noqa: E501 + + + :return: The leading_detached_comments_list of this LocationOrBuilder. # noqa: E501 + :rtype: list[str] + """ + return self._leading_detached_comments_list + + @leading_detached_comments_list.setter + def leading_detached_comments_list(self, leading_detached_comments_list): + """Sets the leading_detached_comments_list of this LocationOrBuilder. + + + :param leading_detached_comments_list: The leading_detached_comments_list of this LocationOrBuilder. # noqa: E501 + :type: list[str] + """ + + self._leading_detached_comments_list = leading_detached_comments_list + + @property + def path_count(self): + """Gets the path_count of this LocationOrBuilder. # noqa: E501 + + + :return: The path_count of this LocationOrBuilder. # noqa: E501 + :rtype: int + """ + return self._path_count + + @path_count.setter + def path_count(self, path_count): + """Sets the path_count of this LocationOrBuilder. + + + :param path_count: The path_count of this LocationOrBuilder. # noqa: E501 + :type: int + """ + + self._path_count = path_count + + @property + def path_list(self): + """Gets the path_list of this LocationOrBuilder. # noqa: E501 + + + :return: The path_list of this LocationOrBuilder. # noqa: E501 + :rtype: list[int] + """ + return self._path_list + + @path_list.setter + def path_list(self, path_list): + """Sets the path_list of this LocationOrBuilder. + + + :param path_list: The path_list of this LocationOrBuilder. # noqa: E501 + :type: list[int] + """ + + self._path_list = path_list + + @property + def span_count(self): + """Gets the span_count of this LocationOrBuilder. # noqa: E501 + + + :return: The span_count of this LocationOrBuilder. # noqa: E501 + :rtype: int + """ + return self._span_count + + @span_count.setter + def span_count(self, span_count): + """Sets the span_count of this LocationOrBuilder. + + + :param span_count: The span_count of this LocationOrBuilder. # noqa: E501 + :type: int + """ + + self._span_count = span_count + + @property + def span_list(self): + """Gets the span_list of this LocationOrBuilder. # noqa: E501 + + + :return: The span_list of this LocationOrBuilder. # noqa: E501 + :rtype: list[int] + """ + return self._span_list + + @span_list.setter + def span_list(self, span_list): + """Sets the span_list of this LocationOrBuilder. + + + :param span_list: The span_list of this LocationOrBuilder. # noqa: E501 + :type: list[int] + """ + + self._span_list = span_list + + @property + def trailing_comments(self): + """Gets the trailing_comments of this LocationOrBuilder. # noqa: E501 + + + :return: The trailing_comments of this LocationOrBuilder. # noqa: E501 + :rtype: str + """ + return self._trailing_comments + + @trailing_comments.setter + def trailing_comments(self, trailing_comments): + """Sets the trailing_comments of this LocationOrBuilder. + + + :param trailing_comments: The trailing_comments of this LocationOrBuilder. # noqa: E501 + :type: str + """ + + self._trailing_comments = trailing_comments + + @property + def trailing_comments_bytes(self): + """Gets the trailing_comments_bytes of this LocationOrBuilder. # noqa: E501 + + + :return: The trailing_comments_bytes of this LocationOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._trailing_comments_bytes + + @trailing_comments_bytes.setter + def trailing_comments_bytes(self, trailing_comments_bytes): + """Sets the trailing_comments_bytes of this LocationOrBuilder. + + + :param trailing_comments_bytes: The trailing_comments_bytes of this LocationOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._trailing_comments_bytes = trailing_comments_bytes + + @property + def unknown_fields(self): + """Gets the unknown_fields of this LocationOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this LocationOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this LocationOrBuilder. + + + :param unknown_fields: The unknown_fields of this LocationOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LocationOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LocationOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/message.py b/src/conductor/client/codegen/models/message.py new file mode 100644 index 00000000..7cc35ed6 --- /dev/null +++ b/src/conductor/client/codegen/models/message.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Message(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'MessageLite', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'parser_for_type': 'ParserMessage', + 'serialized_size': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, parser_for_type=None, serialized_size=None, unknown_fields=None): # noqa: E501 + """Message - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._parser_for_type = None + self._serialized_size = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this Message. # noqa: E501 + + + :return: The all_fields of this Message. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this Message. + + + :param all_fields: The all_fields of this Message. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this Message. # noqa: E501 + + + :return: The default_instance_for_type of this Message. # noqa: E501 + :rtype: MessageLite + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this Message. + + + :param default_instance_for_type: The default_instance_for_type of this Message. # noqa: E501 + :type: MessageLite + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this Message. # noqa: E501 + + + :return: The descriptor_for_type of this Message. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this Message. + + + :param descriptor_for_type: The descriptor_for_type of this Message. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this Message. # noqa: E501 + + + :return: The initialization_error_string of this Message. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this Message. + + + :param initialization_error_string: The initialization_error_string of this Message. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this Message. # noqa: E501 + + + :return: The initialized of this Message. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this Message. + + + :param initialized: The initialized of this Message. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def parser_for_type(self): + """Gets the parser_for_type of this Message. # noqa: E501 + + + :return: The parser_for_type of this Message. # noqa: E501 + :rtype: ParserMessage + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this Message. + + + :param parser_for_type: The parser_for_type of this Message. # noqa: E501 + :type: ParserMessage + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this Message. # noqa: E501 + + + :return: The serialized_size of this Message. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this Message. + + + :param serialized_size: The serialized_size of this Message. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def unknown_fields(self): + """Gets the unknown_fields of this Message. # noqa: E501 + + + :return: The unknown_fields of this Message. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this Message. + + + :param unknown_fields: The unknown_fields of this Message. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Message, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Message): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/message_lite.py b/src/conductor/client/codegen/models/message_lite.py new file mode 100644 index 00000000..b3f05434 --- /dev/null +++ b/src/conductor/client/codegen/models/message_lite.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MessageLite(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'default_instance_for_type': 'MessageLite', + 'initialized': 'bool', + 'parser_for_type': 'ParserMessageLite', + 'serialized_size': 'int' + } + + attribute_map = { + 'default_instance_for_type': 'defaultInstanceForType', + 'initialized': 'initialized', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize' + } + + def __init__(self, default_instance_for_type=None, initialized=None, parser_for_type=None, serialized_size=None): # noqa: E501 + """MessageLite - a model defined in Swagger""" # noqa: E501 + self._default_instance_for_type = None + self._initialized = None + self._parser_for_type = None + self._serialized_size = None + self.discriminator = None + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if initialized is not None: + self.initialized = initialized + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this MessageLite. # noqa: E501 + + + :return: The default_instance_for_type of this MessageLite. # noqa: E501 + :rtype: MessageLite + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this MessageLite. + + + :param default_instance_for_type: The default_instance_for_type of this MessageLite. # noqa: E501 + :type: MessageLite + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def initialized(self): + """Gets the initialized of this MessageLite. # noqa: E501 + + + :return: The initialized of this MessageLite. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this MessageLite. + + + :param initialized: The initialized of this MessageLite. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def parser_for_type(self): + """Gets the parser_for_type of this MessageLite. # noqa: E501 + + + :return: The parser_for_type of this MessageLite. # noqa: E501 + :rtype: ParserMessageLite + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this MessageLite. + + + :param parser_for_type: The parser_for_type of this MessageLite. # noqa: E501 + :type: ParserMessageLite + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this MessageLite. # noqa: E501 + + + :return: The serialized_size of this MessageLite. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this MessageLite. + + + :param serialized_size: The serialized_size of this MessageLite. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MessageLite, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MessageLite): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/message_options.py b/src/conductor/client/codegen/models/message_options.py new file mode 100644 index 00000000..de02848d --- /dev/null +++ b/src/conductor/client/codegen/models/message_options.py @@ -0,0 +1,604 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MessageOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'all_fields_raw': 'dict(str, object)', + 'default_instance_for_type': 'MessageOptions', + 'deprecated': 'bool', + 'deprecated_legacy_json_field_conflicts': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'map_entry': 'bool', + 'memoized_serialized_size': 'int', + 'message_set_wire_format': 'bool', + 'no_standard_descriptor_accessor': 'bool', + 'parser_for_type': 'ParserMessageOptions', + 'serialized_size': 'int', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'all_fields_raw': 'allFieldsRaw', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'deprecated_legacy_json_field_conflicts': 'deprecatedLegacyJsonFieldConflicts', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'map_entry': 'mapEntry', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'message_set_wire_format': 'messageSetWireFormat', + 'no_standard_descriptor_accessor': 'noStandardDescriptorAccessor', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, all_fields_raw=None, default_instance_for_type=None, deprecated=None, deprecated_legacy_json_field_conflicts=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, map_entry=None, memoized_serialized_size=None, message_set_wire_format=None, no_standard_descriptor_accessor=None, parser_for_type=None, serialized_size=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """MessageOptions - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._all_fields_raw = None + self._default_instance_for_type = None + self._deprecated = None + self._deprecated_legacy_json_field_conflicts = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._map_entry = None + self._memoized_serialized_size = None + self._message_set_wire_format = None + self._no_standard_descriptor_accessor = None + self._parser_for_type = None + self._serialized_size = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if all_fields_raw is not None: + self.all_fields_raw = all_fields_raw + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if deprecated_legacy_json_field_conflicts is not None: + self.deprecated_legacy_json_field_conflicts = deprecated_legacy_json_field_conflicts + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if map_entry is not None: + self.map_entry = map_entry + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if message_set_wire_format is not None: + self.message_set_wire_format = message_set_wire_format + if no_standard_descriptor_accessor is not None: + self.no_standard_descriptor_accessor = no_standard_descriptor_accessor + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this MessageOptions. # noqa: E501 + + + :return: The all_fields of this MessageOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this MessageOptions. + + + :param all_fields: The all_fields of this MessageOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def all_fields_raw(self): + """Gets the all_fields_raw of this MessageOptions. # noqa: E501 + + + :return: The all_fields_raw of this MessageOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields_raw + + @all_fields_raw.setter + def all_fields_raw(self, all_fields_raw): + """Sets the all_fields_raw of this MessageOptions. + + + :param all_fields_raw: The all_fields_raw of this MessageOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields_raw = all_fields_raw + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this MessageOptions. # noqa: E501 + + + :return: The default_instance_for_type of this MessageOptions. # noqa: E501 + :rtype: MessageOptions + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this MessageOptions. + + + :param default_instance_for_type: The default_instance_for_type of this MessageOptions. # noqa: E501 + :type: MessageOptions + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this MessageOptions. # noqa: E501 + + + :return: The deprecated of this MessageOptions. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this MessageOptions. + + + :param deprecated: The deprecated of this MessageOptions. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def deprecated_legacy_json_field_conflicts(self): + """Gets the deprecated_legacy_json_field_conflicts of this MessageOptions. # noqa: E501 + + + :return: The deprecated_legacy_json_field_conflicts of this MessageOptions. # noqa: E501 + :rtype: bool + """ + return self._deprecated_legacy_json_field_conflicts + + @deprecated_legacy_json_field_conflicts.setter + def deprecated_legacy_json_field_conflicts(self, deprecated_legacy_json_field_conflicts): + """Sets the deprecated_legacy_json_field_conflicts of this MessageOptions. + + + :param deprecated_legacy_json_field_conflicts: The deprecated_legacy_json_field_conflicts of this MessageOptions. # noqa: E501 + :type: bool + """ + + self._deprecated_legacy_json_field_conflicts = deprecated_legacy_json_field_conflicts + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this MessageOptions. # noqa: E501 + + + :return: The descriptor_for_type of this MessageOptions. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this MessageOptions. + + + :param descriptor_for_type: The descriptor_for_type of this MessageOptions. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this MessageOptions. # noqa: E501 + + + :return: The features of this MessageOptions. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this MessageOptions. + + + :param features: The features of this MessageOptions. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this MessageOptions. # noqa: E501 + + + :return: The features_or_builder of this MessageOptions. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this MessageOptions. + + + :param features_or_builder: The features_or_builder of this MessageOptions. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this MessageOptions. # noqa: E501 + + + :return: The initialization_error_string of this MessageOptions. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this MessageOptions. + + + :param initialization_error_string: The initialization_error_string of this MessageOptions. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this MessageOptions. # noqa: E501 + + + :return: The initialized of this MessageOptions. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this MessageOptions. + + + :param initialized: The initialized of this MessageOptions. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def map_entry(self): + """Gets the map_entry of this MessageOptions. # noqa: E501 + + + :return: The map_entry of this MessageOptions. # noqa: E501 + :rtype: bool + """ + return self._map_entry + + @map_entry.setter + def map_entry(self, map_entry): + """Sets the map_entry of this MessageOptions. + + + :param map_entry: The map_entry of this MessageOptions. # noqa: E501 + :type: bool + """ + + self._map_entry = map_entry + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this MessageOptions. # noqa: E501 + + + :return: The memoized_serialized_size of this MessageOptions. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this MessageOptions. + + + :param memoized_serialized_size: The memoized_serialized_size of this MessageOptions. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def message_set_wire_format(self): + """Gets the message_set_wire_format of this MessageOptions. # noqa: E501 + + + :return: The message_set_wire_format of this MessageOptions. # noqa: E501 + :rtype: bool + """ + return self._message_set_wire_format + + @message_set_wire_format.setter + def message_set_wire_format(self, message_set_wire_format): + """Sets the message_set_wire_format of this MessageOptions. + + + :param message_set_wire_format: The message_set_wire_format of this MessageOptions. # noqa: E501 + :type: bool + """ + + self._message_set_wire_format = message_set_wire_format + + @property + def no_standard_descriptor_accessor(self): + """Gets the no_standard_descriptor_accessor of this MessageOptions. # noqa: E501 + + + :return: The no_standard_descriptor_accessor of this MessageOptions. # noqa: E501 + :rtype: bool + """ + return self._no_standard_descriptor_accessor + + @no_standard_descriptor_accessor.setter + def no_standard_descriptor_accessor(self, no_standard_descriptor_accessor): + """Sets the no_standard_descriptor_accessor of this MessageOptions. + + + :param no_standard_descriptor_accessor: The no_standard_descriptor_accessor of this MessageOptions. # noqa: E501 + :type: bool + """ + + self._no_standard_descriptor_accessor = no_standard_descriptor_accessor + + @property + def parser_for_type(self): + """Gets the parser_for_type of this MessageOptions. # noqa: E501 + + + :return: The parser_for_type of this MessageOptions. # noqa: E501 + :rtype: ParserMessageOptions + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this MessageOptions. + + + :param parser_for_type: The parser_for_type of this MessageOptions. # noqa: E501 + :type: ParserMessageOptions + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this MessageOptions. # noqa: E501 + + + :return: The serialized_size of this MessageOptions. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this MessageOptions. + + + :param serialized_size: The serialized_size of this MessageOptions. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this MessageOptions. # noqa: E501 + + + :return: The uninterpreted_option_count of this MessageOptions. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this MessageOptions. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this MessageOptions. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this MessageOptions. # noqa: E501 + + + :return: The uninterpreted_option_list of this MessageOptions. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this MessageOptions. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this MessageOptions. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this MessageOptions. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this MessageOptions. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this MessageOptions. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this MessageOptions. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this MessageOptions. # noqa: E501 + + + :return: The unknown_fields of this MessageOptions. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this MessageOptions. + + + :param unknown_fields: The unknown_fields of this MessageOptions. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MessageOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MessageOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/message_options_or_builder.py b/src/conductor/client/codegen/models/message_options_or_builder.py new file mode 100644 index 00000000..e187cf53 --- /dev/null +++ b/src/conductor/client/codegen/models/message_options_or_builder.py @@ -0,0 +1,500 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MessageOptionsOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'deprecated': 'bool', + 'deprecated_legacy_json_field_conflicts': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'map_entry': 'bool', + 'message_set_wire_format': 'bool', + 'no_standard_descriptor_accessor': 'bool', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'deprecated_legacy_json_field_conflicts': 'deprecatedLegacyJsonFieldConflicts', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'map_entry': 'mapEntry', + 'message_set_wire_format': 'messageSetWireFormat', + 'no_standard_descriptor_accessor': 'noStandardDescriptorAccessor', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, deprecated=None, deprecated_legacy_json_field_conflicts=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, map_entry=None, message_set_wire_format=None, no_standard_descriptor_accessor=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """MessageOptionsOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._deprecated = None + self._deprecated_legacy_json_field_conflicts = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._map_entry = None + self._message_set_wire_format = None + self._no_standard_descriptor_accessor = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if deprecated_legacy_json_field_conflicts is not None: + self.deprecated_legacy_json_field_conflicts = deprecated_legacy_json_field_conflicts + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if map_entry is not None: + self.map_entry = map_entry + if message_set_wire_format is not None: + self.message_set_wire_format = message_set_wire_format + if no_standard_descriptor_accessor is not None: + self.no_standard_descriptor_accessor = no_standard_descriptor_accessor + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The all_fields of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this MessageOptionsOrBuilder. + + + :param all_fields: The all_fields of this MessageOptionsOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this MessageOptionsOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this MessageOptionsOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The deprecated of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this MessageOptionsOrBuilder. + + + :param deprecated: The deprecated of this MessageOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def deprecated_legacy_json_field_conflicts(self): + """Gets the deprecated_legacy_json_field_conflicts of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The deprecated_legacy_json_field_conflicts of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._deprecated_legacy_json_field_conflicts + + @deprecated_legacy_json_field_conflicts.setter + def deprecated_legacy_json_field_conflicts(self, deprecated_legacy_json_field_conflicts): + """Sets the deprecated_legacy_json_field_conflicts of this MessageOptionsOrBuilder. + + + :param deprecated_legacy_json_field_conflicts: The deprecated_legacy_json_field_conflicts of this MessageOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._deprecated_legacy_json_field_conflicts = deprecated_legacy_json_field_conflicts + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this MessageOptionsOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this MessageOptionsOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The features of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this MessageOptionsOrBuilder. + + + :param features: The features of this MessageOptionsOrBuilder. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The features_or_builder of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this MessageOptionsOrBuilder. + + + :param features_or_builder: The features_or_builder of this MessageOptionsOrBuilder. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this MessageOptionsOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this MessageOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The initialized of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this MessageOptionsOrBuilder. + + + :param initialized: The initialized of this MessageOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def map_entry(self): + """Gets the map_entry of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The map_entry of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._map_entry + + @map_entry.setter + def map_entry(self, map_entry): + """Sets the map_entry of this MessageOptionsOrBuilder. + + + :param map_entry: The map_entry of this MessageOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._map_entry = map_entry + + @property + def message_set_wire_format(self): + """Gets the message_set_wire_format of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The message_set_wire_format of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._message_set_wire_format + + @message_set_wire_format.setter + def message_set_wire_format(self, message_set_wire_format): + """Sets the message_set_wire_format of this MessageOptionsOrBuilder. + + + :param message_set_wire_format: The message_set_wire_format of this MessageOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._message_set_wire_format = message_set_wire_format + + @property + def no_standard_descriptor_accessor(self): + """Gets the no_standard_descriptor_accessor of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The no_standard_descriptor_accessor of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._no_standard_descriptor_accessor + + @no_standard_descriptor_accessor.setter + def no_standard_descriptor_accessor(self, no_standard_descriptor_accessor): + """Sets the no_standard_descriptor_accessor of this MessageOptionsOrBuilder. + + + :param no_standard_descriptor_accessor: The no_standard_descriptor_accessor of this MessageOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._no_standard_descriptor_accessor = no_standard_descriptor_accessor + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_count of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this MessageOptionsOrBuilder. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this MessageOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_list of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this MessageOptionsOrBuilder. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this MessageOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this MessageOptionsOrBuilder. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this MessageOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this MessageOptionsOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this MessageOptionsOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this MessageOptionsOrBuilder. + + + :param unknown_fields: The unknown_fields of this MessageOptionsOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MessageOptionsOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MessageOptionsOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/message_template.py b/src/conductor/client/codegen/models/message_template.py new file mode 100644 index 00000000..f0260305 --- /dev/null +++ b/src/conductor/client/codegen/models/message_template.py @@ -0,0 +1,370 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MessageTemplate(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'create_time': 'int', + 'created_by': 'str', + 'description': 'str', + 'integrations': 'list[str]', + 'name': 'str', + 'owner_app': 'str', + 'tags': 'list[Tag]', + 'template': 'str', + 'update_time': 'int', + 'updated_by': 'str', + 'variables': 'list[str]' + } + + attribute_map = { + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'description': 'description', + 'integrations': 'integrations', + 'name': 'name', + 'owner_app': 'ownerApp', + 'tags': 'tags', + 'template': 'template', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy', + 'variables': 'variables' + } + + def __init__(self, create_time=None, created_by=None, description=None, integrations=None, name=None, owner_app=None, tags=None, template=None, update_time=None, updated_by=None, variables=None): # noqa: E501 + """MessageTemplate - a model defined in Swagger""" # noqa: E501 + self._create_time = None + self._created_by = None + self._description = None + self._integrations = None + self._name = None + self._owner_app = None + self._tags = None + self._template = None + self._update_time = None + self._updated_by = None + self._variables = None + self.discriminator = None + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if description is not None: + self.description = description + if integrations is not None: + self.integrations = integrations + if name is not None: + self.name = name + if owner_app is not None: + self.owner_app = owner_app + if tags is not None: + self.tags = tags + if template is not None: + self.template = template + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + if variables is not None: + self.variables = variables + + @property + def create_time(self): + """Gets the create_time of this MessageTemplate. # noqa: E501 + + + :return: The create_time of this MessageTemplate. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this MessageTemplate. + + + :param create_time: The create_time of this MessageTemplate. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this MessageTemplate. # noqa: E501 + + + :return: The created_by of this MessageTemplate. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this MessageTemplate. + + + :param created_by: The created_by of this MessageTemplate. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def description(self): + """Gets the description of this MessageTemplate. # noqa: E501 + + + :return: The description of this MessageTemplate. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this MessageTemplate. + + + :param description: The description of this MessageTemplate. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def integrations(self): + """Gets the integrations of this MessageTemplate. # noqa: E501 + + + :return: The integrations of this MessageTemplate. # noqa: E501 + :rtype: list[str] + """ + return self._integrations + + @integrations.setter + def integrations(self, integrations): + """Sets the integrations of this MessageTemplate. + + + :param integrations: The integrations of this MessageTemplate. # noqa: E501 + :type: list[str] + """ + + self._integrations = integrations + + @property + def name(self): + """Gets the name of this MessageTemplate. # noqa: E501 + + + :return: The name of this MessageTemplate. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this MessageTemplate. + + + :param name: The name of this MessageTemplate. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def owner_app(self): + """Gets the owner_app of this MessageTemplate. # noqa: E501 + + + :return: The owner_app of this MessageTemplate. # noqa: E501 + :rtype: str + """ + return self._owner_app + + @owner_app.setter + def owner_app(self, owner_app): + """Sets the owner_app of this MessageTemplate. + + + :param owner_app: The owner_app of this MessageTemplate. # noqa: E501 + :type: str + """ + + self._owner_app = owner_app + + @property + def tags(self): + """Gets the tags of this MessageTemplate. # noqa: E501 + + + :return: The tags of this MessageTemplate. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this MessageTemplate. + + + :param tags: The tags of this MessageTemplate. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def template(self): + """Gets the template of this MessageTemplate. # noqa: E501 + + + :return: The template of this MessageTemplate. # noqa: E501 + :rtype: str + """ + return self._template + + @template.setter + def template(self, template): + """Sets the template of this MessageTemplate. + + + :param template: The template of this MessageTemplate. # noqa: E501 + :type: str + """ + + self._template = template + + @property + def update_time(self): + """Gets the update_time of this MessageTemplate. # noqa: E501 + + + :return: The update_time of this MessageTemplate. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this MessageTemplate. + + + :param update_time: The update_time of this MessageTemplate. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this MessageTemplate. # noqa: E501 + + + :return: The updated_by of this MessageTemplate. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this MessageTemplate. + + + :param updated_by: The updated_by of this MessageTemplate. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + @property + def variables(self): + """Gets the variables of this MessageTemplate. # noqa: E501 + + + :return: The variables of this MessageTemplate. # noqa: E501 + :rtype: list[str] + """ + return self._variables + + @variables.setter + def variables(self, variables): + """Sets the variables of this MessageTemplate. + + + :param variables: The variables of this MessageTemplate. # noqa: E501 + :type: list[str] + """ + + self._variables = variables + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MessageTemplate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MessageTemplate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/method_descriptor.py b/src/conductor/client/codegen/models/method_descriptor.py new file mode 100644 index 00000000..66c7def9 --- /dev/null +++ b/src/conductor/client/codegen/models/method_descriptor.py @@ -0,0 +1,370 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MethodDescriptor(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'client_streaming': 'bool', + 'file': 'FileDescriptor', + 'full_name': 'str', + 'index': 'int', + 'input_type': 'Descriptor', + 'name': 'str', + 'options': 'MethodOptions', + 'output_type': 'Descriptor', + 'proto': 'MethodDescriptorProto', + 'server_streaming': 'bool', + 'service': 'ServiceDescriptor' + } + + attribute_map = { + 'client_streaming': 'clientStreaming', + 'file': 'file', + 'full_name': 'fullName', + 'index': 'index', + 'input_type': 'inputType', + 'name': 'name', + 'options': 'options', + 'output_type': 'outputType', + 'proto': 'proto', + 'server_streaming': 'serverStreaming', + 'service': 'service' + } + + def __init__(self, client_streaming=None, file=None, full_name=None, index=None, input_type=None, name=None, options=None, output_type=None, proto=None, server_streaming=None, service=None): # noqa: E501 + """MethodDescriptor - a model defined in Swagger""" # noqa: E501 + self._client_streaming = None + self._file = None + self._full_name = None + self._index = None + self._input_type = None + self._name = None + self._options = None + self._output_type = None + self._proto = None + self._server_streaming = None + self._service = None + self.discriminator = None + if client_streaming is not None: + self.client_streaming = client_streaming + if file is not None: + self.file = file + if full_name is not None: + self.full_name = full_name + if index is not None: + self.index = index + if input_type is not None: + self.input_type = input_type + if name is not None: + self.name = name + if options is not None: + self.options = options + if output_type is not None: + self.output_type = output_type + if proto is not None: + self.proto = proto + if server_streaming is not None: + self.server_streaming = server_streaming + if service is not None: + self.service = service + + @property + def client_streaming(self): + """Gets the client_streaming of this MethodDescriptor. # noqa: E501 + + + :return: The client_streaming of this MethodDescriptor. # noqa: E501 + :rtype: bool + """ + return self._client_streaming + + @client_streaming.setter + def client_streaming(self, client_streaming): + """Sets the client_streaming of this MethodDescriptor. + + + :param client_streaming: The client_streaming of this MethodDescriptor. # noqa: E501 + :type: bool + """ + + self._client_streaming = client_streaming + + @property + def file(self): + """Gets the file of this MethodDescriptor. # noqa: E501 + + + :return: The file of this MethodDescriptor. # noqa: E501 + :rtype: FileDescriptor + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this MethodDescriptor. + + + :param file: The file of this MethodDescriptor. # noqa: E501 + :type: FileDescriptor + """ + + self._file = file + + @property + def full_name(self): + """Gets the full_name of this MethodDescriptor. # noqa: E501 + + + :return: The full_name of this MethodDescriptor. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this MethodDescriptor. + + + :param full_name: The full_name of this MethodDescriptor. # noqa: E501 + :type: str + """ + + self._full_name = full_name + + @property + def index(self): + """Gets the index of this MethodDescriptor. # noqa: E501 + + + :return: The index of this MethodDescriptor. # noqa: E501 + :rtype: int + """ + return self._index + + @index.setter + def index(self, index): + """Sets the index of this MethodDescriptor. + + + :param index: The index of this MethodDescriptor. # noqa: E501 + :type: int + """ + + self._index = index + + @property + def input_type(self): + """Gets the input_type of this MethodDescriptor. # noqa: E501 + + + :return: The input_type of this MethodDescriptor. # noqa: E501 + :rtype: Descriptor + """ + return self._input_type + + @input_type.setter + def input_type(self, input_type): + """Sets the input_type of this MethodDescriptor. + + + :param input_type: The input_type of this MethodDescriptor. # noqa: E501 + :type: Descriptor + """ + + self._input_type = input_type + + @property + def name(self): + """Gets the name of this MethodDescriptor. # noqa: E501 + + + :return: The name of this MethodDescriptor. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this MethodDescriptor. + + + :param name: The name of this MethodDescriptor. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def options(self): + """Gets the options of this MethodDescriptor. # noqa: E501 + + + :return: The options of this MethodDescriptor. # noqa: E501 + :rtype: MethodOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this MethodDescriptor. + + + :param options: The options of this MethodDescriptor. # noqa: E501 + :type: MethodOptions + """ + + self._options = options + + @property + def output_type(self): + """Gets the output_type of this MethodDescriptor. # noqa: E501 + + + :return: The output_type of this MethodDescriptor. # noqa: E501 + :rtype: Descriptor + """ + return self._output_type + + @output_type.setter + def output_type(self, output_type): + """Sets the output_type of this MethodDescriptor. + + + :param output_type: The output_type of this MethodDescriptor. # noqa: E501 + :type: Descriptor + """ + + self._output_type = output_type + + @property + def proto(self): + """Gets the proto of this MethodDescriptor. # noqa: E501 + + + :return: The proto of this MethodDescriptor. # noqa: E501 + :rtype: MethodDescriptorProto + """ + return self._proto + + @proto.setter + def proto(self, proto): + """Sets the proto of this MethodDescriptor. + + + :param proto: The proto of this MethodDescriptor. # noqa: E501 + :type: MethodDescriptorProto + """ + + self._proto = proto + + @property + def server_streaming(self): + """Gets the server_streaming of this MethodDescriptor. # noqa: E501 + + + :return: The server_streaming of this MethodDescriptor. # noqa: E501 + :rtype: bool + """ + return self._server_streaming + + @server_streaming.setter + def server_streaming(self, server_streaming): + """Sets the server_streaming of this MethodDescriptor. + + + :param server_streaming: The server_streaming of this MethodDescriptor. # noqa: E501 + :type: bool + """ + + self._server_streaming = server_streaming + + @property + def service(self): + """Gets the service of this MethodDescriptor. # noqa: E501 + + + :return: The service of this MethodDescriptor. # noqa: E501 + :rtype: ServiceDescriptor + """ + return self._service + + @service.setter + def service(self, service): + """Sets the service of this MethodDescriptor. + + + :param service: The service of this MethodDescriptor. # noqa: E501 + :type: ServiceDescriptor + """ + + self._service = service + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MethodDescriptor, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MethodDescriptor): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/method_descriptor_proto.py b/src/conductor/client/codegen/models/method_descriptor_proto.py new file mode 100644 index 00000000..9d155e86 --- /dev/null +++ b/src/conductor/client/codegen/models/method_descriptor_proto.py @@ -0,0 +1,578 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MethodDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'client_streaming': 'bool', + 'default_instance_for_type': 'MethodDescriptorProto', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'input_type': 'str', + 'input_type_bytes': 'ByteString', + 'memoized_serialized_size': 'int', + 'name': 'str', + 'name_bytes': 'ByteString', + 'options': 'MethodOptions', + 'options_or_builder': 'MethodOptionsOrBuilder', + 'output_type': 'str', + 'output_type_bytes': 'ByteString', + 'parser_for_type': 'ParserMethodDescriptorProto', + 'serialized_size': 'int', + 'server_streaming': 'bool', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'client_streaming': 'clientStreaming', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'input_type': 'inputType', + 'input_type_bytes': 'inputTypeBytes', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'output_type': 'outputType', + 'output_type_bytes': 'outputTypeBytes', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'server_streaming': 'serverStreaming', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, client_streaming=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, input_type=None, input_type_bytes=None, memoized_serialized_size=None, name=None, name_bytes=None, options=None, options_or_builder=None, output_type=None, output_type_bytes=None, parser_for_type=None, serialized_size=None, server_streaming=None, unknown_fields=None): # noqa: E501 + """MethodDescriptorProto - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._client_streaming = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._input_type = None + self._input_type_bytes = None + self._memoized_serialized_size = None + self._name = None + self._name_bytes = None + self._options = None + self._options_or_builder = None + self._output_type = None + self._output_type_bytes = None + self._parser_for_type = None + self._serialized_size = None + self._server_streaming = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if client_streaming is not None: + self.client_streaming = client_streaming + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if input_type is not None: + self.input_type = input_type + if input_type_bytes is not None: + self.input_type_bytes = input_type_bytes + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if output_type is not None: + self.output_type = output_type + if output_type_bytes is not None: + self.output_type_bytes = output_type_bytes + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if server_streaming is not None: + self.server_streaming = server_streaming + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this MethodDescriptorProto. # noqa: E501 + + + :return: The all_fields of this MethodDescriptorProto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this MethodDescriptorProto. + + + :param all_fields: The all_fields of this MethodDescriptorProto. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def client_streaming(self): + """Gets the client_streaming of this MethodDescriptorProto. # noqa: E501 + + + :return: The client_streaming of this MethodDescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._client_streaming + + @client_streaming.setter + def client_streaming(self, client_streaming): + """Sets the client_streaming of this MethodDescriptorProto. + + + :param client_streaming: The client_streaming of this MethodDescriptorProto. # noqa: E501 + :type: bool + """ + + self._client_streaming = client_streaming + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this MethodDescriptorProto. # noqa: E501 + + + :return: The default_instance_for_type of this MethodDescriptorProto. # noqa: E501 + :rtype: MethodDescriptorProto + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this MethodDescriptorProto. + + + :param default_instance_for_type: The default_instance_for_type of this MethodDescriptorProto. # noqa: E501 + :type: MethodDescriptorProto + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this MethodDescriptorProto. # noqa: E501 + + + :return: The descriptor_for_type of this MethodDescriptorProto. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this MethodDescriptorProto. + + + :param descriptor_for_type: The descriptor_for_type of this MethodDescriptorProto. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this MethodDescriptorProto. # noqa: E501 + + + :return: The initialization_error_string of this MethodDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this MethodDescriptorProto. + + + :param initialization_error_string: The initialization_error_string of this MethodDescriptorProto. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this MethodDescriptorProto. # noqa: E501 + + + :return: The initialized of this MethodDescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this MethodDescriptorProto. + + + :param initialized: The initialized of this MethodDescriptorProto. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def input_type(self): + """Gets the input_type of this MethodDescriptorProto. # noqa: E501 + + + :return: The input_type of this MethodDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._input_type + + @input_type.setter + def input_type(self, input_type): + """Sets the input_type of this MethodDescriptorProto. + + + :param input_type: The input_type of this MethodDescriptorProto. # noqa: E501 + :type: str + """ + + self._input_type = input_type + + @property + def input_type_bytes(self): + """Gets the input_type_bytes of this MethodDescriptorProto. # noqa: E501 + + + :return: The input_type_bytes of this MethodDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._input_type_bytes + + @input_type_bytes.setter + def input_type_bytes(self, input_type_bytes): + """Sets the input_type_bytes of this MethodDescriptorProto. + + + :param input_type_bytes: The input_type_bytes of this MethodDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._input_type_bytes = input_type_bytes + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this MethodDescriptorProto. # noqa: E501 + + + :return: The memoized_serialized_size of this MethodDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this MethodDescriptorProto. + + + :param memoized_serialized_size: The memoized_serialized_size of this MethodDescriptorProto. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def name(self): + """Gets the name of this MethodDescriptorProto. # noqa: E501 + + + :return: The name of this MethodDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this MethodDescriptorProto. + + + :param name: The name of this MethodDescriptorProto. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this MethodDescriptorProto. # noqa: E501 + + + :return: The name_bytes of this MethodDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this MethodDescriptorProto. + + + :param name_bytes: The name_bytes of this MethodDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def options(self): + """Gets the options of this MethodDescriptorProto. # noqa: E501 + + + :return: The options of this MethodDescriptorProto. # noqa: E501 + :rtype: MethodOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this MethodDescriptorProto. + + + :param options: The options of this MethodDescriptorProto. # noqa: E501 + :type: MethodOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this MethodDescriptorProto. # noqa: E501 + + + :return: The options_or_builder of this MethodDescriptorProto. # noqa: E501 + :rtype: MethodOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this MethodDescriptorProto. + + + :param options_or_builder: The options_or_builder of this MethodDescriptorProto. # noqa: E501 + :type: MethodOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def output_type(self): + """Gets the output_type of this MethodDescriptorProto. # noqa: E501 + + + :return: The output_type of this MethodDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._output_type + + @output_type.setter + def output_type(self, output_type): + """Sets the output_type of this MethodDescriptorProto. + + + :param output_type: The output_type of this MethodDescriptorProto. # noqa: E501 + :type: str + """ + + self._output_type = output_type + + @property + def output_type_bytes(self): + """Gets the output_type_bytes of this MethodDescriptorProto. # noqa: E501 + + + :return: The output_type_bytes of this MethodDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._output_type_bytes + + @output_type_bytes.setter + def output_type_bytes(self, output_type_bytes): + """Sets the output_type_bytes of this MethodDescriptorProto. + + + :param output_type_bytes: The output_type_bytes of this MethodDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._output_type_bytes = output_type_bytes + + @property + def parser_for_type(self): + """Gets the parser_for_type of this MethodDescriptorProto. # noqa: E501 + + + :return: The parser_for_type of this MethodDescriptorProto. # noqa: E501 + :rtype: ParserMethodDescriptorProto + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this MethodDescriptorProto. + + + :param parser_for_type: The parser_for_type of this MethodDescriptorProto. # noqa: E501 + :type: ParserMethodDescriptorProto + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this MethodDescriptorProto. # noqa: E501 + + + :return: The serialized_size of this MethodDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this MethodDescriptorProto. + + + :param serialized_size: The serialized_size of this MethodDescriptorProto. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def server_streaming(self): + """Gets the server_streaming of this MethodDescriptorProto. # noqa: E501 + + + :return: The server_streaming of this MethodDescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._server_streaming + + @server_streaming.setter + def server_streaming(self, server_streaming): + """Sets the server_streaming of this MethodDescriptorProto. + + + :param server_streaming: The server_streaming of this MethodDescriptorProto. # noqa: E501 + :type: bool + """ + + self._server_streaming = server_streaming + + @property + def unknown_fields(self): + """Gets the unknown_fields of this MethodDescriptorProto. # noqa: E501 + + + :return: The unknown_fields of this MethodDescriptorProto. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this MethodDescriptorProto. + + + :param unknown_fields: The unknown_fields of this MethodDescriptorProto. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MethodDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MethodDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/method_descriptor_proto_or_builder.py b/src/conductor/client/codegen/models/method_descriptor_proto_or_builder.py new file mode 100644 index 00000000..c4ba1c66 --- /dev/null +++ b/src/conductor/client/codegen/models/method_descriptor_proto_or_builder.py @@ -0,0 +1,500 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MethodDescriptorProtoOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'client_streaming': 'bool', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'input_type': 'str', + 'input_type_bytes': 'ByteString', + 'name': 'str', + 'name_bytes': 'ByteString', + 'options': 'MethodOptions', + 'options_or_builder': 'MethodOptionsOrBuilder', + 'output_type': 'str', + 'output_type_bytes': 'ByteString', + 'server_streaming': 'bool', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'client_streaming': 'clientStreaming', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'input_type': 'inputType', + 'input_type_bytes': 'inputTypeBytes', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'output_type': 'outputType', + 'output_type_bytes': 'outputTypeBytes', + 'server_streaming': 'serverStreaming', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, client_streaming=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, input_type=None, input_type_bytes=None, name=None, name_bytes=None, options=None, options_or_builder=None, output_type=None, output_type_bytes=None, server_streaming=None, unknown_fields=None): # noqa: E501 + """MethodDescriptorProtoOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._client_streaming = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._input_type = None + self._input_type_bytes = None + self._name = None + self._name_bytes = None + self._options = None + self._options_or_builder = None + self._output_type = None + self._output_type_bytes = None + self._server_streaming = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if client_streaming is not None: + self.client_streaming = client_streaming + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if input_type is not None: + self.input_type = input_type + if input_type_bytes is not None: + self.input_type_bytes = input_type_bytes + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if output_type is not None: + self.output_type = output_type + if output_type_bytes is not None: + self.output_type_bytes = output_type_bytes + if server_streaming is not None: + self.server_streaming = server_streaming + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The all_fields of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this MethodDescriptorProtoOrBuilder. + + + :param all_fields: The all_fields of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def client_streaming(self): + """Gets the client_streaming of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The client_streaming of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._client_streaming + + @client_streaming.setter + def client_streaming(self, client_streaming): + """Sets the client_streaming of this MethodDescriptorProtoOrBuilder. + + + :param client_streaming: The client_streaming of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: bool + """ + + self._client_streaming = client_streaming + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this MethodDescriptorProtoOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this MethodDescriptorProtoOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this MethodDescriptorProtoOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialized of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this MethodDescriptorProtoOrBuilder. + + + :param initialized: The initialized of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def input_type(self): + """Gets the input_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The input_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._input_type + + @input_type.setter + def input_type(self, input_type): + """Sets the input_type of this MethodDescriptorProtoOrBuilder. + + + :param input_type: The input_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._input_type = input_type + + @property + def input_type_bytes(self): + """Gets the input_type_bytes of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The input_type_bytes of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._input_type_bytes + + @input_type_bytes.setter + def input_type_bytes(self, input_type_bytes): + """Sets the input_type_bytes of this MethodDescriptorProtoOrBuilder. + + + :param input_type_bytes: The input_type_bytes of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._input_type_bytes = input_type_bytes + + @property + def name(self): + """Gets the name of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this MethodDescriptorProtoOrBuilder. + + + :param name: The name of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name_bytes of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this MethodDescriptorProtoOrBuilder. + + + :param name_bytes: The name_bytes of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def options(self): + """Gets the options of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: MethodOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this MethodDescriptorProtoOrBuilder. + + + :param options: The options of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: MethodOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options_or_builder of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: MethodOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this MethodDescriptorProtoOrBuilder. + + + :param options_or_builder: The options_or_builder of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: MethodOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def output_type(self): + """Gets the output_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The output_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._output_type + + @output_type.setter + def output_type(self, output_type): + """Sets the output_type of this MethodDescriptorProtoOrBuilder. + + + :param output_type: The output_type of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._output_type = output_type + + @property + def output_type_bytes(self): + """Gets the output_type_bytes of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The output_type_bytes of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._output_type_bytes + + @output_type_bytes.setter + def output_type_bytes(self, output_type_bytes): + """Sets the output_type_bytes of this MethodDescriptorProtoOrBuilder. + + + :param output_type_bytes: The output_type_bytes of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._output_type_bytes = output_type_bytes + + @property + def server_streaming(self): + """Gets the server_streaming of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The server_streaming of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._server_streaming + + @server_streaming.setter + def server_streaming(self, server_streaming): + """Sets the server_streaming of this MethodDescriptorProtoOrBuilder. + + + :param server_streaming: The server_streaming of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: bool + """ + + self._server_streaming = server_streaming + + @property + def unknown_fields(self): + """Gets the unknown_fields of this MethodDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this MethodDescriptorProtoOrBuilder. + + + :param unknown_fields: The unknown_fields of this MethodDescriptorProtoOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MethodDescriptorProtoOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MethodDescriptorProtoOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/method_options.py b/src/conductor/client/codegen/models/method_options.py new file mode 100644 index 00000000..ded4b6a8 --- /dev/null +++ b/src/conductor/client/codegen/models/method_options.py @@ -0,0 +1,532 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MethodOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'all_fields_raw': 'dict(str, object)', + 'default_instance_for_type': 'MethodOptions', + 'deprecated': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'idempotency_level': 'str', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserMethodOptions', + 'serialized_size': 'int', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'all_fields_raw': 'allFieldsRaw', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'idempotency_level': 'idempotencyLevel', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, all_fields_raw=None, default_instance_for_type=None, deprecated=None, descriptor_for_type=None, features=None, features_or_builder=None, idempotency_level=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """MethodOptions - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._all_fields_raw = None + self._default_instance_for_type = None + self._deprecated = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._idempotency_level = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if all_fields_raw is not None: + self.all_fields_raw = all_fields_raw + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if idempotency_level is not None: + self.idempotency_level = idempotency_level + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this MethodOptions. # noqa: E501 + + + :return: The all_fields of this MethodOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this MethodOptions. + + + :param all_fields: The all_fields of this MethodOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def all_fields_raw(self): + """Gets the all_fields_raw of this MethodOptions. # noqa: E501 + + + :return: The all_fields_raw of this MethodOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields_raw + + @all_fields_raw.setter + def all_fields_raw(self, all_fields_raw): + """Sets the all_fields_raw of this MethodOptions. + + + :param all_fields_raw: The all_fields_raw of this MethodOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields_raw = all_fields_raw + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this MethodOptions. # noqa: E501 + + + :return: The default_instance_for_type of this MethodOptions. # noqa: E501 + :rtype: MethodOptions + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this MethodOptions. + + + :param default_instance_for_type: The default_instance_for_type of this MethodOptions. # noqa: E501 + :type: MethodOptions + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this MethodOptions. # noqa: E501 + + + :return: The deprecated of this MethodOptions. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this MethodOptions. + + + :param deprecated: The deprecated of this MethodOptions. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this MethodOptions. # noqa: E501 + + + :return: The descriptor_for_type of this MethodOptions. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this MethodOptions. + + + :param descriptor_for_type: The descriptor_for_type of this MethodOptions. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this MethodOptions. # noqa: E501 + + + :return: The features of this MethodOptions. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this MethodOptions. + + + :param features: The features of this MethodOptions. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this MethodOptions. # noqa: E501 + + + :return: The features_or_builder of this MethodOptions. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this MethodOptions. + + + :param features_or_builder: The features_or_builder of this MethodOptions. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def idempotency_level(self): + """Gets the idempotency_level of this MethodOptions. # noqa: E501 + + + :return: The idempotency_level of this MethodOptions. # noqa: E501 + :rtype: str + """ + return self._idempotency_level + + @idempotency_level.setter + def idempotency_level(self, idempotency_level): + """Sets the idempotency_level of this MethodOptions. + + + :param idempotency_level: The idempotency_level of this MethodOptions. # noqa: E501 + :type: str + """ + allowed_values = ["IDEMPOTENCY_UNKNOWN", "NO_SIDE_EFFECTS", "IDEMPOTENT"] # noqa: E501 + if idempotency_level not in allowed_values: + raise ValueError( + "Invalid value for `idempotency_level` ({0}), must be one of {1}" # noqa: E501 + .format(idempotency_level, allowed_values) + ) + + self._idempotency_level = idempotency_level + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this MethodOptions. # noqa: E501 + + + :return: The initialization_error_string of this MethodOptions. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this MethodOptions. + + + :param initialization_error_string: The initialization_error_string of this MethodOptions. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this MethodOptions. # noqa: E501 + + + :return: The initialized of this MethodOptions. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this MethodOptions. + + + :param initialized: The initialized of this MethodOptions. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this MethodOptions. # noqa: E501 + + + :return: The memoized_serialized_size of this MethodOptions. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this MethodOptions. + + + :param memoized_serialized_size: The memoized_serialized_size of this MethodOptions. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this MethodOptions. # noqa: E501 + + + :return: The parser_for_type of this MethodOptions. # noqa: E501 + :rtype: ParserMethodOptions + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this MethodOptions. + + + :param parser_for_type: The parser_for_type of this MethodOptions. # noqa: E501 + :type: ParserMethodOptions + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this MethodOptions. # noqa: E501 + + + :return: The serialized_size of this MethodOptions. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this MethodOptions. + + + :param serialized_size: The serialized_size of this MethodOptions. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this MethodOptions. # noqa: E501 + + + :return: The uninterpreted_option_count of this MethodOptions. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this MethodOptions. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this MethodOptions. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this MethodOptions. # noqa: E501 + + + :return: The uninterpreted_option_list of this MethodOptions. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this MethodOptions. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this MethodOptions. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this MethodOptions. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this MethodOptions. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this MethodOptions. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this MethodOptions. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this MethodOptions. # noqa: E501 + + + :return: The unknown_fields of this MethodOptions. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this MethodOptions. + + + :param unknown_fields: The unknown_fields of this MethodOptions. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MethodOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MethodOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/method_options_or_builder.py b/src/conductor/client/codegen/models/method_options_or_builder.py new file mode 100644 index 00000000..0c1ba462 --- /dev/null +++ b/src/conductor/client/codegen/models/method_options_or_builder.py @@ -0,0 +1,428 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MethodOptionsOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'deprecated': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'idempotency_level': 'str', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'idempotency_level': 'idempotencyLevel', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, deprecated=None, descriptor_for_type=None, features=None, features_or_builder=None, idempotency_level=None, initialization_error_string=None, initialized=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """MethodOptionsOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._deprecated = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._idempotency_level = None + self._initialization_error_string = None + self._initialized = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if idempotency_level is not None: + self.idempotency_level = idempotency_level + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The all_fields of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this MethodOptionsOrBuilder. + + + :param all_fields: The all_fields of this MethodOptionsOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this MethodOptionsOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this MethodOptionsOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The deprecated of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this MethodOptionsOrBuilder. + + + :param deprecated: The deprecated of this MethodOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this MethodOptionsOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this MethodOptionsOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The features of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this MethodOptionsOrBuilder. + + + :param features: The features of this MethodOptionsOrBuilder. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The features_or_builder of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this MethodOptionsOrBuilder. + + + :param features_or_builder: The features_or_builder of this MethodOptionsOrBuilder. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def idempotency_level(self): + """Gets the idempotency_level of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The idempotency_level of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._idempotency_level + + @idempotency_level.setter + def idempotency_level(self, idempotency_level): + """Sets the idempotency_level of this MethodOptionsOrBuilder. + + + :param idempotency_level: The idempotency_level of this MethodOptionsOrBuilder. # noqa: E501 + :type: str + """ + allowed_values = ["IDEMPOTENCY_UNKNOWN", "NO_SIDE_EFFECTS", "IDEMPOTENT"] # noqa: E501 + if idempotency_level not in allowed_values: + raise ValueError( + "Invalid value for `idempotency_level` ({0}), must be one of {1}" # noqa: E501 + .format(idempotency_level, allowed_values) + ) + + self._idempotency_level = idempotency_level + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this MethodOptionsOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this MethodOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The initialized of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this MethodOptionsOrBuilder. + + + :param initialized: The initialized of this MethodOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_count of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this MethodOptionsOrBuilder. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this MethodOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_list of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this MethodOptionsOrBuilder. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this MethodOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this MethodOptionsOrBuilder. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this MethodOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this MethodOptionsOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this MethodOptionsOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this MethodOptionsOrBuilder. + + + :param unknown_fields: The unknown_fields of this MethodOptionsOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MethodOptionsOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MethodOptionsOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/metrics_token.py b/src/conductor/client/codegen/models/metrics_token.py new file mode 100644 index 00000000..83a414c5 --- /dev/null +++ b/src/conductor/client/codegen/models/metrics_token.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MetricsToken(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'token': 'str' + } + + attribute_map = { + 'token': 'token' + } + + def __init__(self, token=None): # noqa: E501 + """MetricsToken - a model defined in Swagger""" # noqa: E501 + self._token = None + self.discriminator = None + if token is not None: + self.token = token + + @property + def token(self): + """Gets the token of this MetricsToken. # noqa: E501 + + + :return: The token of this MetricsToken. # noqa: E501 + :rtype: str + """ + return self._token + + @token.setter + def token(self, token): + """Sets the token of this MetricsToken. + + + :param token: The token of this MetricsToken. # noqa: E501 + :type: str + """ + + self._token = token + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MetricsToken, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MetricsToken): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/name_part.py b/src/conductor/client/codegen/models/name_part.py new file mode 100644 index 00000000..1966b427 --- /dev/null +++ b/src/conductor/client/codegen/models/name_part.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class NamePart(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'NamePart', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'is_extension': 'bool', + 'memoized_serialized_size': 'int', + 'name_part': 'str', + 'name_part_bytes': 'ByteString', + 'parser_for_type': 'ParserNamePart', + 'serialized_size': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'is_extension': 'isExtension', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'name_part': 'namePart', + 'name_part_bytes': 'namePartBytes', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, is_extension=None, memoized_serialized_size=None, name_part=None, name_part_bytes=None, parser_for_type=None, serialized_size=None, unknown_fields=None): # noqa: E501 + """NamePart - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._is_extension = None + self._memoized_serialized_size = None + self._name_part = None + self._name_part_bytes = None + self._parser_for_type = None + self._serialized_size = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if is_extension is not None: + self.is_extension = is_extension + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if name_part is not None: + self.name_part = name_part + if name_part_bytes is not None: + self.name_part_bytes = name_part_bytes + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this NamePart. # noqa: E501 + + + :return: The all_fields of this NamePart. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this NamePart. + + + :param all_fields: The all_fields of this NamePart. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this NamePart. # noqa: E501 + + + :return: The default_instance_for_type of this NamePart. # noqa: E501 + :rtype: NamePart + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this NamePart. + + + :param default_instance_for_type: The default_instance_for_type of this NamePart. # noqa: E501 + :type: NamePart + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this NamePart. # noqa: E501 + + + :return: The descriptor_for_type of this NamePart. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this NamePart. + + + :param descriptor_for_type: The descriptor_for_type of this NamePart. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this NamePart. # noqa: E501 + + + :return: The initialization_error_string of this NamePart. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this NamePart. + + + :param initialization_error_string: The initialization_error_string of this NamePart. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this NamePart. # noqa: E501 + + + :return: The initialized of this NamePart. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this NamePart. + + + :param initialized: The initialized of this NamePart. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def is_extension(self): + """Gets the is_extension of this NamePart. # noqa: E501 + + + :return: The is_extension of this NamePart. # noqa: E501 + :rtype: bool + """ + return self._is_extension + + @is_extension.setter + def is_extension(self, is_extension): + """Sets the is_extension of this NamePart. + + + :param is_extension: The is_extension of this NamePart. # noqa: E501 + :type: bool + """ + + self._is_extension = is_extension + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this NamePart. # noqa: E501 + + + :return: The memoized_serialized_size of this NamePart. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this NamePart. + + + :param memoized_serialized_size: The memoized_serialized_size of this NamePart. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def name_part(self): + """Gets the name_part of this NamePart. # noqa: E501 + + + :return: The name_part of this NamePart. # noqa: E501 + :rtype: str + """ + return self._name_part + + @name_part.setter + def name_part(self, name_part): + """Sets the name_part of this NamePart. + + + :param name_part: The name_part of this NamePart. # noqa: E501 + :type: str + """ + + self._name_part = name_part + + @property + def name_part_bytes(self): + """Gets the name_part_bytes of this NamePart. # noqa: E501 + + + :return: The name_part_bytes of this NamePart. # noqa: E501 + :rtype: ByteString + """ + return self._name_part_bytes + + @name_part_bytes.setter + def name_part_bytes(self, name_part_bytes): + """Sets the name_part_bytes of this NamePart. + + + :param name_part_bytes: The name_part_bytes of this NamePart. # noqa: E501 + :type: ByteString + """ + + self._name_part_bytes = name_part_bytes + + @property + def parser_for_type(self): + """Gets the parser_for_type of this NamePart. # noqa: E501 + + + :return: The parser_for_type of this NamePart. # noqa: E501 + :rtype: ParserNamePart + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this NamePart. + + + :param parser_for_type: The parser_for_type of this NamePart. # noqa: E501 + :type: ParserNamePart + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this NamePart. # noqa: E501 + + + :return: The serialized_size of this NamePart. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this NamePart. + + + :param serialized_size: The serialized_size of this NamePart. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def unknown_fields(self): + """Gets the unknown_fields of this NamePart. # noqa: E501 + + + :return: The unknown_fields of this NamePart. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this NamePart. + + + :param unknown_fields: The unknown_fields of this NamePart. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(NamePart, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NamePart): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/name_part_or_builder.py b/src/conductor/client/codegen/models/name_part_or_builder.py new file mode 100644 index 00000000..1a32edb3 --- /dev/null +++ b/src/conductor/client/codegen/models/name_part_or_builder.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class NamePartOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'is_extension': 'bool', + 'name_part': 'str', + 'name_part_bytes': 'ByteString', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'is_extension': 'isExtension', + 'name_part': 'namePart', + 'name_part_bytes': 'namePartBytes', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, is_extension=None, name_part=None, name_part_bytes=None, unknown_fields=None): # noqa: E501 + """NamePartOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._is_extension = None + self._name_part = None + self._name_part_bytes = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if is_extension is not None: + self.is_extension = is_extension + if name_part is not None: + self.name_part = name_part + if name_part_bytes is not None: + self.name_part_bytes = name_part_bytes + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this NamePartOrBuilder. # noqa: E501 + + + :return: The all_fields of this NamePartOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this NamePartOrBuilder. + + + :param all_fields: The all_fields of this NamePartOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this NamePartOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this NamePartOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this NamePartOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this NamePartOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this NamePartOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this NamePartOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this NamePartOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this NamePartOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this NamePartOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this NamePartOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this NamePartOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this NamePartOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this NamePartOrBuilder. # noqa: E501 + + + :return: The initialized of this NamePartOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this NamePartOrBuilder. + + + :param initialized: The initialized of this NamePartOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def is_extension(self): + """Gets the is_extension of this NamePartOrBuilder. # noqa: E501 + + + :return: The is_extension of this NamePartOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._is_extension + + @is_extension.setter + def is_extension(self, is_extension): + """Sets the is_extension of this NamePartOrBuilder. + + + :param is_extension: The is_extension of this NamePartOrBuilder. # noqa: E501 + :type: bool + """ + + self._is_extension = is_extension + + @property + def name_part(self): + """Gets the name_part of this NamePartOrBuilder. # noqa: E501 + + + :return: The name_part of this NamePartOrBuilder. # noqa: E501 + :rtype: str + """ + return self._name_part + + @name_part.setter + def name_part(self, name_part): + """Sets the name_part of this NamePartOrBuilder. + + + :param name_part: The name_part of this NamePartOrBuilder. # noqa: E501 + :type: str + """ + + self._name_part = name_part + + @property + def name_part_bytes(self): + """Gets the name_part_bytes of this NamePartOrBuilder. # noqa: E501 + + + :return: The name_part_bytes of this NamePartOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._name_part_bytes + + @name_part_bytes.setter + def name_part_bytes(self, name_part_bytes): + """Sets the name_part_bytes of this NamePartOrBuilder. + + + :param name_part_bytes: The name_part_bytes of this NamePartOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._name_part_bytes = name_part_bytes + + @property + def unknown_fields(self): + """Gets the unknown_fields of this NamePartOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this NamePartOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this NamePartOrBuilder. + + + :param unknown_fields: The unknown_fields of this NamePartOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(NamePartOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NamePartOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/oneof_descriptor.py b/src/conductor/client/codegen/models/oneof_descriptor.py new file mode 100644 index 00000000..353adc40 --- /dev/null +++ b/src/conductor/client/codegen/models/oneof_descriptor.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OneofDescriptor(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'containing_type': 'Descriptor', + 'field_count': 'int', + 'file': 'FileDescriptor', + 'full_name': 'str', + 'index': 'int', + 'name': 'str', + 'options': 'OneofOptions', + 'proto': 'OneofDescriptorProto', + 'synthetic': 'bool' + } + + attribute_map = { + 'containing_type': 'containingType', + 'field_count': 'fieldCount', + 'file': 'file', + 'full_name': 'fullName', + 'index': 'index', + 'name': 'name', + 'options': 'options', + 'proto': 'proto', + 'synthetic': 'synthetic' + } + + def __init__(self, containing_type=None, field_count=None, file=None, full_name=None, index=None, name=None, options=None, proto=None, synthetic=None): # noqa: E501 + """OneofDescriptor - a model defined in Swagger""" # noqa: E501 + self._containing_type = None + self._field_count = None + self._file = None + self._full_name = None + self._index = None + self._name = None + self._options = None + self._proto = None + self._synthetic = None + self.discriminator = None + if containing_type is not None: + self.containing_type = containing_type + if field_count is not None: + self.field_count = field_count + if file is not None: + self.file = file + if full_name is not None: + self.full_name = full_name + if index is not None: + self.index = index + if name is not None: + self.name = name + if options is not None: + self.options = options + if proto is not None: + self.proto = proto + if synthetic is not None: + self.synthetic = synthetic + + @property + def containing_type(self): + """Gets the containing_type of this OneofDescriptor. # noqa: E501 + + + :return: The containing_type of this OneofDescriptor. # noqa: E501 + :rtype: Descriptor + """ + return self._containing_type + + @containing_type.setter + def containing_type(self, containing_type): + """Sets the containing_type of this OneofDescriptor. + + + :param containing_type: The containing_type of this OneofDescriptor. # noqa: E501 + :type: Descriptor + """ + + self._containing_type = containing_type + + @property + def field_count(self): + """Gets the field_count of this OneofDescriptor. # noqa: E501 + + + :return: The field_count of this OneofDescriptor. # noqa: E501 + :rtype: int + """ + return self._field_count + + @field_count.setter + def field_count(self, field_count): + """Sets the field_count of this OneofDescriptor. + + + :param field_count: The field_count of this OneofDescriptor. # noqa: E501 + :type: int + """ + + self._field_count = field_count + + @property + def file(self): + """Gets the file of this OneofDescriptor. # noqa: E501 + + + :return: The file of this OneofDescriptor. # noqa: E501 + :rtype: FileDescriptor + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this OneofDescriptor. + + + :param file: The file of this OneofDescriptor. # noqa: E501 + :type: FileDescriptor + """ + + self._file = file + + @property + def full_name(self): + """Gets the full_name of this OneofDescriptor. # noqa: E501 + + + :return: The full_name of this OneofDescriptor. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this OneofDescriptor. + + + :param full_name: The full_name of this OneofDescriptor. # noqa: E501 + :type: str + """ + + self._full_name = full_name + + @property + def index(self): + """Gets the index of this OneofDescriptor. # noqa: E501 + + + :return: The index of this OneofDescriptor. # noqa: E501 + :rtype: int + """ + return self._index + + @index.setter + def index(self, index): + """Sets the index of this OneofDescriptor. + + + :param index: The index of this OneofDescriptor. # noqa: E501 + :type: int + """ + + self._index = index + + @property + def name(self): + """Gets the name of this OneofDescriptor. # noqa: E501 + + + :return: The name of this OneofDescriptor. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OneofDescriptor. + + + :param name: The name of this OneofDescriptor. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def options(self): + """Gets the options of this OneofDescriptor. # noqa: E501 + + + :return: The options of this OneofDescriptor. # noqa: E501 + :rtype: OneofOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this OneofDescriptor. + + + :param options: The options of this OneofDescriptor. # noqa: E501 + :type: OneofOptions + """ + + self._options = options + + @property + def proto(self): + """Gets the proto of this OneofDescriptor. # noqa: E501 + + + :return: The proto of this OneofDescriptor. # noqa: E501 + :rtype: OneofDescriptorProto + """ + return self._proto + + @proto.setter + def proto(self, proto): + """Sets the proto of this OneofDescriptor. + + + :param proto: The proto of this OneofDescriptor. # noqa: E501 + :type: OneofDescriptorProto + """ + + self._proto = proto + + @property + def synthetic(self): + """Gets the synthetic of this OneofDescriptor. # noqa: E501 + + + :return: The synthetic of this OneofDescriptor. # noqa: E501 + :rtype: bool + """ + return self._synthetic + + @synthetic.setter + def synthetic(self, synthetic): + """Sets the synthetic of this OneofDescriptor. + + + :param synthetic: The synthetic of this OneofDescriptor. # noqa: E501 + :type: bool + """ + + self._synthetic = synthetic + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OneofDescriptor, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OneofDescriptor): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/oneof_descriptor_proto.py b/src/conductor/client/codegen/models/oneof_descriptor_proto.py new file mode 100644 index 00000000..642d9bcb --- /dev/null +++ b/src/conductor/client/codegen/models/oneof_descriptor_proto.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OneofDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'OneofDescriptorProto', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'name': 'str', + 'name_bytes': 'ByteString', + 'options': 'OneofOptions', + 'options_or_builder': 'OneofOptionsOrBuilder', + 'parser_for_type': 'ParserOneofDescriptorProto', + 'serialized_size': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, name=None, name_bytes=None, options=None, options_or_builder=None, parser_for_type=None, serialized_size=None, unknown_fields=None): # noqa: E501 + """OneofDescriptorProto - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._name = None + self._name_bytes = None + self._options = None + self._options_or_builder = None + self._parser_for_type = None + self._serialized_size = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this OneofDescriptorProto. # noqa: E501 + + + :return: The all_fields of this OneofDescriptorProto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this OneofDescriptorProto. + + + :param all_fields: The all_fields of this OneofDescriptorProto. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this OneofDescriptorProto. # noqa: E501 + + + :return: The default_instance_for_type of this OneofDescriptorProto. # noqa: E501 + :rtype: OneofDescriptorProto + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this OneofDescriptorProto. + + + :param default_instance_for_type: The default_instance_for_type of this OneofDescriptorProto. # noqa: E501 + :type: OneofDescriptorProto + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this OneofDescriptorProto. # noqa: E501 + + + :return: The descriptor_for_type of this OneofDescriptorProto. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this OneofDescriptorProto. + + + :param descriptor_for_type: The descriptor_for_type of this OneofDescriptorProto. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this OneofDescriptorProto. # noqa: E501 + + + :return: The initialization_error_string of this OneofDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this OneofDescriptorProto. + + + :param initialization_error_string: The initialization_error_string of this OneofDescriptorProto. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this OneofDescriptorProto. # noqa: E501 + + + :return: The initialized of this OneofDescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this OneofDescriptorProto. + + + :param initialized: The initialized of this OneofDescriptorProto. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this OneofDescriptorProto. # noqa: E501 + + + :return: The memoized_serialized_size of this OneofDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this OneofDescriptorProto. + + + :param memoized_serialized_size: The memoized_serialized_size of this OneofDescriptorProto. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def name(self): + """Gets the name of this OneofDescriptorProto. # noqa: E501 + + + :return: The name of this OneofDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OneofDescriptorProto. + + + :param name: The name of this OneofDescriptorProto. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this OneofDescriptorProto. # noqa: E501 + + + :return: The name_bytes of this OneofDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this OneofDescriptorProto. + + + :param name_bytes: The name_bytes of this OneofDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def options(self): + """Gets the options of this OneofDescriptorProto. # noqa: E501 + + + :return: The options of this OneofDescriptorProto. # noqa: E501 + :rtype: OneofOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this OneofDescriptorProto. + + + :param options: The options of this OneofDescriptorProto. # noqa: E501 + :type: OneofOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this OneofDescriptorProto. # noqa: E501 + + + :return: The options_or_builder of this OneofDescriptorProto. # noqa: E501 + :rtype: OneofOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this OneofDescriptorProto. + + + :param options_or_builder: The options_or_builder of this OneofDescriptorProto. # noqa: E501 + :type: OneofOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def parser_for_type(self): + """Gets the parser_for_type of this OneofDescriptorProto. # noqa: E501 + + + :return: The parser_for_type of this OneofDescriptorProto. # noqa: E501 + :rtype: ParserOneofDescriptorProto + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this OneofDescriptorProto. + + + :param parser_for_type: The parser_for_type of this OneofDescriptorProto. # noqa: E501 + :type: ParserOneofDescriptorProto + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this OneofDescriptorProto. # noqa: E501 + + + :return: The serialized_size of this OneofDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this OneofDescriptorProto. + + + :param serialized_size: The serialized_size of this OneofDescriptorProto. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def unknown_fields(self): + """Gets the unknown_fields of this OneofDescriptorProto. # noqa: E501 + + + :return: The unknown_fields of this OneofDescriptorProto. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this OneofDescriptorProto. + + + :param unknown_fields: The unknown_fields of this OneofDescriptorProto. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OneofDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OneofDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/oneof_descriptor_proto_or_builder.py b/src/conductor/client/codegen/models/oneof_descriptor_proto_or_builder.py new file mode 100644 index 00000000..98213768 --- /dev/null +++ b/src/conductor/client/codegen/models/oneof_descriptor_proto_or_builder.py @@ -0,0 +1,344 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OneofDescriptorProtoOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'name': 'str', + 'name_bytes': 'ByteString', + 'options': 'OneofOptions', + 'options_or_builder': 'OneofOptionsOrBuilder', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, name=None, name_bytes=None, options=None, options_or_builder=None, unknown_fields=None): # noqa: E501 + """OneofDescriptorProtoOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._name = None + self._name_bytes = None + self._options = None + self._options_or_builder = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this OneofDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The all_fields of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this OneofDescriptorProtoOrBuilder. + + + :param all_fields: The all_fields of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this OneofDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this OneofDescriptorProtoOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this OneofDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this OneofDescriptorProtoOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this OneofDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this OneofDescriptorProtoOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this OneofDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialized of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this OneofDescriptorProtoOrBuilder. + + + :param initialized: The initialized of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def name(self): + """Gets the name of this OneofDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OneofDescriptorProtoOrBuilder. + + + :param name: The name of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this OneofDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name_bytes of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this OneofDescriptorProtoOrBuilder. + + + :param name_bytes: The name_bytes of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def options(self): + """Gets the options of this OneofDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :rtype: OneofOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this OneofDescriptorProtoOrBuilder. + + + :param options: The options of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :type: OneofOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this OneofDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options_or_builder of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :rtype: OneofOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this OneofDescriptorProtoOrBuilder. + + + :param options_or_builder: The options_or_builder of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :type: OneofOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def unknown_fields(self): + """Gets the unknown_fields of this OneofDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this OneofDescriptorProtoOrBuilder. + + + :param unknown_fields: The unknown_fields of this OneofDescriptorProtoOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OneofDescriptorProtoOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OneofDescriptorProtoOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/oneof_options.py b/src/conductor/client/codegen/models/oneof_options.py new file mode 100644 index 00000000..9570a6d5 --- /dev/null +++ b/src/conductor/client/codegen/models/oneof_options.py @@ -0,0 +1,474 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OneofOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'all_fields_raw': 'dict(str, object)', + 'default_instance_for_type': 'OneofOptions', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserOneofOptions', + 'serialized_size': 'int', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'all_fields_raw': 'allFieldsRaw', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, all_fields_raw=None, default_instance_for_type=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """OneofOptions - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._all_fields_raw = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if all_fields_raw is not None: + self.all_fields_raw = all_fields_raw + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this OneofOptions. # noqa: E501 + + + :return: The all_fields of this OneofOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this OneofOptions. + + + :param all_fields: The all_fields of this OneofOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def all_fields_raw(self): + """Gets the all_fields_raw of this OneofOptions. # noqa: E501 + + + :return: The all_fields_raw of this OneofOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields_raw + + @all_fields_raw.setter + def all_fields_raw(self, all_fields_raw): + """Sets the all_fields_raw of this OneofOptions. + + + :param all_fields_raw: The all_fields_raw of this OneofOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields_raw = all_fields_raw + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this OneofOptions. # noqa: E501 + + + :return: The default_instance_for_type of this OneofOptions. # noqa: E501 + :rtype: OneofOptions + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this OneofOptions. + + + :param default_instance_for_type: The default_instance_for_type of this OneofOptions. # noqa: E501 + :type: OneofOptions + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this OneofOptions. # noqa: E501 + + + :return: The descriptor_for_type of this OneofOptions. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this OneofOptions. + + + :param descriptor_for_type: The descriptor_for_type of this OneofOptions. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this OneofOptions. # noqa: E501 + + + :return: The features of this OneofOptions. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this OneofOptions. + + + :param features: The features of this OneofOptions. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this OneofOptions. # noqa: E501 + + + :return: The features_or_builder of this OneofOptions. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this OneofOptions. + + + :param features_or_builder: The features_or_builder of this OneofOptions. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this OneofOptions. # noqa: E501 + + + :return: The initialization_error_string of this OneofOptions. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this OneofOptions. + + + :param initialization_error_string: The initialization_error_string of this OneofOptions. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this OneofOptions. # noqa: E501 + + + :return: The initialized of this OneofOptions. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this OneofOptions. + + + :param initialized: The initialized of this OneofOptions. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this OneofOptions. # noqa: E501 + + + :return: The memoized_serialized_size of this OneofOptions. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this OneofOptions. + + + :param memoized_serialized_size: The memoized_serialized_size of this OneofOptions. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this OneofOptions. # noqa: E501 + + + :return: The parser_for_type of this OneofOptions. # noqa: E501 + :rtype: ParserOneofOptions + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this OneofOptions. + + + :param parser_for_type: The parser_for_type of this OneofOptions. # noqa: E501 + :type: ParserOneofOptions + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this OneofOptions. # noqa: E501 + + + :return: The serialized_size of this OneofOptions. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this OneofOptions. + + + :param serialized_size: The serialized_size of this OneofOptions. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this OneofOptions. # noqa: E501 + + + :return: The uninterpreted_option_count of this OneofOptions. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this OneofOptions. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this OneofOptions. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this OneofOptions. # noqa: E501 + + + :return: The uninterpreted_option_list of this OneofOptions. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this OneofOptions. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this OneofOptions. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this OneofOptions. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this OneofOptions. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this OneofOptions. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this OneofOptions. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this OneofOptions. # noqa: E501 + + + :return: The unknown_fields of this OneofOptions. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this OneofOptions. + + + :param unknown_fields: The unknown_fields of this OneofOptions. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OneofOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OneofOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/oneof_options_or_builder.py b/src/conductor/client/codegen/models/oneof_options_or_builder.py new file mode 100644 index 00000000..faafaafd --- /dev/null +++ b/src/conductor/client/codegen/models/oneof_options_or_builder.py @@ -0,0 +1,370 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OneofOptionsOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """OneofOptionsOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The all_fields of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this OneofOptionsOrBuilder. + + + :param all_fields: The all_fields of this OneofOptionsOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this OneofOptionsOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this OneofOptionsOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this OneofOptionsOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this OneofOptionsOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The features of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this OneofOptionsOrBuilder. + + + :param features: The features of this OneofOptionsOrBuilder. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The features_or_builder of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this OneofOptionsOrBuilder. + + + :param features_or_builder: The features_or_builder of this OneofOptionsOrBuilder. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this OneofOptionsOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this OneofOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The initialized of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this OneofOptionsOrBuilder. + + + :param initialized: The initialized of this OneofOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_count of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this OneofOptionsOrBuilder. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this OneofOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_list of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this OneofOptionsOrBuilder. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this OneofOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this OneofOptionsOrBuilder. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this OneofOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this OneofOptionsOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this OneofOptionsOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this OneofOptionsOrBuilder. + + + :param unknown_fields: The unknown_fields of this OneofOptionsOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OneofOptionsOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OneofOptionsOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/option.py b/src/conductor/client/codegen/models/option.py new file mode 100644 index 00000000..04e1500c --- /dev/null +++ b/src/conductor/client/codegen/models/option.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Option(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'label': 'str', + 'value': 'str' + } + + attribute_map = { + 'label': 'label', + 'value': 'value' + } + + def __init__(self, label=None, value=None): # noqa: E501 + """Option - a model defined in Swagger""" # noqa: E501 + self._label = None + self._value = None + self.discriminator = None + if label is not None: + self.label = label + if value is not None: + self.value = value + + @property + def label(self): + """Gets the label of this Option. # noqa: E501 + + + :return: The label of this Option. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this Option. + + + :param label: The label of this Option. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def value(self): + """Gets the value of this Option. # noqa: E501 + + + :return: The value of this Option. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this Option. + + + :param value: The value of this Option. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Option, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Option): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser.py b/src/conductor/client/codegen/models/parser.py new file mode 100644 index 00000000..27a47d11 --- /dev/null +++ b/src/conductor/client/codegen/models/parser.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Parser(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """Parser - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Parser, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Parser): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_any.py b/src/conductor/client/codegen/models/parser_any.py new file mode 100644 index 00000000..a7a6c803 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_any.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserAny(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserAny - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserAny, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserAny): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_declaration.py b/src/conductor/client/codegen/models/parser_declaration.py new file mode 100644 index 00000000..263ac525 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_declaration.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserDeclaration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserDeclaration - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserDeclaration, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserDeclaration): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_descriptor_proto.py b/src/conductor/client/codegen/models/parser_descriptor_proto.py new file mode 100644 index 00000000..5c03c831 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_descriptor_proto.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserDescriptorProto - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_edition_default.py b/src/conductor/client/codegen/models/parser_edition_default.py new file mode 100644 index 00000000..3f890a63 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_edition_default.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserEditionDefault(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserEditionDefault - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserEditionDefault, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserEditionDefault): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_enum_descriptor_proto.py b/src/conductor/client/codegen/models/parser_enum_descriptor_proto.py new file mode 100644 index 00000000..c4923285 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_enum_descriptor_proto.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserEnumDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserEnumDescriptorProto - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserEnumDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserEnumDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_enum_options.py b/src/conductor/client/codegen/models/parser_enum_options.py new file mode 100644 index 00000000..b463ef4d --- /dev/null +++ b/src/conductor/client/codegen/models/parser_enum_options.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserEnumOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserEnumOptions - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserEnumOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserEnumOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_enum_reserved_range.py b/src/conductor/client/codegen/models/parser_enum_reserved_range.py new file mode 100644 index 00000000..8bd91a6a --- /dev/null +++ b/src/conductor/client/codegen/models/parser_enum_reserved_range.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserEnumReservedRange(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserEnumReservedRange - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserEnumReservedRange, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserEnumReservedRange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_enum_value_descriptor_proto.py b/src/conductor/client/codegen/models/parser_enum_value_descriptor_proto.py new file mode 100644 index 00000000..efaaafee --- /dev/null +++ b/src/conductor/client/codegen/models/parser_enum_value_descriptor_proto.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserEnumValueDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserEnumValueDescriptorProto - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserEnumValueDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserEnumValueDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_enum_value_options.py b/src/conductor/client/codegen/models/parser_enum_value_options.py new file mode 100644 index 00000000..0a2da923 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_enum_value_options.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserEnumValueOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserEnumValueOptions - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserEnumValueOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserEnumValueOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_extension_range.py b/src/conductor/client/codegen/models/parser_extension_range.py new file mode 100644 index 00000000..59670f2e --- /dev/null +++ b/src/conductor/client/codegen/models/parser_extension_range.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserExtensionRange(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserExtensionRange - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserExtensionRange, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserExtensionRange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_extension_range_options.py b/src/conductor/client/codegen/models/parser_extension_range_options.py new file mode 100644 index 00000000..0a81f293 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_extension_range_options.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserExtensionRangeOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserExtensionRangeOptions - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserExtensionRangeOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserExtensionRangeOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_feature_set.py b/src/conductor/client/codegen/models/parser_feature_set.py new file mode 100644 index 00000000..ba784dbc --- /dev/null +++ b/src/conductor/client/codegen/models/parser_feature_set.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserFeatureSet(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserFeatureSet - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserFeatureSet, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserFeatureSet): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_field_descriptor_proto.py b/src/conductor/client/codegen/models/parser_field_descriptor_proto.py new file mode 100644 index 00000000..cd17d165 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_field_descriptor_proto.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserFieldDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserFieldDescriptorProto - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserFieldDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserFieldDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_field_options.py b/src/conductor/client/codegen/models/parser_field_options.py new file mode 100644 index 00000000..c0e4c8b7 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_field_options.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserFieldOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserFieldOptions - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserFieldOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserFieldOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_file_descriptor_proto.py b/src/conductor/client/codegen/models/parser_file_descriptor_proto.py new file mode 100644 index 00000000..983c7fc1 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_file_descriptor_proto.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserFileDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserFileDescriptorProto - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserFileDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserFileDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_file_options.py b/src/conductor/client/codegen/models/parser_file_options.py new file mode 100644 index 00000000..b3adfc50 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_file_options.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserFileOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserFileOptions - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserFileOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserFileOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_location.py b/src/conductor/client/codegen/models/parser_location.py new file mode 100644 index 00000000..ef642f65 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_location.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserLocation(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserLocation - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserLocation, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserLocation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_message.py b/src/conductor/client/codegen/models/parser_message.py new file mode 100644 index 00000000..0f67307b --- /dev/null +++ b/src/conductor/client/codegen/models/parser_message.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserMessage(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserMessage - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserMessage, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserMessage): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_message_lite.py b/src/conductor/client/codegen/models/parser_message_lite.py new file mode 100644 index 00000000..26792bca --- /dev/null +++ b/src/conductor/client/codegen/models/parser_message_lite.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserMessageLite(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserMessageLite - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserMessageLite, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserMessageLite): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_message_options.py b/src/conductor/client/codegen/models/parser_message_options.py new file mode 100644 index 00000000..4bcafc9a --- /dev/null +++ b/src/conductor/client/codegen/models/parser_message_options.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserMessageOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserMessageOptions - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserMessageOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserMessageOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_method_descriptor_proto.py b/src/conductor/client/codegen/models/parser_method_descriptor_proto.py new file mode 100644 index 00000000..3bc0e768 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_method_descriptor_proto.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserMethodDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserMethodDescriptorProto - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserMethodDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserMethodDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_method_options.py b/src/conductor/client/codegen/models/parser_method_options.py new file mode 100644 index 00000000..74661080 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_method_options.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserMethodOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserMethodOptions - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserMethodOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserMethodOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_name_part.py b/src/conductor/client/codegen/models/parser_name_part.py new file mode 100644 index 00000000..dd70ba82 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_name_part.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserNamePart(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserNamePart - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserNamePart, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserNamePart): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_oneof_descriptor_proto.py b/src/conductor/client/codegen/models/parser_oneof_descriptor_proto.py new file mode 100644 index 00000000..0b155fd0 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_oneof_descriptor_proto.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserOneofDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserOneofDescriptorProto - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserOneofDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserOneofDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_oneof_options.py b/src/conductor/client/codegen/models/parser_oneof_options.py new file mode 100644 index 00000000..dd34b83c --- /dev/null +++ b/src/conductor/client/codegen/models/parser_oneof_options.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserOneofOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserOneofOptions - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserOneofOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserOneofOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_reserved_range.py b/src/conductor/client/codegen/models/parser_reserved_range.py new file mode 100644 index 00000000..9892dcb1 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_reserved_range.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserReservedRange(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserReservedRange - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserReservedRange, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserReservedRange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_service_descriptor_proto.py b/src/conductor/client/codegen/models/parser_service_descriptor_proto.py new file mode 100644 index 00000000..420604a6 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_service_descriptor_proto.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserServiceDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserServiceDescriptorProto - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserServiceDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserServiceDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_service_options.py b/src/conductor/client/codegen/models/parser_service_options.py new file mode 100644 index 00000000..71955879 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_service_options.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserServiceOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserServiceOptions - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserServiceOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserServiceOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_source_code_info.py b/src/conductor/client/codegen/models/parser_source_code_info.py new file mode 100644 index 00000000..76c9ff3e --- /dev/null +++ b/src/conductor/client/codegen/models/parser_source_code_info.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserSourceCodeInfo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserSourceCodeInfo - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserSourceCodeInfo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserSourceCodeInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/parser_uninterpreted_option.py b/src/conductor/client/codegen/models/parser_uninterpreted_option.py new file mode 100644 index 00000000..45a79ae4 --- /dev/null +++ b/src/conductor/client/codegen/models/parser_uninterpreted_option.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParserUninterpretedOption(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ParserUninterpretedOption - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ParserUninterpretedOption, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ParserUninterpretedOption): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/permission.py b/src/conductor/client/codegen/models/permission.py new file mode 100644 index 00000000..843de160 --- /dev/null +++ b/src/conductor/client/codegen/models/permission.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Permission(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """Permission - a model defined in Swagger""" # noqa: E501 + self._name = None + self.discriminator = None + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this Permission. # noqa: E501 + + + :return: The name of this Permission. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Permission. + + + :param name: The name of this Permission. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Permission, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Permission): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/poll_data.py b/src/conductor/client/codegen/models/poll_data.py new file mode 100644 index 00000000..cfe095fb --- /dev/null +++ b/src/conductor/client/codegen/models/poll_data.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PollData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'domain': 'str', + 'last_poll_time': 'int', + 'queue_name': 'str', + 'worker_id': 'str' + } + + attribute_map = { + 'domain': 'domain', + 'last_poll_time': 'lastPollTime', + 'queue_name': 'queueName', + 'worker_id': 'workerId' + } + + def __init__(self, domain=None, last_poll_time=None, queue_name=None, worker_id=None): # noqa: E501 + """PollData - a model defined in Swagger""" # noqa: E501 + self._domain = None + self._last_poll_time = None + self._queue_name = None + self._worker_id = None + self.discriminator = None + if domain is not None: + self.domain = domain + if last_poll_time is not None: + self.last_poll_time = last_poll_time + if queue_name is not None: + self.queue_name = queue_name + if worker_id is not None: + self.worker_id = worker_id + + @property + def domain(self): + """Gets the domain of this PollData. # noqa: E501 + + + :return: The domain of this PollData. # noqa: E501 + :rtype: str + """ + return self._domain + + @domain.setter + def domain(self, domain): + """Sets the domain of this PollData. + + + :param domain: The domain of this PollData. # noqa: E501 + :type: str + """ + + self._domain = domain + + @property + def last_poll_time(self): + """Gets the last_poll_time of this PollData. # noqa: E501 + + + :return: The last_poll_time of this PollData. # noqa: E501 + :rtype: int + """ + return self._last_poll_time + + @last_poll_time.setter + def last_poll_time(self, last_poll_time): + """Sets the last_poll_time of this PollData. + + + :param last_poll_time: The last_poll_time of this PollData. # noqa: E501 + :type: int + """ + + self._last_poll_time = last_poll_time + + @property + def queue_name(self): + """Gets the queue_name of this PollData. # noqa: E501 + + + :return: The queue_name of this PollData. # noqa: E501 + :rtype: str + """ + return self._queue_name + + @queue_name.setter + def queue_name(self, queue_name): + """Sets the queue_name of this PollData. + + + :param queue_name: The queue_name of this PollData. # noqa: E501 + :type: str + """ + + self._queue_name = queue_name + + @property + def worker_id(self): + """Gets the worker_id of this PollData. # noqa: E501 + + + :return: The worker_id of this PollData. # noqa: E501 + :rtype: str + """ + return self._worker_id + + @worker_id.setter + def worker_id(self, worker_id): + """Sets the worker_id of this PollData. + + + :param worker_id: The worker_id of this PollData. # noqa: E501 + :type: str + """ + + self._worker_id = worker_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PollData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PollData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/prompt_template.py b/src/conductor/client/codegen/models/prompt_template.py new file mode 100644 index 00000000..120f9c3d --- /dev/null +++ b/src/conductor/client/codegen/models/prompt_template.py @@ -0,0 +1,350 @@ +import pprint +import re # noqa: F401 + +import six + + +class PromptTemplate: + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + "created_by": "str", + "created_on": "int", + "description": "str", + "integrations": "list[str]", + "name": "str", + "tags": "list[TagObject]", + "template": "str", + "updated_by": "str", + "updated_on": "int", + "variables": "list[str]", + } + + attribute_map = { + "created_by": "createdBy", + "created_on": "createdOn", + "description": "description", + "integrations": "integrations", + "name": "name", + "tags": "tags", + "template": "template", + "updated_by": "updatedBy", + "updated_on": "updatedOn", + "variables": "variables", + } + + def __init__( + self, + created_by=None, + created_on=None, + description=None, + integrations=None, + name=None, + tags=None, + template=None, + updated_by=None, + updated_on=None, + variables=None, + ): # noqa: E501 + """PromptTemplate - a model defined in Swagger""" # noqa: E501 + self._created_by = None + self._created_on = None + self._description = None + self._integrations = None + self._name = None + self._tags = None + self._template = None + self._updated_by = None + self._updated_on = None + self._variables = None + self.discriminator = None + if created_by is not None: + self.created_by = created_by + if created_on is not None: + self.created_on = created_on + if description is not None: + self.description = description + if integrations is not None: + self.integrations = integrations + if name is not None: + self.name = name + if tags is not None: + self.tags = tags + if template is not None: + self.template = template + if updated_by is not None: + self.updated_by = updated_by + if updated_on is not None: + self.updated_on = updated_on + if variables is not None: + self.variables = variables + + @property + def created_by(self): + """Gets the created_by of this PromptTemplate. # noqa: E501 + + + :return: The created_by of this PromptTemplate. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this PromptTemplate. + + + :param created_by: The created_by of this PromptTemplate. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def created_on(self): + """Gets the created_on of this PromptTemplate. # noqa: E501 + + + :return: The created_on of this PromptTemplate. # noqa: E501 + :rtype: int + """ + return self._created_on + + @created_on.setter + def created_on(self, created_on): + """Sets the created_on of this PromptTemplate. + + + :param created_on: The created_on of this PromptTemplate. # noqa: E501 + :type: int + """ + + self._created_on = created_on + + @property + def description(self): + """Gets the description of this PromptTemplate. # noqa: E501 + + + :return: The description of this PromptTemplate. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this PromptTemplate. + + + :param description: The description of this PromptTemplate. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def integrations(self): + """Gets the integrations of this PromptTemplate. # noqa: E501 + + + :return: The integrations of this PromptTemplate. # noqa: E501 + :rtype: list[str] + """ + return self._integrations + + @integrations.setter + def integrations(self, integrations): + """Sets the integrations of this PromptTemplate. + + + :param integrations: The integrations of this PromptTemplate. # noqa: E501 + :type: list[str] + """ + + self._integrations = integrations + + @property + def name(self): + """Gets the name of this PromptTemplate. # noqa: E501 + + + :return: The name of this PromptTemplate. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PromptTemplate. + + + :param name: The name of this PromptTemplate. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def tags(self): + """Gets the tags of this PromptTemplate. # noqa: E501 + + + :return: The tags of this PromptTemplate. # noqa: E501 + :rtype: list[TagObject] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this PromptTemplate. + + + :param tags: The tags of this PromptTemplate. # noqa: E501 + :type: list[TagObject] + """ + + self._tags = tags + + @property + def template(self): + """Gets the template of this PromptTemplate. # noqa: E501 + + + :return: The template of this PromptTemplate. # noqa: E501 + :rtype: str + """ + return self._template + + @template.setter + def template(self, template): + """Sets the template of this PromptTemplate. + + + :param template: The template of this PromptTemplate. # noqa: E501 + :type: str + """ + + self._template = template + + @property + def updated_by(self): + """Gets the updated_by of this PromptTemplate. # noqa: E501 + + + :return: The updated_by of this PromptTemplate. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this PromptTemplate. + + + :param updated_by: The updated_by of this PromptTemplate. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + @property + def updated_on(self): + """Gets the updated_on of this PromptTemplate. # noqa: E501 + + + :return: The updated_on of this PromptTemplate. # noqa: E501 + :rtype: int + """ + return self._updated_on + + @updated_on.setter + def updated_on(self, updated_on): + """Sets the updated_on of this PromptTemplate. + + + :param updated_on: The updated_on of this PromptTemplate. # noqa: E501 + :type: int + """ + + self._updated_on = updated_on + + @property + def variables(self): + """Gets the variables of this PromptTemplate. # noqa: E501 + + + :return: The variables of this PromptTemplate. # noqa: E501 + :rtype: list[str] + """ + return self._variables + + @variables.setter + def variables(self, variables): + """Sets the variables of this PromptTemplate. + + + :param variables: The variables of this PromptTemplate. # noqa: E501 + :type: list[str] + """ + + self._variables = variables + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: ( + (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item + ), + value.items(), + ) + ) + else: + result[attr] = value + if issubclass(PromptTemplate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PromptTemplate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/http/models/prompt_test_request.py b/src/conductor/client/codegen/models/prompt_template_test_request.py similarity index 77% rename from src/conductor/client/http/models/prompt_test_request.py rename to src/conductor/client/codegen/models/prompt_template_test_request.py index fa39797b..36c6c581 100644 --- a/src/conductor/client/http/models/prompt_test_request.py +++ b/src/conductor/client/codegen/models/prompt_template_test_request.py @@ -1,13 +1,21 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + import pprint import re # noqa: F401 -import six -from dataclasses import dataclass, field, asdict -from typing import Dict, List, Optional, Any -from dataclasses import InitVar +import six -@dataclass -class PromptTemplateTestRequest: +class PromptTemplateTestRequest(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -19,24 +27,6 @@ class PromptTemplateTestRequest: attribute_map (dict): The key is attribute name and the value is json key in definition. """ - llm_provider: Optional[str] = field(default=None) - model: Optional[str] = field(default=None) - prompt: Optional[str] = field(default=None) - prompt_variables: Optional[Dict[str, Any]] = field(default=None) - stop_words: Optional[List[str]] = field(default=None) - temperature: Optional[float] = field(default=None) - top_p: Optional[float] = field(default=None) - - # Private backing fields for properties - _llm_provider: Optional[str] = field(init=False, repr=False, default=None) - _model: Optional[str] = field(init=False, repr=False, default=None) - _prompt: Optional[str] = field(init=False, repr=False, default=None) - _prompt_variables: Optional[Dict[str, Any]] = field(init=False, repr=False, default=None) - _stop_words: Optional[List[str]] = field(init=False, repr=False, default=None) - _temperature: Optional[float] = field(init=False, repr=False, default=None) - _top_p: Optional[float] = field(init=False, repr=False, default=None) - - # Class variables swagger_types = { 'llm_provider': 'str', 'model': 'str', @@ -46,7 +36,7 @@ class PromptTemplateTestRequest: 'temperature': 'float', 'top_p': 'float' } - + attribute_map = { 'llm_provider': 'llmProvider', 'model': 'model', @@ -56,28 +46,8 @@ class PromptTemplateTestRequest: 'temperature': 'temperature', 'top_p': 'topP' } - - discriminator: None = field(init=False, repr=False, default=None) - - def __post_init__(self): - """Initialize properties after dataclass initialization""" - if self.llm_provider is not None: - self.llm_provider = self.llm_provider - if self.model is not None: - self.model = self.model - if self.prompt is not None: - self.prompt = self.prompt - if self.prompt_variables is not None: - self.prompt_variables = self.prompt_variables - if self.stop_words is not None: - self.stop_words = self.stop_words - if self.temperature is not None: - self.temperature = self.temperature - if self.top_p is not None: - self.top_p = self.top_p - - def __init__(self, llm_provider=None, model=None, prompt=None, prompt_variables=None, stop_words=None, - temperature=None, top_p=None): # noqa: E501 + + def __init__(self, llm_provider=None, model=None, prompt=None, prompt_variables=None, stop_words=None, temperature=None, top_p=None): # noqa: E501 """PromptTemplateTestRequest - a model defined in Swagger""" # noqa: E501 self._llm_provider = None self._model = None @@ -293,4 +263,4 @@ def __eq__(self, other): def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file + return not self == other diff --git a/src/conductor/client/codegen/models/proto_registry_entry.py b/src/conductor/client/codegen/models/proto_registry_entry.py new file mode 100644 index 00000000..f7332152 --- /dev/null +++ b/src/conductor/client/codegen/models/proto_registry_entry.py @@ -0,0 +1,49 @@ +from dataclasses import dataclass +from typing import Optional +import six + + +@dataclass +class ProtoRegistryEntry: + """Protocol buffer registry entry for storing service definitions.""" + + swagger_types = { + 'service_name': 'str', + 'filename': 'str', + 'data': 'bytes' + } + + attribute_map = { + 'service_name': 'serviceName', + 'filename': 'filename', + 'data': 'data' + } + + service_name: str + filename: str + data: bytes + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + return result + + def __str__(self): + return f"ProtoRegistryEntry(service_name='{self.service_name}', filename='{self.filename}', data_size={len(self.data)})" \ No newline at end of file diff --git a/src/conductor/client/codegen/models/rate_limit.py b/src/conductor/client/codegen/models/rate_limit.py new file mode 100644 index 00000000..5ccadddf --- /dev/null +++ b/src/conductor/client/codegen/models/rate_limit.py @@ -0,0 +1,194 @@ +import pprint +import re # noqa: F401 +import six +from dataclasses import dataclass, field, asdict +from typing import Optional +from deprecated import deprecated + +@dataclass +class RateLimit: + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + _rate_limit_key: Optional[str] = field(default=None, init=False) + _concurrent_exec_limit: Optional[int] = field(default=None, init=False) + _tag: Optional[str] = field(default=None, init=False) + _concurrent_execution_limit: Optional[int] = field(default=None, init=False) + + swagger_types = { + 'rate_limit_key': 'str', + 'concurrent_exec_limit': 'int', + 'tag': 'str', + 'concurrent_execution_limit': 'int' + } + + attribute_map = { + 'rate_limit_key': 'rateLimitKey', + 'concurrent_exec_limit': 'concurrentExecLimit', + 'tag': 'tag', + 'concurrent_execution_limit': 'concurrentExecutionLimit' + } + + def __init__(self, tag=None, concurrent_execution_limit=None, rate_limit_key=None, concurrent_exec_limit=None): # noqa: E501 + """RateLimit - a model defined in Swagger""" # noqa: E501 + self._tag = None + self._concurrent_execution_limit = None + self._rate_limit_key = None + self._concurrent_exec_limit = None + self.discriminator = None + if tag is not None: + self.tag = tag + if concurrent_execution_limit is not None: + self.concurrent_execution_limit = concurrent_execution_limit + if rate_limit_key is not None: + self.rate_limit_key = rate_limit_key + if concurrent_exec_limit is not None: + self.concurrent_exec_limit = concurrent_exec_limit + + def __post_init__(self): + """Post initialization for dataclass""" + pass + + @property + def rate_limit_key(self): + """Gets the rate_limit_key of this RateLimit. # noqa: E501 + + Key that defines the rate limit. Rate limit key is a combination of workflow payload such as + name, or correlationId etc. + + :return: The rate_limit_key of this RateLimit. # noqa: E501 + :rtype: str + """ + return self._rate_limit_key + + @rate_limit_key.setter + def rate_limit_key(self, rate_limit_key): + """Sets the rate_limit_key of this RateLimit. + + Key that defines the rate limit. Rate limit key is a combination of workflow payload such as + name, or correlationId etc. + + :param rate_limit_key: The rate_limit_key of this RateLimit. # noqa: E501 + :type: str + """ + self._rate_limit_key = rate_limit_key + + @property + def concurrent_exec_limit(self): + """Gets the concurrent_exec_limit of this RateLimit. # noqa: E501 + + Number of concurrently running workflows that are allowed per key + + :return: The concurrent_exec_limit of this RateLimit. # noqa: E501 + :rtype: int + """ + return self._concurrent_exec_limit + + @concurrent_exec_limit.setter + def concurrent_exec_limit(self, concurrent_exec_limit): + """Sets the concurrent_exec_limit of this RateLimit. + + Number of concurrently running workflows that are allowed per key + + :param concurrent_exec_limit: The concurrent_exec_limit of this RateLimit. # noqa: E501 + :type: int + """ + self._concurrent_exec_limit = concurrent_exec_limit + + @property + @deprecated(reason="Use rate_limit_key instead") + def tag(self): + """Gets the tag of this RateLimit. # noqa: E501 + + + :return: The tag of this RateLimit. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + @deprecated(reason="Use rate_limit_key instead") + def tag(self, tag): + """Sets the tag of this RateLimit. + + + :param tag: The tag of this RateLimit. # noqa: E501 + :type: str + """ + self._tag = tag + + @property + @deprecated(reason="Use concurrent_exec_limit instead") + def concurrent_execution_limit(self): + """Gets the concurrent_execution_limit of this RateLimit. # noqa: E501 + + + :return: The concurrent_execution_limit of this RateLimit. # noqa: E501 + :rtype: int + """ + return self._concurrent_execution_limit + + @concurrent_execution_limit.setter + @deprecated(reason="Use concurrent_exec_limit instead") + def concurrent_execution_limit(self, concurrent_execution_limit): + """Sets the concurrent_execution_limit of this RateLimit. + + + :param concurrent_execution_limit: The concurrent_execution_limit of this RateLimit. # noqa: E501 + :type: int + """ + self._concurrent_execution_limit = concurrent_execution_limit + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(RateLimit, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RateLimit): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/rate_limit_config.py b/src/conductor/client/codegen/models/rate_limit_config.py new file mode 100644 index 00000000..f7626b11 --- /dev/null +++ b/src/conductor/client/codegen/models/rate_limit_config.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class RateLimitConfig(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'concurrent_exec_limit': 'int', + 'rate_limit_key': 'str' + } + + attribute_map = { + 'concurrent_exec_limit': 'concurrentExecLimit', + 'rate_limit_key': 'rateLimitKey' + } + + def __init__(self, concurrent_exec_limit=None, rate_limit_key=None): # noqa: E501 + """RateLimitConfig - a model defined in Swagger""" # noqa: E501 + self._concurrent_exec_limit = None + self._rate_limit_key = None + self.discriminator = None + if concurrent_exec_limit is not None: + self.concurrent_exec_limit = concurrent_exec_limit + if rate_limit_key is not None: + self.rate_limit_key = rate_limit_key + + @property + def concurrent_exec_limit(self): + """Gets the concurrent_exec_limit of this RateLimitConfig. # noqa: E501 + + + :return: The concurrent_exec_limit of this RateLimitConfig. # noqa: E501 + :rtype: int + """ + return self._concurrent_exec_limit + + @concurrent_exec_limit.setter + def concurrent_exec_limit(self, concurrent_exec_limit): + """Sets the concurrent_exec_limit of this RateLimitConfig. + + + :param concurrent_exec_limit: The concurrent_exec_limit of this RateLimitConfig. # noqa: E501 + :type: int + """ + + self._concurrent_exec_limit = concurrent_exec_limit + + @property + def rate_limit_key(self): + """Gets the rate_limit_key of this RateLimitConfig. # noqa: E501 + + + :return: The rate_limit_key of this RateLimitConfig. # noqa: E501 + :rtype: str + """ + return self._rate_limit_key + + @rate_limit_key.setter + def rate_limit_key(self, rate_limit_key): + """Sets the rate_limit_key of this RateLimitConfig. + + + :param rate_limit_key: The rate_limit_key of this RateLimitConfig. # noqa: E501 + :type: str + """ + + self._rate_limit_key = rate_limit_key + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(RateLimitConfig, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RateLimitConfig): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/request_param.py b/src/conductor/client/codegen/models/request_param.py new file mode 100644 index 00000000..00ba9d9b --- /dev/null +++ b/src/conductor/client/codegen/models/request_param.py @@ -0,0 +1,98 @@ +from dataclasses import dataclass +from typing import Optional, Any +import six + + +@dataclass +class Schema: + """Schema definition for request parameters.""" + + swagger_types = { + 'type': 'str', + 'format': 'str', + 'default_value': 'object' + } + + attribute_map = { + 'type': 'type', + 'format': 'format', + 'default_value': 'defaultValue' + } + + type: Optional[str] = None + format: Optional[str] = None + default_value: Optional[Any] = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + return result + + def __str__(self): + return f"Schema(type='{self.type}', format='{self.format}', default_value={self.default_value})" + + +@dataclass +class RequestParam: + """Request parameter model for API endpoints.""" + + swagger_types = { + 'name': 'str', + 'type': 'str', + 'required': 'bool', + 'schema': 'Schema' + } + + attribute_map = { + 'name': 'name', + 'type': 'type', + 'required': 'required', + 'schema': 'schema' + } + + name: Optional[str] = None + type: Optional[str] = None # Query, Header, Path, etc. + required: bool = False + schema: Optional[Schema] = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + return result + + def __str__(self): + return f"RequestParam(name='{self.name}', type='{self.type}', required={self.required})" \ No newline at end of file diff --git a/src/conductor/client/codegen/models/rerun_workflow_request.py b/src/conductor/client/codegen/models/rerun_workflow_request.py new file mode 100644 index 00000000..82249e43 --- /dev/null +++ b/src/conductor/client/codegen/models/rerun_workflow_request.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class RerunWorkflowRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'correlation_id': 'str', + 're_run_from_task_id': 'str', + 're_run_from_workflow_id': 'str', + 'task_input': 'dict(str, object)', + 'workflow_input': 'dict(str, object)' + } + + attribute_map = { + 'correlation_id': 'correlationId', + 're_run_from_task_id': 'reRunFromTaskId', + 're_run_from_workflow_id': 'reRunFromWorkflowId', + 'task_input': 'taskInput', + 'workflow_input': 'workflowInput' + } + + def __init__(self, correlation_id=None, re_run_from_task_id=None, re_run_from_workflow_id=None, task_input=None, workflow_input=None): # noqa: E501 + """RerunWorkflowRequest - a model defined in Swagger""" # noqa: E501 + self._correlation_id = None + self._re_run_from_task_id = None + self._re_run_from_workflow_id = None + self._task_input = None + self._workflow_input = None + self.discriminator = None + if correlation_id is not None: + self.correlation_id = correlation_id + if re_run_from_task_id is not None: + self.re_run_from_task_id = re_run_from_task_id + if re_run_from_workflow_id is not None: + self.re_run_from_workflow_id = re_run_from_workflow_id + if task_input is not None: + self.task_input = task_input + if workflow_input is not None: + self.workflow_input = workflow_input + + @property + def correlation_id(self): + """Gets the correlation_id of this RerunWorkflowRequest. # noqa: E501 + + + :return: The correlation_id of this RerunWorkflowRequest. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this RerunWorkflowRequest. + + + :param correlation_id: The correlation_id of this RerunWorkflowRequest. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def re_run_from_task_id(self): + """Gets the re_run_from_task_id of this RerunWorkflowRequest. # noqa: E501 + + + :return: The re_run_from_task_id of this RerunWorkflowRequest. # noqa: E501 + :rtype: str + """ + return self._re_run_from_task_id + + @re_run_from_task_id.setter + def re_run_from_task_id(self, re_run_from_task_id): + """Sets the re_run_from_task_id of this RerunWorkflowRequest. + + + :param re_run_from_task_id: The re_run_from_task_id of this RerunWorkflowRequest. # noqa: E501 + :type: str + """ + + self._re_run_from_task_id = re_run_from_task_id + + @property + def re_run_from_workflow_id(self): + """Gets the re_run_from_workflow_id of this RerunWorkflowRequest. # noqa: E501 + + + :return: The re_run_from_workflow_id of this RerunWorkflowRequest. # noqa: E501 + :rtype: str + """ + return self._re_run_from_workflow_id + + @re_run_from_workflow_id.setter + def re_run_from_workflow_id(self, re_run_from_workflow_id): + """Sets the re_run_from_workflow_id of this RerunWorkflowRequest. + + + :param re_run_from_workflow_id: The re_run_from_workflow_id of this RerunWorkflowRequest. # noqa: E501 + :type: str + """ + + self._re_run_from_workflow_id = re_run_from_workflow_id + + @property + def task_input(self): + """Gets the task_input of this RerunWorkflowRequest. # noqa: E501 + + + :return: The task_input of this RerunWorkflowRequest. # noqa: E501 + :rtype: dict(str, object) + """ + return self._task_input + + @task_input.setter + def task_input(self, task_input): + """Sets the task_input of this RerunWorkflowRequest. + + + :param task_input: The task_input of this RerunWorkflowRequest. # noqa: E501 + :type: dict(str, object) + """ + + self._task_input = task_input + + @property + def workflow_input(self): + """Gets the workflow_input of this RerunWorkflowRequest. # noqa: E501 + + + :return: The workflow_input of this RerunWorkflowRequest. # noqa: E501 + :rtype: dict(str, object) + """ + return self._workflow_input + + @workflow_input.setter + def workflow_input(self, workflow_input): + """Sets the workflow_input of this RerunWorkflowRequest. + + + :param workflow_input: The workflow_input of this RerunWorkflowRequest. # noqa: E501 + :type: dict(str, object) + """ + + self._workflow_input = workflow_input + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(RerunWorkflowRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RerunWorkflowRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/reserved_range.py b/src/conductor/client/codegen/models/reserved_range.py new file mode 100644 index 00000000..52e95844 --- /dev/null +++ b/src/conductor/client/codegen/models/reserved_range.py @@ -0,0 +1,370 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ReservedRange(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'ReservedRange', + 'descriptor_for_type': 'Descriptor', + 'end': 'int', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserReservedRange', + 'serialized_size': 'int', + 'start': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'end': 'end', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'start': 'start', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, end=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, start=None, unknown_fields=None): # noqa: E501 + """ReservedRange - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._end = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._start = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if end is not None: + self.end = end + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if start is not None: + self.start = start + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this ReservedRange. # noqa: E501 + + + :return: The all_fields of this ReservedRange. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this ReservedRange. + + + :param all_fields: The all_fields of this ReservedRange. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this ReservedRange. # noqa: E501 + + + :return: The default_instance_for_type of this ReservedRange. # noqa: E501 + :rtype: ReservedRange + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this ReservedRange. + + + :param default_instance_for_type: The default_instance_for_type of this ReservedRange. # noqa: E501 + :type: ReservedRange + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this ReservedRange. # noqa: E501 + + + :return: The descriptor_for_type of this ReservedRange. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this ReservedRange. + + + :param descriptor_for_type: The descriptor_for_type of this ReservedRange. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def end(self): + """Gets the end of this ReservedRange. # noqa: E501 + + + :return: The end of this ReservedRange. # noqa: E501 + :rtype: int + """ + return self._end + + @end.setter + def end(self, end): + """Sets the end of this ReservedRange. + + + :param end: The end of this ReservedRange. # noqa: E501 + :type: int + """ + + self._end = end + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this ReservedRange. # noqa: E501 + + + :return: The initialization_error_string of this ReservedRange. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this ReservedRange. + + + :param initialization_error_string: The initialization_error_string of this ReservedRange. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this ReservedRange. # noqa: E501 + + + :return: The initialized of this ReservedRange. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this ReservedRange. + + + :param initialized: The initialized of this ReservedRange. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this ReservedRange. # noqa: E501 + + + :return: The memoized_serialized_size of this ReservedRange. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this ReservedRange. + + + :param memoized_serialized_size: The memoized_serialized_size of this ReservedRange. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this ReservedRange. # noqa: E501 + + + :return: The parser_for_type of this ReservedRange. # noqa: E501 + :rtype: ParserReservedRange + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this ReservedRange. + + + :param parser_for_type: The parser_for_type of this ReservedRange. # noqa: E501 + :type: ParserReservedRange + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this ReservedRange. # noqa: E501 + + + :return: The serialized_size of this ReservedRange. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this ReservedRange. + + + :param serialized_size: The serialized_size of this ReservedRange. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def start(self): + """Gets the start of this ReservedRange. # noqa: E501 + + + :return: The start of this ReservedRange. # noqa: E501 + :rtype: int + """ + return self._start + + @start.setter + def start(self, start): + """Sets the start of this ReservedRange. + + + :param start: The start of this ReservedRange. # noqa: E501 + :type: int + """ + + self._start = start + + @property + def unknown_fields(self): + """Gets the unknown_fields of this ReservedRange. # noqa: E501 + + + :return: The unknown_fields of this ReservedRange. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this ReservedRange. + + + :param unknown_fields: The unknown_fields of this ReservedRange. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ReservedRange, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ReservedRange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/reserved_range_or_builder.py b/src/conductor/client/codegen/models/reserved_range_or_builder.py new file mode 100644 index 00000000..39206ce1 --- /dev/null +++ b/src/conductor/client/codegen/models/reserved_range_or_builder.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ReservedRangeOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'end': 'int', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'start': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'end': 'end', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'start': 'start', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, end=None, initialization_error_string=None, initialized=None, start=None, unknown_fields=None): # noqa: E501 + """ReservedRangeOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._end = None + self._initialization_error_string = None + self._initialized = None + self._start = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if end is not None: + self.end = end + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if start is not None: + self.start = start + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this ReservedRangeOrBuilder. # noqa: E501 + + + :return: The all_fields of this ReservedRangeOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this ReservedRangeOrBuilder. + + + :param all_fields: The all_fields of this ReservedRangeOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this ReservedRangeOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this ReservedRangeOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this ReservedRangeOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this ReservedRangeOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this ReservedRangeOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this ReservedRangeOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this ReservedRangeOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this ReservedRangeOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def end(self): + """Gets the end of this ReservedRangeOrBuilder. # noqa: E501 + + + :return: The end of this ReservedRangeOrBuilder. # noqa: E501 + :rtype: int + """ + return self._end + + @end.setter + def end(self, end): + """Sets the end of this ReservedRangeOrBuilder. + + + :param end: The end of this ReservedRangeOrBuilder. # noqa: E501 + :type: int + """ + + self._end = end + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this ReservedRangeOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this ReservedRangeOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this ReservedRangeOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this ReservedRangeOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this ReservedRangeOrBuilder. # noqa: E501 + + + :return: The initialized of this ReservedRangeOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this ReservedRangeOrBuilder. + + + :param initialized: The initialized of this ReservedRangeOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def start(self): + """Gets the start of this ReservedRangeOrBuilder. # noqa: E501 + + + :return: The start of this ReservedRangeOrBuilder. # noqa: E501 + :rtype: int + """ + return self._start + + @start.setter + def start(self, start): + """Sets the start of this ReservedRangeOrBuilder. + + + :param start: The start of this ReservedRangeOrBuilder. # noqa: E501 + :type: int + """ + + self._start = start + + @property + def unknown_fields(self): + """Gets the unknown_fields of this ReservedRangeOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this ReservedRangeOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this ReservedRangeOrBuilder. + + + :param unknown_fields: The unknown_fields of this ReservedRangeOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ReservedRangeOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ReservedRangeOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/response.py b/src/conductor/client/codegen/models/response.py new file mode 100644 index 00000000..3989442f --- /dev/null +++ b/src/conductor/client/codegen/models/response.py @@ -0,0 +1,73 @@ +import pprint +import re # noqa: F401 + +import six + + +class Response(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """Response - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Response, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Response): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/role.py b/src/conductor/client/codegen/models/role.py new file mode 100644 index 00000000..bf435d08 --- /dev/null +++ b/src/conductor/client/codegen/models/role.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Role(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'permissions': 'list[Permission]' + } + + attribute_map = { + 'name': 'name', + 'permissions': 'permissions' + } + + def __init__(self, name=None, permissions=None): # noqa: E501 + """Role - a model defined in Swagger""" # noqa: E501 + self._name = None + self._permissions = None + self.discriminator = None + if name is not None: + self.name = name + if permissions is not None: + self.permissions = permissions + + @property + def name(self): + """Gets the name of this Role. # noqa: E501 + + + :return: The name of this Role. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Role. + + + :param name: The name of this Role. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def permissions(self): + """Gets the permissions of this Role. # noqa: E501 + + + :return: The permissions of this Role. # noqa: E501 + :rtype: list[Permission] + """ + return self._permissions + + @permissions.setter + def permissions(self, permissions): + """Sets the permissions of this Role. + + + :param permissions: The permissions of this Role. # noqa: E501 + :type: list[Permission] + """ + + self._permissions = permissions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Role, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Role): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/save_schedule_request.py b/src/conductor/client/codegen/models/save_schedule_request.py new file mode 100644 index 00000000..800ecfbb --- /dev/null +++ b/src/conductor/client/codegen/models/save_schedule_request.py @@ -0,0 +1,371 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SaveScheduleRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_by': 'str', + 'cron_expression': 'str', + 'description': 'str', + 'name': 'str', + 'paused': 'bool', + 'run_catchup_schedule_instances': 'bool', + 'schedule_end_time': 'int', + 'schedule_start_time': 'int', + 'start_workflow_request': 'StartWorkflowRequest', + 'updated_by': 'str', + 'zone_id': 'str' + } + + attribute_map = { + 'created_by': 'createdBy', + 'cron_expression': 'cronExpression', + 'description': 'description', + 'name': 'name', + 'paused': 'paused', + 'run_catchup_schedule_instances': 'runCatchupScheduleInstances', + 'schedule_end_time': 'scheduleEndTime', + 'schedule_start_time': 'scheduleStartTime', + 'start_workflow_request': 'startWorkflowRequest', + 'updated_by': 'updatedBy', + 'zone_id': 'zoneId' + } + + def __init__(self, created_by=None, cron_expression=None, description=None, name=None, paused=None, run_catchup_schedule_instances=None, schedule_end_time=None, schedule_start_time=None, start_workflow_request=None, updated_by=None, zone_id=None): # noqa: E501 + """SaveScheduleRequest - a model defined in Swagger""" # noqa: E501 + self._created_by = None + self._cron_expression = None + self._description = None + self._name = None + self._paused = None + self._run_catchup_schedule_instances = None + self._schedule_end_time = None + self._schedule_start_time = None + self._start_workflow_request = None + self._updated_by = None + self._zone_id = None + self.discriminator = None + if created_by is not None: + self.created_by = created_by + if cron_expression is not None: + self.cron_expression = cron_expression + if description is not None: + self.description = description + if name is not None: + self.name = name + if paused is not None: + self.paused = paused + if run_catchup_schedule_instances is not None: + self.run_catchup_schedule_instances = run_catchup_schedule_instances + if schedule_end_time is not None: + self.schedule_end_time = schedule_end_time + if schedule_start_time is not None: + self.schedule_start_time = schedule_start_time + self.start_workflow_request = start_workflow_request + if updated_by is not None: + self.updated_by = updated_by + if zone_id is not None: + self.zone_id = zone_id + + @property + def created_by(self): + """Gets the created_by of this SaveScheduleRequest. # noqa: E501 + + + :return: The created_by of this SaveScheduleRequest. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this SaveScheduleRequest. + + + :param created_by: The created_by of this SaveScheduleRequest. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def cron_expression(self): + """Gets the cron_expression of this SaveScheduleRequest. # noqa: E501 + + + :return: The cron_expression of this SaveScheduleRequest. # noqa: E501 + :rtype: str + """ + return self._cron_expression + + @cron_expression.setter + def cron_expression(self, cron_expression): + """Sets the cron_expression of this SaveScheduleRequest. + + + :param cron_expression: The cron_expression of this SaveScheduleRequest. # noqa: E501 + :type: str + """ + + self._cron_expression = cron_expression + + @property + def description(self): + """Gets the description of this SaveScheduleRequest. # noqa: E501 + + + :return: The description of this SaveScheduleRequest. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SaveScheduleRequest. + + + :param description: The description of this SaveScheduleRequest. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def name(self): + """Gets the name of this SaveScheduleRequest. # noqa: E501 + + + :return: The name of this SaveScheduleRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SaveScheduleRequest. + + + :param name: The name of this SaveScheduleRequest. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def paused(self): + """Gets the paused of this SaveScheduleRequest. # noqa: E501 + + + :return: The paused of this SaveScheduleRequest. # noqa: E501 + :rtype: bool + """ + return self._paused + + @paused.setter + def paused(self, paused): + """Sets the paused of this SaveScheduleRequest. + + + :param paused: The paused of this SaveScheduleRequest. # noqa: E501 + :type: bool + """ + + self._paused = paused + + @property + def run_catchup_schedule_instances(self): + """Gets the run_catchup_schedule_instances of this SaveScheduleRequest. # noqa: E501 + + + :return: The run_catchup_schedule_instances of this SaveScheduleRequest. # noqa: E501 + :rtype: bool + """ + return self._run_catchup_schedule_instances + + @run_catchup_schedule_instances.setter + def run_catchup_schedule_instances(self, run_catchup_schedule_instances): + """Sets the run_catchup_schedule_instances of this SaveScheduleRequest. + + + :param run_catchup_schedule_instances: The run_catchup_schedule_instances of this SaveScheduleRequest. # noqa: E501 + :type: bool + """ + + self._run_catchup_schedule_instances = run_catchup_schedule_instances + + @property + def schedule_end_time(self): + """Gets the schedule_end_time of this SaveScheduleRequest. # noqa: E501 + + + :return: The schedule_end_time of this SaveScheduleRequest. # noqa: E501 + :rtype: int + """ + return self._schedule_end_time + + @schedule_end_time.setter + def schedule_end_time(self, schedule_end_time): + """Sets the schedule_end_time of this SaveScheduleRequest. + + + :param schedule_end_time: The schedule_end_time of this SaveScheduleRequest. # noqa: E501 + :type: int + """ + + self._schedule_end_time = schedule_end_time + + @property + def schedule_start_time(self): + """Gets the schedule_start_time of this SaveScheduleRequest. # noqa: E501 + + + :return: The schedule_start_time of this SaveScheduleRequest. # noqa: E501 + :rtype: int + """ + return self._schedule_start_time + + @schedule_start_time.setter + def schedule_start_time(self, schedule_start_time): + """Sets the schedule_start_time of this SaveScheduleRequest. + + + :param schedule_start_time: The schedule_start_time of this SaveScheduleRequest. # noqa: E501 + :type: int + """ + + self._schedule_start_time = schedule_start_time + + @property + def start_workflow_request(self): + """Gets the start_workflow_request of this SaveScheduleRequest. # noqa: E501 + + + :return: The start_workflow_request of this SaveScheduleRequest. # noqa: E501 + :rtype: StartWorkflowRequest + """ + return self._start_workflow_request + + @start_workflow_request.setter + def start_workflow_request(self, start_workflow_request): + """Sets the start_workflow_request of this SaveScheduleRequest. + + + :param start_workflow_request: The start_workflow_request of this SaveScheduleRequest. # noqa: E501 + :type: StartWorkflowRequest + """ + if start_workflow_request is None: + raise ValueError("Invalid value for `start_workflow_request`, must not be `None`") # noqa: E501 + + self._start_workflow_request = start_workflow_request + + @property + def updated_by(self): + """Gets the updated_by of this SaveScheduleRequest. # noqa: E501 + + + :return: The updated_by of this SaveScheduleRequest. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this SaveScheduleRequest. + + + :param updated_by: The updated_by of this SaveScheduleRequest. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + @property + def zone_id(self): + """Gets the zone_id of this SaveScheduleRequest. # noqa: E501 + + + :return: The zone_id of this SaveScheduleRequest. # noqa: E501 + :rtype: str + """ + return self._zone_id + + @zone_id.setter + def zone_id(self, zone_id): + """Sets the zone_id of this SaveScheduleRequest. + + + :param zone_id: The zone_id of this SaveScheduleRequest. # noqa: E501 + :type: str + """ + + self._zone_id = zone_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveScheduleRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveScheduleRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/schema_def.py b/src/conductor/client/codegen/models/schema_def.py new file mode 100644 index 00000000..cdc8fb51 --- /dev/null +++ b/src/conductor/client/codegen/models/schema_def.py @@ -0,0 +1,353 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SchemaDef(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'create_time': 'int', + 'created_by': 'str', + 'data': 'dict(str, object)', + 'external_ref': 'str', + 'name': 'str', + 'owner_app': 'str', + 'type': 'str', + 'update_time': 'int', + 'updated_by': 'str', + 'version': 'int' + } + + attribute_map = { + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'data': 'data', + 'external_ref': 'externalRef', + 'name': 'name', + 'owner_app': 'ownerApp', + 'type': 'type', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy', + 'version': 'version' + } + + def __init__(self, create_time=None, created_by=None, data=None, external_ref=None, name=None, owner_app=None, type=None, update_time=None, updated_by=None, version=None): # noqa: E501 + """SchemaDef - a model defined in Swagger""" # noqa: E501 + self._create_time = None + self._created_by = None + self._data = None + self._external_ref = None + self._name = None + self._owner_app = None + self._type = None + self._update_time = None + self._updated_by = None + self._version = None + self.discriminator = None + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if data is not None: + self.data = data + if external_ref is not None: + self.external_ref = external_ref + self.name = name + if owner_app is not None: + self.owner_app = owner_app + self.type = type + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + self.version = version + + @property + def create_time(self): + """Gets the create_time of this SchemaDef. # noqa: E501 + + + :return: The create_time of this SchemaDef. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this SchemaDef. + + + :param create_time: The create_time of this SchemaDef. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this SchemaDef. # noqa: E501 + + + :return: The created_by of this SchemaDef. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this SchemaDef. + + + :param created_by: The created_by of this SchemaDef. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def data(self): + """Gets the data of this SchemaDef. # noqa: E501 + + + :return: The data of this SchemaDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this SchemaDef. + + + :param data: The data of this SchemaDef. # noqa: E501 + :type: dict(str, object) + """ + + self._data = data + + @property + def external_ref(self): + """Gets the external_ref of this SchemaDef. # noqa: E501 + + + :return: The external_ref of this SchemaDef. # noqa: E501 + :rtype: str + """ + return self._external_ref + + @external_ref.setter + def external_ref(self, external_ref): + """Sets the external_ref of this SchemaDef. + + + :param external_ref: The external_ref of this SchemaDef. # noqa: E501 + :type: str + """ + + self._external_ref = external_ref + + @property + def name(self): + """Gets the name of this SchemaDef. # noqa: E501 + + + :return: The name of this SchemaDef. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SchemaDef. + + + :param name: The name of this SchemaDef. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def owner_app(self): + """Gets the owner_app of this SchemaDef. # noqa: E501 + + + :return: The owner_app of this SchemaDef. # noqa: E501 + :rtype: str + """ + return self._owner_app + + @owner_app.setter + def owner_app(self, owner_app): + """Sets the owner_app of this SchemaDef. + + + :param owner_app: The owner_app of this SchemaDef. # noqa: E501 + :type: str + """ + + self._owner_app = owner_app + + @property + def type(self): + """Gets the type of this SchemaDef. # noqa: E501 + + + :return: The type of this SchemaDef. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SchemaDef. + + + :param type: The type of this SchemaDef. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["JSON", "AVRO", "PROTOBUF"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def update_time(self): + """Gets the update_time of this SchemaDef. # noqa: E501 + + + :return: The update_time of this SchemaDef. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this SchemaDef. + + + :param update_time: The update_time of this SchemaDef. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this SchemaDef. # noqa: E501 + + + :return: The updated_by of this SchemaDef. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this SchemaDef. + + + :param updated_by: The updated_by of this SchemaDef. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + @property + def version(self): + """Gets the version of this SchemaDef. # noqa: E501 + + + :return: The version of this SchemaDef. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this SchemaDef. + + + :param version: The version of this SchemaDef. # noqa: E501 + :type: int + """ + if version is None: + raise ValueError("Invalid value for `version`, must not be `None`") # noqa: E501 + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SchemaDef, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SchemaDef): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/scrollable_search_result_workflow_summary.py b/src/conductor/client/codegen/models/scrollable_search_result_workflow_summary.py new file mode 100644 index 00000000..b0641bfe --- /dev/null +++ b/src/conductor/client/codegen/models/scrollable_search_result_workflow_summary.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ScrollableSearchResultWorkflowSummary(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'query_id': 'str', + 'results': 'list[WorkflowSummary]', + 'total_hits': 'int' + } + + attribute_map = { + 'query_id': 'queryId', + 'results': 'results', + 'total_hits': 'totalHits' + } + + def __init__(self, query_id=None, results=None, total_hits=None): # noqa: E501 + """ScrollableSearchResultWorkflowSummary - a model defined in Swagger""" # noqa: E501 + self._query_id = None + self._results = None + self._total_hits = None + self.discriminator = None + if query_id is not None: + self.query_id = query_id + if results is not None: + self.results = results + if total_hits is not None: + self.total_hits = total_hits + + @property + def query_id(self): + """Gets the query_id of this ScrollableSearchResultWorkflowSummary. # noqa: E501 + + + :return: The query_id of this ScrollableSearchResultWorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._query_id + + @query_id.setter + def query_id(self, query_id): + """Sets the query_id of this ScrollableSearchResultWorkflowSummary. + + + :param query_id: The query_id of this ScrollableSearchResultWorkflowSummary. # noqa: E501 + :type: str + """ + + self._query_id = query_id + + @property + def results(self): + """Gets the results of this ScrollableSearchResultWorkflowSummary. # noqa: E501 + + + :return: The results of this ScrollableSearchResultWorkflowSummary. # noqa: E501 + :rtype: list[WorkflowSummary] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this ScrollableSearchResultWorkflowSummary. + + + :param results: The results of this ScrollableSearchResultWorkflowSummary. # noqa: E501 + :type: list[WorkflowSummary] + """ + + self._results = results + + @property + def total_hits(self): + """Gets the total_hits of this ScrollableSearchResultWorkflowSummary. # noqa: E501 + + + :return: The total_hits of this ScrollableSearchResultWorkflowSummary. # noqa: E501 + :rtype: int + """ + return self._total_hits + + @total_hits.setter + def total_hits(self, total_hits): + """Sets the total_hits of this ScrollableSearchResultWorkflowSummary. + + + :param total_hits: The total_hits of this ScrollableSearchResultWorkflowSummary. # noqa: E501 + :type: int + """ + + self._total_hits = total_hits + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ScrollableSearchResultWorkflowSummary, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ScrollableSearchResultWorkflowSummary): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/search_result_handled_event_response.py b/src/conductor/client/codegen/models/search_result_handled_event_response.py new file mode 100644 index 00000000..141599d8 --- /dev/null +++ b/src/conductor/client/codegen/models/search_result_handled_event_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SearchResultHandledEventResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[HandledEventResponse]', + 'total_hits': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_hits': 'totalHits' + } + + def __init__(self, results=None, total_hits=None): # noqa: E501 + """SearchResultHandledEventResponse - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_hits = None + self.discriminator = None + if results is not None: + self.results = results + if total_hits is not None: + self.total_hits = total_hits + + @property + def results(self): + """Gets the results of this SearchResultHandledEventResponse. # noqa: E501 + + + :return: The results of this SearchResultHandledEventResponse. # noqa: E501 + :rtype: list[HandledEventResponse] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this SearchResultHandledEventResponse. + + + :param results: The results of this SearchResultHandledEventResponse. # noqa: E501 + :type: list[HandledEventResponse] + """ + + self._results = results + + @property + def total_hits(self): + """Gets the total_hits of this SearchResultHandledEventResponse. # noqa: E501 + + + :return: The total_hits of this SearchResultHandledEventResponse. # noqa: E501 + :rtype: int + """ + return self._total_hits + + @total_hits.setter + def total_hits(self, total_hits): + """Sets the total_hits of this SearchResultHandledEventResponse. + + + :param total_hits: The total_hits of this SearchResultHandledEventResponse. # noqa: E501 + :type: int + """ + + self._total_hits = total_hits + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SearchResultHandledEventResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SearchResultHandledEventResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/search_result_task.py b/src/conductor/client/codegen/models/search_result_task.py new file mode 100644 index 00000000..7131d2e1 --- /dev/null +++ b/src/conductor/client/codegen/models/search_result_task.py @@ -0,0 +1,141 @@ +import pprint +import re # noqa: F401 +import six +from dataclasses import dataclass, field, fields +from typing import List, TypeVar, Generic, Optional +from dataclasses import InitVar + +T = TypeVar('T') + +@dataclass +class SearchResultTask(Generic[T]): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'total_hits': 'int', + 'results': 'list[Task]' + } + + attribute_map = { + 'total_hits': 'totalHits', + 'results': 'results' + } + + total_hits: Optional[int] = field(default=None) + results: Optional[List[T]] = field(default=None) + _total_hits: Optional[int] = field(default=None, init=False, repr=False) + _results: Optional[List[T]] = field(default=None, init=False, repr=False) + + def __init__(self, total_hits=None, results=None): # noqa: E501 + """SearchResultTask - a model defined in Swagger""" # noqa: E501 + self._total_hits = None + self._results = None + self.discriminator = None + if total_hits is not None: + self.total_hits = total_hits + if results is not None: + self.results = results + + def __post_init__(self): + """Initialize private fields after dataclass initialization""" + if self.total_hits is not None and self._total_hits is None: + self._total_hits = self.total_hits + if self.results is not None and self._results is None: + self._results = self.results + + @property + def total_hits(self): + """Gets the total_hits of this SearchResultTask. # noqa: E501 + + + :return: The total_hits of this SearchResultTask. # noqa: E501 + :rtype: int + """ + return self._total_hits + + @total_hits.setter + def total_hits(self, total_hits): + """Sets the total_hits of this SearchResultTask. + + + :param total_hits: The total_hits of this SearchResultTask. # noqa: E501 + :type: int + """ + + self._total_hits = total_hits + + @property + def results(self): + """Gets the results of this SearchResultTask. # noqa: E501 + + + :return: The results of this SearchResultTask. # noqa: E501 + :rtype: list[Task] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this SearchResultTask. + + + :param results: The results of this SearchResultTask. # noqa: E501 + :type: list[Task] + """ + + self._results = results + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SearchResultTask, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SearchResultTask): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/search_result_task_summary.py b/src/conductor/client/codegen/models/search_result_task_summary.py new file mode 100644 index 00000000..2089f6e2 --- /dev/null +++ b/src/conductor/client/codegen/models/search_result_task_summary.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SearchResultTaskSummary(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[TaskSummary]', + 'total_hits': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_hits': 'totalHits' + } + + def __init__(self, results=None, total_hits=None): # noqa: E501 + """SearchResultTaskSummary - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_hits = None + self.discriminator = None + if results is not None: + self.results = results + if total_hits is not None: + self.total_hits = total_hits + + @property + def results(self): + """Gets the results of this SearchResultTaskSummary. # noqa: E501 + + + :return: The results of this SearchResultTaskSummary. # noqa: E501 + :rtype: list[TaskSummary] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this SearchResultTaskSummary. + + + :param results: The results of this SearchResultTaskSummary. # noqa: E501 + :type: list[TaskSummary] + """ + + self._results = results + + @property + def total_hits(self): + """Gets the total_hits of this SearchResultTaskSummary. # noqa: E501 + + + :return: The total_hits of this SearchResultTaskSummary. # noqa: E501 + :rtype: int + """ + return self._total_hits + + @total_hits.setter + def total_hits(self, total_hits): + """Sets the total_hits of this SearchResultTaskSummary. + + + :param total_hits: The total_hits of this SearchResultTaskSummary. # noqa: E501 + :type: int + """ + + self._total_hits = total_hits + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SearchResultTaskSummary, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SearchResultTaskSummary): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/search_result_workflow.py b/src/conductor/client/codegen/models/search_result_workflow.py new file mode 100644 index 00000000..adaa07d8 --- /dev/null +++ b/src/conductor/client/codegen/models/search_result_workflow.py @@ -0,0 +1,138 @@ +import pprint +import re # noqa: F401 +import six +from dataclasses import dataclass, field, fields +from typing import List, TypeVar, Generic, Optional +from dataclasses import InitVar + +T = TypeVar('T') + +@dataclass +class SearchResultWorkflow(Generic[T]): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'total_hits': 'int', + 'results': 'list[Workflow]' + } + + attribute_map = { + 'total_hits': 'totalHits', + 'results': 'results' + } + + total_hits: Optional[int] = field(default=None) + results: Optional[List[T]] = field(default=None) + _total_hits: Optional[int] = field(default=None, init=False, repr=False) + _results: Optional[List[T]] = field(default=None, init=False, repr=False) + + def __init__(self, total_hits=None, results=None): # noqa: E501 + """SearchResultWorkflow - a model defined in Swagger""" # noqa: E501 + self._total_hits = None + self._results = None + self.discriminator = None + if total_hits is not None: + self.total_hits = total_hits + if results is not None: + self.results = results + + def __post_init__(self): + """Initialize private fields after dataclass initialization""" + pass + + @property + def total_hits(self): + """Gets the total_hits of this SearchResultWorkflow. # noqa: E501 + + + :return: The total_hits of this SearchResultWorkflow. # noqa: E501 + :rtype: int + """ + return self._total_hits + + @total_hits.setter + def total_hits(self, total_hits): + """Sets the total_hits of this SearchResultWorkflow. + + + :param total_hits: The total_hits of this SearchResultWorkflow. # noqa: E501 + :type: int + """ + + self._total_hits = total_hits + + @property + def results(self): + """Gets the results of this SearchResultWorkflow. # noqa: E501 + + + :return: The results of this SearchResultWorkflow. # noqa: E501 + :rtype: list[T] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this SearchResultWorkflow. + + + :param results: The results of this SearchResultWorkflow. # noqa: E501 + :type: list[T] + """ + + self._results = results + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SearchResultWorkflow, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SearchResultWorkflow): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/search_result_workflow_schedule_execution_model.py b/src/conductor/client/codegen/models/search_result_workflow_schedule_execution_model.py new file mode 100644 index 00000000..619ec73f --- /dev/null +++ b/src/conductor/client/codegen/models/search_result_workflow_schedule_execution_model.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SearchResultWorkflowScheduleExecutionModel(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[WorkflowScheduleExecutionModel]', + 'total_hits': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_hits': 'totalHits' + } + + def __init__(self, results=None, total_hits=None): # noqa: E501 + """SearchResultWorkflowScheduleExecutionModel - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_hits = None + self.discriminator = None + if results is not None: + self.results = results + if total_hits is not None: + self.total_hits = total_hits + + @property + def results(self): + """Gets the results of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The results of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 + :rtype: list[WorkflowScheduleExecutionModel] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this SearchResultWorkflowScheduleExecutionModel. + + + :param results: The results of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 + :type: list[WorkflowScheduleExecutionModel] + """ + + self._results = results + + @property + def total_hits(self): + """Gets the total_hits of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The total_hits of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 + :rtype: int + """ + return self._total_hits + + @total_hits.setter + def total_hits(self, total_hits): + """Sets the total_hits of this SearchResultWorkflowScheduleExecutionModel. + + + :param total_hits: The total_hits of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 + :type: int + """ + + self._total_hits = total_hits + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SearchResultWorkflowScheduleExecutionModel, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SearchResultWorkflowScheduleExecutionModel): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/search_result_workflow_summary.py b/src/conductor/client/codegen/models/search_result_workflow_summary.py new file mode 100644 index 00000000..a9b41c64 --- /dev/null +++ b/src/conductor/client/codegen/models/search_result_workflow_summary.py @@ -0,0 +1,135 @@ +import pprint +import re # noqa: F401 +import six +from dataclasses import dataclass, field, fields +from typing import List, Optional, TypeVar, Generic + +T = TypeVar('T') + +@dataclass +class SearchResultWorkflowSummary(Generic[T]): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'total_hits': 'int', + 'results': 'list[WorkflowSummary]' + } + + attribute_map = { + 'total_hits': 'totalHits', + 'results': 'results' + } + + _total_hits: Optional[int] = field(default=None) + _results: Optional[List[T]] = field(default=None) + + def __init__(self, total_hits=None, results=None): # noqa: E501 + """SearchResultWorkflowSummary - a model defined in Swagger""" # noqa: E501 + self._total_hits = None + self._results = None + self.discriminator = None + if total_hits is not None: + self.total_hits = total_hits + if results is not None: + self.results = results + + def __post_init__(self): + """Post initialization for dataclass""" + self.discriminator = None + + @property + def total_hits(self): + """Gets the total_hits of this SearchResultWorkflowSummary. # noqa: E501 + + + :return: The total_hits of this SearchResultWorkflowSummary. # noqa: E501 + :rtype: int + """ + return self._total_hits + + @total_hits.setter + def total_hits(self, total_hits): + """Sets the total_hits of this SearchResultWorkflowSummary. + + + :param total_hits: The total_hits of this SearchResultWorkflowSummary. # noqa: E501 + :type: int + """ + + self._total_hits = total_hits + + @property + def results(self): + """Gets the results of this SearchResultWorkflowSummary. # noqa: E501 + + + :return: The results of this SearchResultWorkflowSummary. # noqa: E501 + :rtype: list[WorkflowSummary] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this SearchResultWorkflowSummary. + + + :param results: The results of this SearchResultWorkflowSummary. # noqa: E501 + :type: list[WorkflowSummary] + """ + + self._results = results + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SearchResultWorkflowSummary, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SearchResultWorkflowSummary): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/service_descriptor.py b/src/conductor/client/codegen/models/service_descriptor.py new file mode 100644 index 00000000..30f4a9be --- /dev/null +++ b/src/conductor/client/codegen/models/service_descriptor.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ServiceDescriptor(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'file': 'FileDescriptor', + 'full_name': 'str', + 'index': 'int', + 'methods': 'list[MethodDescriptor]', + 'name': 'str', + 'options': 'ServiceOptions', + 'proto': 'ServiceDescriptorProto' + } + + attribute_map = { + 'file': 'file', + 'full_name': 'fullName', + 'index': 'index', + 'methods': 'methods', + 'name': 'name', + 'options': 'options', + 'proto': 'proto' + } + + def __init__(self, file=None, full_name=None, index=None, methods=None, name=None, options=None, proto=None): # noqa: E501 + """ServiceDescriptor - a model defined in Swagger""" # noqa: E501 + self._file = None + self._full_name = None + self._index = None + self._methods = None + self._name = None + self._options = None + self._proto = None + self.discriminator = None + if file is not None: + self.file = file + if full_name is not None: + self.full_name = full_name + if index is not None: + self.index = index + if methods is not None: + self.methods = methods + if name is not None: + self.name = name + if options is not None: + self.options = options + if proto is not None: + self.proto = proto + + @property + def file(self): + """Gets the file of this ServiceDescriptor. # noqa: E501 + + + :return: The file of this ServiceDescriptor. # noqa: E501 + :rtype: FileDescriptor + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this ServiceDescriptor. + + + :param file: The file of this ServiceDescriptor. # noqa: E501 + :type: FileDescriptor + """ + + self._file = file + + @property + def full_name(self): + """Gets the full_name of this ServiceDescriptor. # noqa: E501 + + + :return: The full_name of this ServiceDescriptor. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this ServiceDescriptor. + + + :param full_name: The full_name of this ServiceDescriptor. # noqa: E501 + :type: str + """ + + self._full_name = full_name + + @property + def index(self): + """Gets the index of this ServiceDescriptor. # noqa: E501 + + + :return: The index of this ServiceDescriptor. # noqa: E501 + :rtype: int + """ + return self._index + + @index.setter + def index(self, index): + """Sets the index of this ServiceDescriptor. + + + :param index: The index of this ServiceDescriptor. # noqa: E501 + :type: int + """ + + self._index = index + + @property + def methods(self): + """Gets the methods of this ServiceDescriptor. # noqa: E501 + + + :return: The methods of this ServiceDescriptor. # noqa: E501 + :rtype: list[MethodDescriptor] + """ + return self._methods + + @methods.setter + def methods(self, methods): + """Sets the methods of this ServiceDescriptor. + + + :param methods: The methods of this ServiceDescriptor. # noqa: E501 + :type: list[MethodDescriptor] + """ + + self._methods = methods + + @property + def name(self): + """Gets the name of this ServiceDescriptor. # noqa: E501 + + + :return: The name of this ServiceDescriptor. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ServiceDescriptor. + + + :param name: The name of this ServiceDescriptor. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def options(self): + """Gets the options of this ServiceDescriptor. # noqa: E501 + + + :return: The options of this ServiceDescriptor. # noqa: E501 + :rtype: ServiceOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this ServiceDescriptor. + + + :param options: The options of this ServiceDescriptor. # noqa: E501 + :type: ServiceOptions + """ + + self._options = options + + @property + def proto(self): + """Gets the proto of this ServiceDescriptor. # noqa: E501 + + + :return: The proto of this ServiceDescriptor. # noqa: E501 + :rtype: ServiceDescriptorProto + """ + return self._proto + + @proto.setter + def proto(self, proto): + """Sets the proto of this ServiceDescriptor. + + + :param proto: The proto of this ServiceDescriptor. # noqa: E501 + :type: ServiceDescriptorProto + """ + + self._proto = proto + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ServiceDescriptor, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ServiceDescriptor): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/service_descriptor_proto.py b/src/conductor/client/codegen/models/service_descriptor_proto.py new file mode 100644 index 00000000..c456ccad --- /dev/null +++ b/src/conductor/client/codegen/models/service_descriptor_proto.py @@ -0,0 +1,500 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ServiceDescriptorProto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'ServiceDescriptorProto', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'method_count': 'int', + 'method_list': 'list[MethodDescriptorProto]', + 'method_or_builder_list': 'list[MethodDescriptorProtoOrBuilder]', + 'name': 'str', + 'name_bytes': 'ByteString', + 'options': 'ServiceOptions', + 'options_or_builder': 'ServiceOptionsOrBuilder', + 'parser_for_type': 'ParserServiceDescriptorProto', + 'serialized_size': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'method_count': 'methodCount', + 'method_list': 'methodList', + 'method_or_builder_list': 'methodOrBuilderList', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, method_count=None, method_list=None, method_or_builder_list=None, name=None, name_bytes=None, options=None, options_or_builder=None, parser_for_type=None, serialized_size=None, unknown_fields=None): # noqa: E501 + """ServiceDescriptorProto - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._method_count = None + self._method_list = None + self._method_or_builder_list = None + self._name = None + self._name_bytes = None + self._options = None + self._options_or_builder = None + self._parser_for_type = None + self._serialized_size = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if method_count is not None: + self.method_count = method_count + if method_list is not None: + self.method_list = method_list + if method_or_builder_list is not None: + self.method_or_builder_list = method_or_builder_list + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this ServiceDescriptorProto. # noqa: E501 + + + :return: The all_fields of this ServiceDescriptorProto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this ServiceDescriptorProto. + + + :param all_fields: The all_fields of this ServiceDescriptorProto. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this ServiceDescriptorProto. # noqa: E501 + + + :return: The default_instance_for_type of this ServiceDescriptorProto. # noqa: E501 + :rtype: ServiceDescriptorProto + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this ServiceDescriptorProto. + + + :param default_instance_for_type: The default_instance_for_type of this ServiceDescriptorProto. # noqa: E501 + :type: ServiceDescriptorProto + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this ServiceDescriptorProto. # noqa: E501 + + + :return: The descriptor_for_type of this ServiceDescriptorProto. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this ServiceDescriptorProto. + + + :param descriptor_for_type: The descriptor_for_type of this ServiceDescriptorProto. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this ServiceDescriptorProto. # noqa: E501 + + + :return: The initialization_error_string of this ServiceDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this ServiceDescriptorProto. + + + :param initialization_error_string: The initialization_error_string of this ServiceDescriptorProto. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this ServiceDescriptorProto. # noqa: E501 + + + :return: The initialized of this ServiceDescriptorProto. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this ServiceDescriptorProto. + + + :param initialized: The initialized of this ServiceDescriptorProto. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this ServiceDescriptorProto. # noqa: E501 + + + :return: The memoized_serialized_size of this ServiceDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this ServiceDescriptorProto. + + + :param memoized_serialized_size: The memoized_serialized_size of this ServiceDescriptorProto. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def method_count(self): + """Gets the method_count of this ServiceDescriptorProto. # noqa: E501 + + + :return: The method_count of this ServiceDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._method_count + + @method_count.setter + def method_count(self, method_count): + """Sets the method_count of this ServiceDescriptorProto. + + + :param method_count: The method_count of this ServiceDescriptorProto. # noqa: E501 + :type: int + """ + + self._method_count = method_count + + @property + def method_list(self): + """Gets the method_list of this ServiceDescriptorProto. # noqa: E501 + + + :return: The method_list of this ServiceDescriptorProto. # noqa: E501 + :rtype: list[MethodDescriptorProto] + """ + return self._method_list + + @method_list.setter + def method_list(self, method_list): + """Sets the method_list of this ServiceDescriptorProto. + + + :param method_list: The method_list of this ServiceDescriptorProto. # noqa: E501 + :type: list[MethodDescriptorProto] + """ + + self._method_list = method_list + + @property + def method_or_builder_list(self): + """Gets the method_or_builder_list of this ServiceDescriptorProto. # noqa: E501 + + + :return: The method_or_builder_list of this ServiceDescriptorProto. # noqa: E501 + :rtype: list[MethodDescriptorProtoOrBuilder] + """ + return self._method_or_builder_list + + @method_or_builder_list.setter + def method_or_builder_list(self, method_or_builder_list): + """Sets the method_or_builder_list of this ServiceDescriptorProto. + + + :param method_or_builder_list: The method_or_builder_list of this ServiceDescriptorProto. # noqa: E501 + :type: list[MethodDescriptorProtoOrBuilder] + """ + + self._method_or_builder_list = method_or_builder_list + + @property + def name(self): + """Gets the name of this ServiceDescriptorProto. # noqa: E501 + + + :return: The name of this ServiceDescriptorProto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ServiceDescriptorProto. + + + :param name: The name of this ServiceDescriptorProto. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this ServiceDescriptorProto. # noqa: E501 + + + :return: The name_bytes of this ServiceDescriptorProto. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this ServiceDescriptorProto. + + + :param name_bytes: The name_bytes of this ServiceDescriptorProto. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def options(self): + """Gets the options of this ServiceDescriptorProto. # noqa: E501 + + + :return: The options of this ServiceDescriptorProto. # noqa: E501 + :rtype: ServiceOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this ServiceDescriptorProto. + + + :param options: The options of this ServiceDescriptorProto. # noqa: E501 + :type: ServiceOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this ServiceDescriptorProto. # noqa: E501 + + + :return: The options_or_builder of this ServiceDescriptorProto. # noqa: E501 + :rtype: ServiceOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this ServiceDescriptorProto. + + + :param options_or_builder: The options_or_builder of this ServiceDescriptorProto. # noqa: E501 + :type: ServiceOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def parser_for_type(self): + """Gets the parser_for_type of this ServiceDescriptorProto. # noqa: E501 + + + :return: The parser_for_type of this ServiceDescriptorProto. # noqa: E501 + :rtype: ParserServiceDescriptorProto + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this ServiceDescriptorProto. + + + :param parser_for_type: The parser_for_type of this ServiceDescriptorProto. # noqa: E501 + :type: ParserServiceDescriptorProto + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this ServiceDescriptorProto. # noqa: E501 + + + :return: The serialized_size of this ServiceDescriptorProto. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this ServiceDescriptorProto. + + + :param serialized_size: The serialized_size of this ServiceDescriptorProto. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def unknown_fields(self): + """Gets the unknown_fields of this ServiceDescriptorProto. # noqa: E501 + + + :return: The unknown_fields of this ServiceDescriptorProto. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this ServiceDescriptorProto. + + + :param unknown_fields: The unknown_fields of this ServiceDescriptorProto. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ServiceDescriptorProto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ServiceDescriptorProto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/service_descriptor_proto_or_builder.py b/src/conductor/client/codegen/models/service_descriptor_proto_or_builder.py new file mode 100644 index 00000000..12e0805b --- /dev/null +++ b/src/conductor/client/codegen/models/service_descriptor_proto_or_builder.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ServiceDescriptorProtoOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'method_count': 'int', + 'method_list': 'list[MethodDescriptorProto]', + 'method_or_builder_list': 'list[MethodDescriptorProtoOrBuilder]', + 'name': 'str', + 'name_bytes': 'ByteString', + 'options': 'ServiceOptions', + 'options_or_builder': 'ServiceOptionsOrBuilder', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'method_count': 'methodCount', + 'method_list': 'methodList', + 'method_or_builder_list': 'methodOrBuilderList', + 'name': 'name', + 'name_bytes': 'nameBytes', + 'options': 'options', + 'options_or_builder': 'optionsOrBuilder', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, method_count=None, method_list=None, method_or_builder_list=None, name=None, name_bytes=None, options=None, options_or_builder=None, unknown_fields=None): # noqa: E501 + """ServiceDescriptorProtoOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._method_count = None + self._method_list = None + self._method_or_builder_list = None + self._name = None + self._name_bytes = None + self._options = None + self._options_or_builder = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if method_count is not None: + self.method_count = method_count + if method_list is not None: + self.method_list = method_list + if method_or_builder_list is not None: + self.method_or_builder_list = method_or_builder_list + if name is not None: + self.name = name + if name_bytes is not None: + self.name_bytes = name_bytes + if options is not None: + self.options = options + if options_or_builder is not None: + self.options_or_builder = options_or_builder + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The all_fields of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this ServiceDescriptorProtoOrBuilder. + + + :param all_fields: The all_fields of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this ServiceDescriptorProtoOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this ServiceDescriptorProtoOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this ServiceDescriptorProtoOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The initialized of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this ServiceDescriptorProtoOrBuilder. + + + :param initialized: The initialized of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def method_count(self): + """Gets the method_count of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The method_count of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._method_count + + @method_count.setter + def method_count(self, method_count): + """Sets the method_count of this ServiceDescriptorProtoOrBuilder. + + + :param method_count: The method_count of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: int + """ + + self._method_count = method_count + + @property + def method_list(self): + """Gets the method_list of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The method_list of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[MethodDescriptorProto] + """ + return self._method_list + + @method_list.setter + def method_list(self, method_list): + """Sets the method_list of this ServiceDescriptorProtoOrBuilder. + + + :param method_list: The method_list of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: list[MethodDescriptorProto] + """ + + self._method_list = method_list + + @property + def method_or_builder_list(self): + """Gets the method_or_builder_list of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The method_or_builder_list of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: list[MethodDescriptorProtoOrBuilder] + """ + return self._method_or_builder_list + + @method_or_builder_list.setter + def method_or_builder_list(self, method_or_builder_list): + """Sets the method_or_builder_list of this ServiceDescriptorProtoOrBuilder. + + + :param method_or_builder_list: The method_or_builder_list of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: list[MethodDescriptorProtoOrBuilder] + """ + + self._method_or_builder_list = method_or_builder_list + + @property + def name(self): + """Gets the name of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ServiceDescriptorProtoOrBuilder. + + + :param name: The name of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_bytes(self): + """Gets the name_bytes of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The name_bytes of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._name_bytes + + @name_bytes.setter + def name_bytes(self, name_bytes): + """Sets the name_bytes of this ServiceDescriptorProtoOrBuilder. + + + :param name_bytes: The name_bytes of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._name_bytes = name_bytes + + @property + def options(self): + """Gets the options of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ServiceOptions + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this ServiceDescriptorProtoOrBuilder. + + + :param options: The options of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: ServiceOptions + """ + + self._options = options + + @property + def options_or_builder(self): + """Gets the options_or_builder of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The options_or_builder of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: ServiceOptionsOrBuilder + """ + return self._options_or_builder + + @options_or_builder.setter + def options_or_builder(self, options_or_builder): + """Sets the options_or_builder of this ServiceDescriptorProtoOrBuilder. + + + :param options_or_builder: The options_or_builder of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: ServiceOptionsOrBuilder + """ + + self._options_or_builder = options_or_builder + + @property + def unknown_fields(self): + """Gets the unknown_fields of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this ServiceDescriptorProtoOrBuilder. + + + :param unknown_fields: The unknown_fields of this ServiceDescriptorProtoOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ServiceDescriptorProtoOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ServiceDescriptorProtoOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/service_method.py b/src/conductor/client/codegen/models/service_method.py new file mode 100644 index 00000000..df03f550 --- /dev/null +++ b/src/conductor/client/codegen/models/service_method.py @@ -0,0 +1,91 @@ +from dataclasses import dataclass +from typing import Optional, List, Dict, Any +import six + + +@dataclass +class ServiceMethod: + """Service method model matching the Java ServiceMethod POJO.""" + + swagger_types = { + 'id': 'int', + 'operation_name': 'str', + 'method_name': 'str', + 'method_type': 'str', + 'input_type': 'str', + 'output_type': 'str', + 'request_params': 'list[RequestParam]', + 'example_input': 'dict' + } + + attribute_map = { + 'id': 'id', + 'operation_name': 'operationName', + 'method_name': 'methodName', + 'method_type': 'methodType', + 'input_type': 'inputType', + 'output_type': 'outputType', + 'request_params': 'requestParams', + 'example_input': 'exampleInput' + } + + id: Optional[int] = None + operation_name: Optional[str] = None + method_name: Optional[str] = None + method_type: Optional[str] = None # GET, PUT, POST, UNARY, SERVER_STREAMING etc. + input_type: Optional[str] = None + output_type: Optional[str] = None + request_params: Optional[List[Any]] = None # List of RequestParam objects + example_input: Optional[Dict[str, Any]] = None + + def __post_init__(self): + """Initialize default values after dataclass creation.""" + if self.request_params is None: + self.request_params = [] + if self.example_input is None: + self.example_input = {} + + def to_dict(self): + """Returns the model properties as a dict using the correct JSON field names.""" + result = {} + for attr, json_key in six.iteritems(self.attribute_map): + value = getattr(self, attr) + if value is not None: + if isinstance(value, list): + result[json_key] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[json_key] = value.to_dict() + elif isinstance(value, dict): + result[json_key] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[json_key] = value + return result + + def __str__(self): + return f"ServiceMethod(operation_name='{self.operation_name}', method_name='{self.method_name}', method_type='{self.method_type}')" + + +# For backwards compatibility, add helper methods +@dataclass +class RequestParam: + """Request parameter model (placeholder - define based on actual Java RequestParam class).""" + + name: Optional[str] = None + type: Optional[str] = None + required: Optional[bool] = False + description: Optional[str] = None + + def to_dict(self): + return { + 'name': self.name, + 'type': self.type, + 'required': self.required, + 'description': self.description + } \ No newline at end of file diff --git a/src/conductor/client/codegen/models/service_options.py b/src/conductor/client/codegen/models/service_options.py new file mode 100644 index 00000000..34278182 --- /dev/null +++ b/src/conductor/client/codegen/models/service_options.py @@ -0,0 +1,500 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ServiceOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'all_fields_raw': 'dict(str, object)', + 'default_instance_for_type': 'ServiceOptions', + 'deprecated': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserServiceOptions', + 'serialized_size': 'int', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'all_fields_raw': 'allFieldsRaw', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, all_fields_raw=None, default_instance_for_type=None, deprecated=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """ServiceOptions - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._all_fields_raw = None + self._default_instance_for_type = None + self._deprecated = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if all_fields_raw is not None: + self.all_fields_raw = all_fields_raw + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this ServiceOptions. # noqa: E501 + + + :return: The all_fields of this ServiceOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this ServiceOptions. + + + :param all_fields: The all_fields of this ServiceOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def all_fields_raw(self): + """Gets the all_fields_raw of this ServiceOptions. # noqa: E501 + + + :return: The all_fields_raw of this ServiceOptions. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields_raw + + @all_fields_raw.setter + def all_fields_raw(self, all_fields_raw): + """Sets the all_fields_raw of this ServiceOptions. + + + :param all_fields_raw: The all_fields_raw of this ServiceOptions. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields_raw = all_fields_raw + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this ServiceOptions. # noqa: E501 + + + :return: The default_instance_for_type of this ServiceOptions. # noqa: E501 + :rtype: ServiceOptions + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this ServiceOptions. + + + :param default_instance_for_type: The default_instance_for_type of this ServiceOptions. # noqa: E501 + :type: ServiceOptions + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this ServiceOptions. # noqa: E501 + + + :return: The deprecated of this ServiceOptions. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this ServiceOptions. + + + :param deprecated: The deprecated of this ServiceOptions. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this ServiceOptions. # noqa: E501 + + + :return: The descriptor_for_type of this ServiceOptions. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this ServiceOptions. + + + :param descriptor_for_type: The descriptor_for_type of this ServiceOptions. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this ServiceOptions. # noqa: E501 + + + :return: The features of this ServiceOptions. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this ServiceOptions. + + + :param features: The features of this ServiceOptions. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this ServiceOptions. # noqa: E501 + + + :return: The features_or_builder of this ServiceOptions. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this ServiceOptions. + + + :param features_or_builder: The features_or_builder of this ServiceOptions. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this ServiceOptions. # noqa: E501 + + + :return: The initialization_error_string of this ServiceOptions. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this ServiceOptions. + + + :param initialization_error_string: The initialization_error_string of this ServiceOptions. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this ServiceOptions. # noqa: E501 + + + :return: The initialized of this ServiceOptions. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this ServiceOptions. + + + :param initialized: The initialized of this ServiceOptions. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this ServiceOptions. # noqa: E501 + + + :return: The memoized_serialized_size of this ServiceOptions. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this ServiceOptions. + + + :param memoized_serialized_size: The memoized_serialized_size of this ServiceOptions. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this ServiceOptions. # noqa: E501 + + + :return: The parser_for_type of this ServiceOptions. # noqa: E501 + :rtype: ParserServiceOptions + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this ServiceOptions. + + + :param parser_for_type: The parser_for_type of this ServiceOptions. # noqa: E501 + :type: ParserServiceOptions + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this ServiceOptions. # noqa: E501 + + + :return: The serialized_size of this ServiceOptions. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this ServiceOptions. + + + :param serialized_size: The serialized_size of this ServiceOptions. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this ServiceOptions. # noqa: E501 + + + :return: The uninterpreted_option_count of this ServiceOptions. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this ServiceOptions. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this ServiceOptions. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this ServiceOptions. # noqa: E501 + + + :return: The uninterpreted_option_list of this ServiceOptions. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this ServiceOptions. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this ServiceOptions. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this ServiceOptions. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this ServiceOptions. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this ServiceOptions. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this ServiceOptions. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this ServiceOptions. # noqa: E501 + + + :return: The unknown_fields of this ServiceOptions. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this ServiceOptions. + + + :param unknown_fields: The unknown_fields of this ServiceOptions. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ServiceOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ServiceOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/service_options_or_builder.py b/src/conductor/client/codegen/models/service_options_or_builder.py new file mode 100644 index 00000000..c32678b2 --- /dev/null +++ b/src/conductor/client/codegen/models/service_options_or_builder.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ServiceOptionsOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'deprecated': 'bool', + 'descriptor_for_type': 'Descriptor', + 'features': 'FeatureSet', + 'features_or_builder': 'FeatureSetOrBuilder', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'uninterpreted_option_count': 'int', + 'uninterpreted_option_list': 'list[UninterpretedOption]', + 'uninterpreted_option_or_builder_list': 'list[UninterpretedOptionOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'deprecated': 'deprecated', + 'descriptor_for_type': 'descriptorForType', + 'features': 'features', + 'features_or_builder': 'featuresOrBuilder', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'uninterpreted_option_count': 'uninterpretedOptionCount', + 'uninterpreted_option_list': 'uninterpretedOptionList', + 'uninterpreted_option_or_builder_list': 'uninterpretedOptionOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, deprecated=None, descriptor_for_type=None, features=None, features_or_builder=None, initialization_error_string=None, initialized=None, uninterpreted_option_count=None, uninterpreted_option_list=None, uninterpreted_option_or_builder_list=None, unknown_fields=None): # noqa: E501 + """ServiceOptionsOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._deprecated = None + self._descriptor_for_type = None + self._features = None + self._features_or_builder = None + self._initialization_error_string = None + self._initialized = None + self._uninterpreted_option_count = None + self._uninterpreted_option_list = None + self._uninterpreted_option_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if deprecated is not None: + self.deprecated = deprecated + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if features is not None: + self.features = features + if features_or_builder is not None: + self.features_or_builder = features_or_builder + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if uninterpreted_option_count is not None: + self.uninterpreted_option_count = uninterpreted_option_count + if uninterpreted_option_list is not None: + self.uninterpreted_option_list = uninterpreted_option_list + if uninterpreted_option_or_builder_list is not None: + self.uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The all_fields of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this ServiceOptionsOrBuilder. + + + :param all_fields: The all_fields of this ServiceOptionsOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this ServiceOptionsOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this ServiceOptionsOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def deprecated(self): + """Gets the deprecated of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The deprecated of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this ServiceOptionsOrBuilder. + + + :param deprecated: The deprecated of this ServiceOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this ServiceOptionsOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this ServiceOptionsOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def features(self): + """Gets the features of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The features of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSet + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this ServiceOptionsOrBuilder. + + + :param features: The features of this ServiceOptionsOrBuilder. # noqa: E501 + :type: FeatureSet + """ + + self._features = features + + @property + def features_or_builder(self): + """Gets the features_or_builder of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The features_or_builder of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: FeatureSetOrBuilder + """ + return self._features_or_builder + + @features_or_builder.setter + def features_or_builder(self, features_or_builder): + """Sets the features_or_builder of this ServiceOptionsOrBuilder. + + + :param features_or_builder: The features_or_builder of this ServiceOptionsOrBuilder. # noqa: E501 + :type: FeatureSetOrBuilder + """ + + self._features_or_builder = features_or_builder + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this ServiceOptionsOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this ServiceOptionsOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The initialized of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this ServiceOptionsOrBuilder. + + + :param initialized: The initialized of this ServiceOptionsOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def uninterpreted_option_count(self): + """Gets the uninterpreted_option_count of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_count of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: int + """ + return self._uninterpreted_option_count + + @uninterpreted_option_count.setter + def uninterpreted_option_count(self, uninterpreted_option_count): + """Sets the uninterpreted_option_count of this ServiceOptionsOrBuilder. + + + :param uninterpreted_option_count: The uninterpreted_option_count of this ServiceOptionsOrBuilder. # noqa: E501 + :type: int + """ + + self._uninterpreted_option_count = uninterpreted_option_count + + @property + def uninterpreted_option_list(self): + """Gets the uninterpreted_option_list of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_list of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOption] + """ + return self._uninterpreted_option_list + + @uninterpreted_option_list.setter + def uninterpreted_option_list(self, uninterpreted_option_list): + """Sets the uninterpreted_option_list of this ServiceOptionsOrBuilder. + + + :param uninterpreted_option_list: The uninterpreted_option_list of this ServiceOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOption] + """ + + self._uninterpreted_option_list = uninterpreted_option_list + + @property + def uninterpreted_option_or_builder_list(self): + """Gets the uninterpreted_option_or_builder_list of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The uninterpreted_option_or_builder_list of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: list[UninterpretedOptionOrBuilder] + """ + return self._uninterpreted_option_or_builder_list + + @uninterpreted_option_or_builder_list.setter + def uninterpreted_option_or_builder_list(self, uninterpreted_option_or_builder_list): + """Sets the uninterpreted_option_or_builder_list of this ServiceOptionsOrBuilder. + + + :param uninterpreted_option_or_builder_list: The uninterpreted_option_or_builder_list of this ServiceOptionsOrBuilder. # noqa: E501 + :type: list[UninterpretedOptionOrBuilder] + """ + + self._uninterpreted_option_or_builder_list = uninterpreted_option_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this ServiceOptionsOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this ServiceOptionsOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this ServiceOptionsOrBuilder. + + + :param unknown_fields: The unknown_fields of this ServiceOptionsOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ServiceOptionsOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ServiceOptionsOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/service_registry.py b/src/conductor/client/codegen/models/service_registry.py new file mode 100644 index 00000000..6a9a3b36 --- /dev/null +++ b/src/conductor/client/codegen/models/service_registry.py @@ -0,0 +1,159 @@ +from dataclasses import dataclass, field +from typing import List, Optional +from enum import Enum +import six + + +class ServiceType(str, Enum): + HTTP = "HTTP" + GRPC = "gRPC" + + +@dataclass +class OrkesCircuitBreakerConfig: + """Circuit breaker configuration for Orkes services.""" + + swagger_types = { + 'failure_rate_threshold': 'float', + 'sliding_window_size': 'int', + 'minimum_number_of_calls': 'int', + 'wait_duration_in_open_state': 'int', + 'permitted_number_of_calls_in_half_open_state': 'int', + 'slow_call_rate_threshold': 'float', + 'slow_call_duration_threshold': 'int', + 'automatic_transition_from_open_to_half_open_enabled': 'bool', + 'max_wait_duration_in_half_open_state': 'int' + } + + attribute_map = { + 'failure_rate_threshold': 'failureRateThreshold', + 'sliding_window_size': 'slidingWindowSize', + 'minimum_number_of_calls': 'minimumNumberOfCalls', + 'wait_duration_in_open_state': 'waitDurationInOpenState', + 'permitted_number_of_calls_in_half_open_state': 'permittedNumberOfCallsInHalfOpenState', + 'slow_call_rate_threshold': 'slowCallRateThreshold', + 'slow_call_duration_threshold': 'slowCallDurationThreshold', + 'automatic_transition_from_open_to_half_open_enabled': 'automaticTransitionFromOpenToHalfOpenEnabled', + 'max_wait_duration_in_half_open_state': 'maxWaitDurationInHalfOpenState' + } + + failure_rate_threshold: Optional[float] = None + sliding_window_size: Optional[int] = None + minimum_number_of_calls: Optional[int] = None + wait_duration_in_open_state: Optional[int] = None + permitted_number_of_calls_in_half_open_state: Optional[int] = None + slow_call_rate_threshold: Optional[float] = None + slow_call_duration_threshold: Optional[int] = None + automatic_transition_from_open_to_half_open_enabled: Optional[bool] = None + max_wait_duration_in_half_open_state: Optional[int] = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + return result + + +@dataclass +class Config: + """Configuration class for service registry.""" + + swagger_types = { + 'circuit_breaker_config': 'OrkesCircuitBreakerConfig' + } + + attribute_map = { + 'circuit_breaker_config': 'circuitBreakerConfig' + } + + circuit_breaker_config: OrkesCircuitBreakerConfig = field(default_factory=OrkesCircuitBreakerConfig) + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + return result + + +@dataclass +class ServiceRegistry: + """Service registry model for registering HTTP and gRPC services.""" + + swagger_types = { + 'name': 'str', + 'type': 'str', + 'service_uri': 'str', + 'methods': 'list[ServiceMethod]', + 'request_params': 'list[RequestParam]', + 'config': 'Config' + } + + attribute_map = { + 'name': 'name', + 'type': 'type', + 'service_uri': 'serviceURI', + 'methods': 'methods', + 'request_params': 'requestParams', + 'config': 'config' + } + + name: Optional[str] = None + type: Optional[str] = None + service_uri: Optional[str] = None + methods: List['ServiceMethod'] = field(default_factory=list) + request_params: List['RequestParam'] = field(default_factory=list) + config: Config = field(default_factory=Config) + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + return result \ No newline at end of file diff --git a/src/conductor/client/codegen/models/signal_response.py b/src/conductor/client/codegen/models/signal_response.py new file mode 100644 index 00000000..8f97cb30 --- /dev/null +++ b/src/conductor/client/codegen/models/signal_response.py @@ -0,0 +1,575 @@ +import pprint +import re # noqa: F401 +import six +from typing import Dict, Any, Optional, List +from enum import Enum + + +class WorkflowSignalReturnStrategy(Enum): + """Enum for workflow signal return strategy""" + TARGET_WORKFLOW = "TARGET_WORKFLOW" + BLOCKING_WORKFLOW = "BLOCKING_WORKFLOW" + BLOCKING_TASK = "BLOCKING_TASK" + BLOCKING_TASK_INPUT = "BLOCKING_TASK_INPUT" + + +class TaskStatus(Enum): + """Enum for task status""" + IN_PROGRESS = "IN_PROGRESS" + CANCELED = "CANCELED" + FAILED = "FAILED" + FAILED_WITH_TERMINAL_ERROR = "FAILED_WITH_TERMINAL_ERROR" + COMPLETED = "COMPLETED" + COMPLETED_WITH_ERRORS = "COMPLETED_WITH_ERRORS" + SCHEDULED = "SCHEDULED" + TIMED_OUT = "TIMED_OUT" + READY_FOR_RERUN = "READY_FOR_RERUN" + SKIPPED = "SKIPPED" + + +class SignalResponse: + swagger_types = { + 'response_type': 'str', + 'target_workflow_id': 'str', + 'target_workflow_status': 'str', + 'request_id': 'str', + 'workflow_id': 'str', + 'correlation_id': 'str', + 'input': 'dict(str, object)', + 'output': 'dict(str, object)', + 'task_type': 'str', + 'task_id': 'str', + 'reference_task_name': 'str', + 'retry_count': 'int', + 'task_def_name': 'str', + 'retried_task_id': 'str', + 'workflow_type': 'str', + 'reason_for_incompletion': 'str', + 'priority': 'int', + 'variables': 'dict(str, object)', + 'tasks': 'list[object]', + 'created_by': 'str', + 'create_time': 'int', + 'update_time': 'int', + 'status': 'str' + } + + attribute_map = { + 'response_type': 'responseType', + 'target_workflow_id': 'targetWorkflowId', + 'target_workflow_status': 'targetWorkflowStatus', + 'request_id': 'requestId', + 'workflow_id': 'workflowId', + 'correlation_id': 'correlationId', + 'input': 'input', + 'output': 'output', + 'task_type': 'taskType', + 'task_id': 'taskId', + 'reference_task_name': 'referenceTaskName', + 'retry_count': 'retryCount', + 'task_def_name': 'taskDefName', + 'retried_task_id': 'retriedTaskId', + 'workflow_type': 'workflowType', + 'reason_for_incompletion': 'reasonForIncompletion', + 'priority': 'priority', + 'variables': 'variables', + 'tasks': 'tasks', + 'created_by': 'createdBy', + 'create_time': 'createTime', + 'update_time': 'updateTime', + 'status': 'status' + } + + def __init__(self, **kwargs): + """Initialize with API response data, handling both camelCase and snake_case""" + + # Initialize all attributes with default values + self.response_type = None + self.target_workflow_id = None + self.target_workflow_status = None + self.request_id = None + self.workflow_id = None + self.correlation_id = None + self.input = {} + self.output = {} + self.task_type = None + self.task_id = None + self.reference_task_name = None + self.retry_count = 0 + self.task_def_name = None + self.retried_task_id = None + self.workflow_type = None + self.reason_for_incompletion = None + self.priority = 0 + self.variables = {} + self.tasks = [] + self.created_by = None + self.create_time = 0 + self.update_time = 0 + self.status = None + self.discriminator = None + + # Handle both camelCase (from API) and snake_case keys + reverse_mapping = {v: k for k, v in self.attribute_map.items()} + + for key, value in kwargs.items(): + if key in reverse_mapping: + # Convert camelCase to snake_case + snake_key = reverse_mapping[key] + if snake_key == 'status' and isinstance(value, str): + try: + setattr(self, snake_key, TaskStatus(value)) + except ValueError: + setattr(self, snake_key, value) + else: + setattr(self, snake_key, value) + elif hasattr(self, key): + # Direct snake_case assignment + if key == 'status' and isinstance(value, str): + try: + setattr(self, key, TaskStatus(value)) + except ValueError: + setattr(self, key, value) + else: + setattr(self, key, value) + + # Extract task information from the first IN_PROGRESS task if available + if self.response_type == "TARGET_WORKFLOW" and self.tasks: + in_progress_task = None + for task in self.tasks: + if isinstance(task, dict) and task.get('status') == 'IN_PROGRESS': + in_progress_task = task + break + + # If no IN_PROGRESS task, get the last task + if not in_progress_task and self.tasks: + in_progress_task = self.tasks[-1] if isinstance(self.tasks[-1], dict) else None + + if in_progress_task: + # Map task fields if they weren't already set + if self.task_id is None: + self.task_id = in_progress_task.get('taskId') + if self.task_type is None: + self.task_type = in_progress_task.get('taskType') + if self.reference_task_name is None: + self.reference_task_name = in_progress_task.get('referenceTaskName') + if self.task_def_name is None: + self.task_def_name = in_progress_task.get('taskDefName') + if self.retry_count == 0: + self.retry_count = in_progress_task.get('retryCount', 0) + + def __str__(self): + """Returns a detailed string representation similar to Swagger response""" + + def format_dict(d, indent=12): + if not d: + return "{}" + items = [] + for k, v in d.items(): + if isinstance(v, dict): + formatted_v = format_dict(v, indent + 4) + items.append(f"{' ' * indent}'{k}': {formatted_v}") + elif isinstance(v, list): + formatted_v = format_list(v, indent + 4) + items.append(f"{' ' * indent}'{k}': {formatted_v}") + elif isinstance(v, str): + items.append(f"{' ' * indent}'{k}': '{v}'") + else: + items.append(f"{' ' * indent}'{k}': {v}") + return "{\n" + ",\n".join(items) + f"\n{' ' * (indent - 4)}}}" + + def format_list(lst, indent=12): + if not lst: + return "[]" + items = [] + for item in lst: + if isinstance(item, dict): + formatted_item = format_dict(item, indent + 4) + items.append(f"{' ' * indent}{formatted_item}") + elif isinstance(item, str): + items.append(f"{' ' * indent}'{item}'") + else: + items.append(f"{' ' * indent}{item}") + return "[\n" + ",\n".join(items) + f"\n{' ' * (indent - 4)}]" + + # Format input and output + input_str = format_dict(self.input) if self.input else "{}" + output_str = format_dict(self.output) if self.output else "{}" + variables_str = format_dict(self.variables) if self.variables else "{}" + + # Handle different response types + if self.response_type == "TARGET_WORKFLOW": + # Workflow response - show tasks array + tasks_str = format_list(self.tasks, 12) if self.tasks else "[]" + return f"""SignalResponse( + responseType='{self.response_type}', + targetWorkflowId='{self.target_workflow_id}', + targetWorkflowStatus='{self.target_workflow_status}', + workflowId='{self.workflow_id}', + input={input_str}, + output={output_str}, + priority={self.priority}, + variables={variables_str}, + tasks={tasks_str}, + createdBy='{self.created_by}', + createTime={self.create_time}, + updateTime={self.update_time}, + status='{self.status}' +)""" + + elif self.response_type == "BLOCKING_TASK": + # Task response - show task-specific fields + status_str = self.status.value if hasattr(self.status, 'value') else str(self.status) + return f"""SignalResponse( + responseType='{self.response_type}', + targetWorkflowId='{self.target_workflow_id}', + targetWorkflowStatus='{self.target_workflow_status}', + workflowId='{self.workflow_id}', + input={input_str}, + output={output_str}, + taskType='{self.task_type}', + taskId='{self.task_id}', + referenceTaskName='{self.reference_task_name}', + retryCount={self.retry_count}, + taskDefName='{self.task_def_name}', + workflowType='{self.workflow_type}', + priority={self.priority}, + createTime={self.create_time}, + updateTime={self.update_time}, + status='{status_str}' +)""" + + else: + # Generic response - show all available fields + status_str = self.status.value if hasattr(self.status, 'value') else str(self.status) + result = f"""SignalResponse( + responseType='{self.response_type}', + targetWorkflowId='{self.target_workflow_id}', + targetWorkflowStatus='{self.target_workflow_status}', + workflowId='{self.workflow_id}', + input={input_str}, + output={output_str}, + priority={self.priority}""" + + # Add task fields if they exist + if self.task_type: + result += f",\n taskType='{self.task_type}'" + if self.task_id: + result += f",\n taskId='{self.task_id}'" + if self.reference_task_name: + result += f",\n referenceTaskName='{self.reference_task_name}'" + if self.retry_count > 0: + result += f",\n retryCount={self.retry_count}" + if self.task_def_name: + result += f",\n taskDefName='{self.task_def_name}'" + if self.workflow_type: + result += f",\n workflowType='{self.workflow_type}'" + + # Add workflow fields if they exist + if self.variables: + result += f",\n variables={variables_str}" + if self.tasks: + tasks_str = format_list(self.tasks, 12) + result += f",\n tasks={tasks_str}" + if self.created_by: + result += f",\n createdBy='{self.created_by}'" + + result += f",\n createTime={self.create_time}" + result += f",\n updateTime={self.update_time}" + result += f",\n status='{status_str}'" + result += "\n)" + + return result + + def get_task_by_reference_name(self, ref_name: str) -> Optional[Dict]: + """Get a specific task by its reference name""" + if not self.tasks: + return None + + for task in self.tasks: + if isinstance(task, dict) and task.get('referenceTaskName') == ref_name: + return task + return None + + def get_tasks_by_status(self, status: str) -> List[Dict]: + """Get all tasks with a specific status""" + if not self.tasks: + return [] + + return [task for task in self.tasks + if isinstance(task, dict) and task.get('status') == status] + + def get_in_progress_task(self) -> Optional[Dict]: + """Get the current IN_PROGRESS task""" + in_progress_tasks = self.get_tasks_by_status('IN_PROGRESS') + return in_progress_tasks[0] if in_progress_tasks else None + + def get_all_tasks(self) -> List[Dict]: + """Get all tasks in the workflow""" + return self.tasks if self.tasks else [] + + def get_completed_tasks(self) -> List[Dict]: + """Get all completed tasks""" + return self.get_tasks_by_status('COMPLETED') + + def get_failed_tasks(self) -> List[Dict]: + """Get all failed tasks""" + return self.get_tasks_by_status('FAILED') + + def get_task_chain(self) -> List[str]: + """Get the sequence of task reference names in execution order""" + if not self.tasks: + return [] + + # Sort by seq number if available, otherwise by the order in the list + sorted_tasks = sorted(self.tasks, key=lambda t: t.get('seq', 0) if isinstance(t, dict) else 0) + return [task.get('referenceTaskName', f'task_{i}') + for i, task in enumerate(sorted_tasks) if isinstance(task, dict)] + + # ===== HELPER METHODS (Following Go SDK Pattern) ===== + + def is_target_workflow(self) -> bool: + """Returns True if the response contains target workflow details""" + return self.response_type == "TARGET_WORKFLOW" + + def is_blocking_workflow(self) -> bool: + """Returns True if the response contains blocking workflow details""" + return self.response_type == "BLOCKING_WORKFLOW" + + def is_blocking_task(self) -> bool: + """Returns True if the response contains blocking task details""" + return self.response_type == "BLOCKING_TASK" + + def is_blocking_task_input(self) -> bool: + """Returns True if the response contains blocking task input""" + return self.response_type == "BLOCKING_TASK_INPUT" + + def get_workflow(self) -> Optional[Dict]: + """ + Extract workflow details from a SignalResponse. + Returns None if the response type doesn't contain workflow details. + """ + if not (self.is_target_workflow() or self.is_blocking_workflow()): + return None + + return { + 'workflowId': self.workflow_id, + 'status': self.status.value if hasattr(self.status, 'value') else str(self.status), + 'tasks': self.tasks or [], + 'createdBy': self.created_by, + 'createTime': self.create_time, + 'updateTime': self.update_time, + 'input': self.input or {}, + 'output': self.output or {}, + 'variables': self.variables or {}, + 'priority': self.priority, + 'targetWorkflowId': self.target_workflow_id, + 'targetWorkflowStatus': self.target_workflow_status + } + + def get_blocking_task(self) -> Optional[Dict]: + """ + Extract task details from a SignalResponse. + Returns None if the response type doesn't contain task details. + """ + if not (self.is_blocking_task() or self.is_blocking_task_input()): + return None + + return { + 'taskId': self.task_id, + 'taskType': self.task_type, + 'taskDefName': self.task_def_name, + 'workflowType': self.workflow_type, + 'referenceTaskName': self.reference_task_name, + 'retryCount': self.retry_count, + 'status': self.status.value if hasattr(self.status, 'value') else str(self.status), + 'workflowId': self.workflow_id, + 'input': self.input or {}, + 'output': self.output or {}, + 'priority': self.priority, + 'createTime': self.create_time, + 'updateTime': self.update_time + } + + def get_task_input(self) -> Optional[Dict]: + """ + Extract task input from a SignalResponse. + Only valid for BLOCKING_TASK_INPUT responses. + """ + if not self.is_blocking_task_input(): + return None + + return self.input or {} + + def print_summary(self): + """Print a concise summary for quick overview""" + status_str = self.status.value if hasattr(self.status, 'value') else str(self.status) + + print(f""" +=== Signal Response Summary === +Response Type: {self.response_type} +Workflow ID: {self.workflow_id} +Workflow Status: {self.target_workflow_status} +""") + + if self.is_target_workflow() or self.is_blocking_workflow(): + print(f"Total Tasks: {len(self.tasks) if self.tasks else 0}") + print(f"Workflow Status: {status_str}") + if self.created_by: + print(f"Created By: {self.created_by}") + + if self.is_blocking_task() or self.is_blocking_task_input(): + print(f"Task Info:") + print(f" Task ID: {self.task_id}") + print(f" Task Type: {self.task_type}") + print(f" Reference Name: {self.reference_task_name}") + print(f" Status: {status_str}") + print(f" Retry Count: {self.retry_count}") + if self.workflow_type: + print(f" Workflow Type: {self.workflow_type}") + + def get_response_summary(self) -> str: + """Get a quick text summary of the response type and key info""" + status_str = self.status.value if hasattr(self.status, 'value') else str(self.status) + + if self.is_target_workflow(): + return f"TARGET_WORKFLOW: {self.workflow_id} ({self.target_workflow_status}) - {len(self.tasks) if self.tasks else 0} tasks" + elif self.is_blocking_workflow(): + return f"BLOCKING_WORKFLOW: {self.workflow_id} ({status_str}) - {len(self.tasks) if self.tasks else 0} tasks" + elif self.is_blocking_task(): + return f"BLOCKING_TASK: {self.task_type} ({self.reference_task_name}) - {status_str}" + elif self.is_blocking_task_input(): + return f"BLOCKING_TASK_INPUT: {self.task_type} ({self.reference_task_name}) - Input data available" + else: + return f"UNKNOWN_RESPONSE_TYPE: {self.response_type}" + + def print_tasks_summary(self): + """Print a detailed summary of all tasks""" + if not self.tasks: + print("No tasks found in the response.") + return + + print(f"\n=== Tasks Summary ({len(self.tasks)} tasks) ===") + for i, task in enumerate(self.tasks, 1): + if isinstance(task, dict): + print(f"\nTask {i}:") + print(f" Type: {task.get('taskType', 'UNKNOWN')}") + print(f" Reference Name: {task.get('referenceTaskName', 'UNKNOWN')}") + print(f" Status: {task.get('status', 'UNKNOWN')}") + print(f" Task ID: {task.get('taskId', 'UNKNOWN')}") + print(f" Sequence: {task.get('seq', 'N/A')}") + if task.get('startTime'): + print(f" Start Time: {task.get('startTime')}") + if task.get('endTime'): + print(f" End Time: {task.get('endTime')}") + if task.get('inputData'): + print(f" Input Data: {task.get('inputData')}") + if task.get('outputData'): + print(f" Output Data: {task.get('outputData')}") + if task.get('workerId'): + print(f" Worker ID: {task.get('workerId')}") + + def get_full_json(self) -> str: + """Get the complete response as JSON string (like Swagger)""" + import json + return json.dumps(self.to_dict(), indent=2) + + def save_to_file(self, filename: str): + """Save the complete response to a JSON file""" + import json + with open(filename, 'w') as f: + json.dump(self.to_dict(), f, indent=2) + print(f"Response saved to {filename}") + + def to_dict(self): + """Returns the model properties as a dict with camelCase keys""" + result = {} + + for snake_key, value in self.__dict__.items(): + if value is None or snake_key == 'discriminator': + continue + + # Convert to camelCase using attribute_map + camel_key = self.attribute_map.get(snake_key, snake_key) + + if isinstance(value, TaskStatus): + result[camel_key] = value.value + elif snake_key == 'tasks' and not value: + # For BLOCKING_TASK responses, don't include empty tasks array + if self.response_type != "BLOCKING_TASK": + result[camel_key] = value + elif snake_key in ['task_type', 'task_id', 'reference_task_name', 'task_def_name', + 'workflow_type'] and not value: + # For TARGET_WORKFLOW responses, don't include empty task fields + if self.response_type == "BLOCKING_TASK": + continue + else: + result[camel_key] = value + elif snake_key in ['variables', 'created_by'] and not value: + # Don't include empty variables or None created_by + continue + else: + result[camel_key] = value + + return result + + @classmethod + def from_dict(cls, data: Dict[str, Any]) -> 'SignalResponse': + """Create instance from dictionary with camelCase keys""" + snake_case_data = {} + + # Reverse mapping from camelCase to snake_case + reverse_mapping = {v: k for k, v in cls.attribute_map.items()} + + for camel_key, value in data.items(): + if camel_key in reverse_mapping: + snake_key = reverse_mapping[camel_key] + if snake_key == 'status' and value: + snake_case_data[snake_key] = TaskStatus(value) + else: + snake_case_data[snake_key] = value + + return cls(**snake_case_data) + + @classmethod + def from_api_response(cls, data: Dict[str, Any]) -> 'SignalResponse': + """Create instance from API response dictionary with proper field mapping""" + if not isinstance(data, dict): + return cls() + + kwargs = {} + + # Reverse mapping from camelCase to snake_case + reverse_mapping = {v: k for k, v in cls.attribute_map.items()} + + for camel_key, value in data.items(): + if camel_key in reverse_mapping: + snake_key = reverse_mapping[camel_key] + if snake_key == 'status' and value and isinstance(value, str): + try: + kwargs[snake_key] = TaskStatus(value) + except ValueError: + kwargs[snake_key] = value + else: + kwargs[snake_key] = value + + return cls(**kwargs) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SignalResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/skip_task_request.py b/src/conductor/client/codegen/models/skip_task_request.py new file mode 100644 index 00000000..9e677ce1 --- /dev/null +++ b/src/conductor/client/codegen/models/skip_task_request.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SkipTaskRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'task_input': 'dict(str, object)', + 'task_output': 'dict(str, object)' + } + + attribute_map = { + 'task_input': 'taskInput', + 'task_output': 'taskOutput' + } + + def __init__(self, task_input=None, task_output=None): # noqa: E501 + """SkipTaskRequest - a model defined in Swagger""" # noqa: E501 + self._task_input = None + self._task_output = None + self.discriminator = None + if task_input is not None: + self.task_input = task_input + if task_output is not None: + self.task_output = task_output + + @property + def task_input(self): + """Gets the task_input of this SkipTaskRequest. # noqa: E501 + + + :return: The task_input of this SkipTaskRequest. # noqa: E501 + :rtype: dict(str, object) + """ + return self._task_input + + @task_input.setter + def task_input(self, task_input): + """Sets the task_input of this SkipTaskRequest. + + + :param task_input: The task_input of this SkipTaskRequest. # noqa: E501 + :type: dict(str, object) + """ + + self._task_input = task_input + + @property + def task_output(self): + """Gets the task_output of this SkipTaskRequest. # noqa: E501 + + + :return: The task_output of this SkipTaskRequest. # noqa: E501 + :rtype: dict(str, object) + """ + return self._task_output + + @task_output.setter + def task_output(self, task_output): + """Sets the task_output of this SkipTaskRequest. + + + :param task_output: The task_output of this SkipTaskRequest. # noqa: E501 + :type: dict(str, object) + """ + + self._task_output = task_output + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SkipTaskRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SkipTaskRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/source_code_info.py b/src/conductor/client/codegen/models/source_code_info.py new file mode 100644 index 00000000..468415ab --- /dev/null +++ b/src/conductor/client/codegen/models/source_code_info.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SourceCodeInfo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'SourceCodeInfo', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'location_count': 'int', + 'location_list': 'list[Location]', + 'location_or_builder_list': 'list[LocationOrBuilder]', + 'memoized_serialized_size': 'int', + 'parser_for_type': 'ParserSourceCodeInfo', + 'serialized_size': 'int', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'location_count': 'locationCount', + 'location_list': 'locationList', + 'location_or_builder_list': 'locationOrBuilderList', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, location_count=None, location_list=None, location_or_builder_list=None, memoized_serialized_size=None, parser_for_type=None, serialized_size=None, unknown_fields=None): # noqa: E501 + """SourceCodeInfo - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._location_count = None + self._location_list = None + self._location_or_builder_list = None + self._memoized_serialized_size = None + self._parser_for_type = None + self._serialized_size = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if location_count is not None: + self.location_count = location_count + if location_list is not None: + self.location_list = location_list + if location_or_builder_list is not None: + self.location_or_builder_list = location_or_builder_list + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this SourceCodeInfo. # noqa: E501 + + + :return: The all_fields of this SourceCodeInfo. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this SourceCodeInfo. + + + :param all_fields: The all_fields of this SourceCodeInfo. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this SourceCodeInfo. # noqa: E501 + + + :return: The default_instance_for_type of this SourceCodeInfo. # noqa: E501 + :rtype: SourceCodeInfo + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this SourceCodeInfo. + + + :param default_instance_for_type: The default_instance_for_type of this SourceCodeInfo. # noqa: E501 + :type: SourceCodeInfo + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this SourceCodeInfo. # noqa: E501 + + + :return: The descriptor_for_type of this SourceCodeInfo. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this SourceCodeInfo. + + + :param descriptor_for_type: The descriptor_for_type of this SourceCodeInfo. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this SourceCodeInfo. # noqa: E501 + + + :return: The initialization_error_string of this SourceCodeInfo. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this SourceCodeInfo. + + + :param initialization_error_string: The initialization_error_string of this SourceCodeInfo. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this SourceCodeInfo. # noqa: E501 + + + :return: The initialized of this SourceCodeInfo. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this SourceCodeInfo. + + + :param initialized: The initialized of this SourceCodeInfo. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def location_count(self): + """Gets the location_count of this SourceCodeInfo. # noqa: E501 + + + :return: The location_count of this SourceCodeInfo. # noqa: E501 + :rtype: int + """ + return self._location_count + + @location_count.setter + def location_count(self, location_count): + """Sets the location_count of this SourceCodeInfo. + + + :param location_count: The location_count of this SourceCodeInfo. # noqa: E501 + :type: int + """ + + self._location_count = location_count + + @property + def location_list(self): + """Gets the location_list of this SourceCodeInfo. # noqa: E501 + + + :return: The location_list of this SourceCodeInfo. # noqa: E501 + :rtype: list[Location] + """ + return self._location_list + + @location_list.setter + def location_list(self, location_list): + """Sets the location_list of this SourceCodeInfo. + + + :param location_list: The location_list of this SourceCodeInfo. # noqa: E501 + :type: list[Location] + """ + + self._location_list = location_list + + @property + def location_or_builder_list(self): + """Gets the location_or_builder_list of this SourceCodeInfo. # noqa: E501 + + + :return: The location_or_builder_list of this SourceCodeInfo. # noqa: E501 + :rtype: list[LocationOrBuilder] + """ + return self._location_or_builder_list + + @location_or_builder_list.setter + def location_or_builder_list(self, location_or_builder_list): + """Sets the location_or_builder_list of this SourceCodeInfo. + + + :param location_or_builder_list: The location_or_builder_list of this SourceCodeInfo. # noqa: E501 + :type: list[LocationOrBuilder] + """ + + self._location_or_builder_list = location_or_builder_list + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this SourceCodeInfo. # noqa: E501 + + + :return: The memoized_serialized_size of this SourceCodeInfo. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this SourceCodeInfo. + + + :param memoized_serialized_size: The memoized_serialized_size of this SourceCodeInfo. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def parser_for_type(self): + """Gets the parser_for_type of this SourceCodeInfo. # noqa: E501 + + + :return: The parser_for_type of this SourceCodeInfo. # noqa: E501 + :rtype: ParserSourceCodeInfo + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this SourceCodeInfo. + + + :param parser_for_type: The parser_for_type of this SourceCodeInfo. # noqa: E501 + :type: ParserSourceCodeInfo + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this SourceCodeInfo. # noqa: E501 + + + :return: The serialized_size of this SourceCodeInfo. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this SourceCodeInfo. + + + :param serialized_size: The serialized_size of this SourceCodeInfo. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def unknown_fields(self): + """Gets the unknown_fields of this SourceCodeInfo. # noqa: E501 + + + :return: The unknown_fields of this SourceCodeInfo. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this SourceCodeInfo. + + + :param unknown_fields: The unknown_fields of this SourceCodeInfo. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SourceCodeInfo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SourceCodeInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/source_code_info_or_builder.py b/src/conductor/client/codegen/models/source_code_info_or_builder.py new file mode 100644 index 00000000..7f70197c --- /dev/null +++ b/src/conductor/client/codegen/models/source_code_info_or_builder.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SourceCodeInfoOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'location_count': 'int', + 'location_list': 'list[Location]', + 'location_or_builder_list': 'list[LocationOrBuilder]', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'location_count': 'locationCount', + 'location_list': 'locationList', + 'location_or_builder_list': 'locationOrBuilderList', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, initialization_error_string=None, initialized=None, location_count=None, location_list=None, location_or_builder_list=None, unknown_fields=None): # noqa: E501 + """SourceCodeInfoOrBuilder - a model defined in Swagger""" # noqa: E501 + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._initialization_error_string = None + self._initialized = None + self._location_count = None + self._location_list = None + self._location_or_builder_list = None + self._unknown_fields = None + self.discriminator = None + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if location_count is not None: + self.location_count = location_count + if location_list is not None: + self.location_list = location_list + if location_or_builder_list is not None: + self.location_or_builder_list = location_or_builder_list + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def all_fields(self): + """Gets the all_fields of this SourceCodeInfoOrBuilder. # noqa: E501 + + + :return: The all_fields of this SourceCodeInfoOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this SourceCodeInfoOrBuilder. + + + :param all_fields: The all_fields of this SourceCodeInfoOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this SourceCodeInfoOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this SourceCodeInfoOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this SourceCodeInfoOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this SourceCodeInfoOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this SourceCodeInfoOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this SourceCodeInfoOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this SourceCodeInfoOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this SourceCodeInfoOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this SourceCodeInfoOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this SourceCodeInfoOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this SourceCodeInfoOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this SourceCodeInfoOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this SourceCodeInfoOrBuilder. # noqa: E501 + + + :return: The initialized of this SourceCodeInfoOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this SourceCodeInfoOrBuilder. + + + :param initialized: The initialized of this SourceCodeInfoOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def location_count(self): + """Gets the location_count of this SourceCodeInfoOrBuilder. # noqa: E501 + + + :return: The location_count of this SourceCodeInfoOrBuilder. # noqa: E501 + :rtype: int + """ + return self._location_count + + @location_count.setter + def location_count(self, location_count): + """Sets the location_count of this SourceCodeInfoOrBuilder. + + + :param location_count: The location_count of this SourceCodeInfoOrBuilder. # noqa: E501 + :type: int + """ + + self._location_count = location_count + + @property + def location_list(self): + """Gets the location_list of this SourceCodeInfoOrBuilder. # noqa: E501 + + + :return: The location_list of this SourceCodeInfoOrBuilder. # noqa: E501 + :rtype: list[Location] + """ + return self._location_list + + @location_list.setter + def location_list(self, location_list): + """Sets the location_list of this SourceCodeInfoOrBuilder. + + + :param location_list: The location_list of this SourceCodeInfoOrBuilder. # noqa: E501 + :type: list[Location] + """ + + self._location_list = location_list + + @property + def location_or_builder_list(self): + """Gets the location_or_builder_list of this SourceCodeInfoOrBuilder. # noqa: E501 + + + :return: The location_or_builder_list of this SourceCodeInfoOrBuilder. # noqa: E501 + :rtype: list[LocationOrBuilder] + """ + return self._location_or_builder_list + + @location_or_builder_list.setter + def location_or_builder_list(self, location_or_builder_list): + """Sets the location_or_builder_list of this SourceCodeInfoOrBuilder. + + + :param location_or_builder_list: The location_or_builder_list of this SourceCodeInfoOrBuilder. # noqa: E501 + :type: list[LocationOrBuilder] + """ + + self._location_or_builder_list = location_or_builder_list + + @property + def unknown_fields(self): + """Gets the unknown_fields of this SourceCodeInfoOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this SourceCodeInfoOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this SourceCodeInfoOrBuilder. + + + :param unknown_fields: The unknown_fields of this SourceCodeInfoOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SourceCodeInfoOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SourceCodeInfoOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/start_workflow.py b/src/conductor/client/codegen/models/start_workflow.py new file mode 100644 index 00000000..fddc7f7d --- /dev/null +++ b/src/conductor/client/codegen/models/start_workflow.py @@ -0,0 +1,223 @@ +import pprint +import re # noqa: F401 +import six +from dataclasses import dataclass, field, InitVar +from typing import Dict, Any, Optional +from dataclasses import asdict + + +@dataclass +class StartWorkflow: + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'version': 'int', + 'correlation_id': 'str', + 'input': 'dict(str, object)', + 'task_to_domain': 'dict(str, str)' + } + + attribute_map = { + 'name': 'name', + 'version': 'version', + 'correlation_id': 'correlationId', + 'input': 'input', + 'task_to_domain': 'taskToDomain' + } + + name: Optional[str] = field(default=None) + version: Optional[int] = field(default=None) + correlation_id: Optional[str] = field(default=None) + input: Optional[Dict[str, Any]] = field(default=None) + task_to_domain: Optional[Dict[str, str]] = field(default=None) + + # Private backing fields for properties + _name: Optional[str] = field(default=None, init=False, repr=False) + _version: Optional[int] = field(default=None, init=False, repr=False) + _correlation_id: Optional[str] = field(default=None, init=False, repr=False) + _input: Optional[Dict[str, Any]] = field(default=None, init=False, repr=False) + _task_to_domain: Optional[Dict[str, str]] = field(default=None, init=False, repr=False) + + def __init__(self, name=None, version=None, correlation_id=None, input=None, task_to_domain=None): # noqa: E501 + """StartWorkflow - a model defined in Swagger""" # noqa: E501 + self._name = None + self._version = None + self._correlation_id = None + self._input = None + self._task_to_domain = None + self.discriminator = None + if name is not None: + self.name = name + if version is not None: + self.version = version + if correlation_id is not None: + self.correlation_id = correlation_id + if input is not None: + self.input = input + if task_to_domain is not None: + self.task_to_domain = task_to_domain + + def __post_init__(self): + """Initialize private fields after dataclass initialization""" + pass + + @property + def name(self): + """Gets the name of this StartWorkflow. # noqa: E501 + + + :return: The name of this StartWorkflow. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this StartWorkflow. + + + :param name: The name of this StartWorkflow. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def version(self): + """Gets the version of this StartWorkflow. # noqa: E501 + + + :return: The version of this StartWorkflow. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this StartWorkflow. + + + :param version: The version of this StartWorkflow. # noqa: E501 + :type: int + """ + + self._version = version + + @property + def correlation_id(self): + """Gets the correlation_id of this StartWorkflow. # noqa: E501 + + + :return: The correlation_id of this StartWorkflow. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this StartWorkflow. + + + :param correlation_id: The correlation_id of this StartWorkflow. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def input(self): + """Gets the input of this StartWorkflow. # noqa: E501 + + + :return: The input of this StartWorkflow. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input + + @input.setter + def input(self, input): + """Sets the input of this StartWorkflow. + + + :param input: The input of this StartWorkflow. # noqa: E501 + :type: dict(str, object) + """ + + self._input = input + + @property + def task_to_domain(self): + """Gets the task_to_domain of this StartWorkflow. # noqa: E501 + + + :return: The task_to_domain of this StartWorkflow. # noqa: E501 + :rtype: dict(str, str) + """ + return self._task_to_domain + + @task_to_domain.setter + def task_to_domain(self, task_to_domain): + """Sets the task_to_domain of this StartWorkflow. + + + :param task_to_domain: The task_to_domain of this StartWorkflow. # noqa: E501 + :type: dict(str, str) + """ + + self._task_to_domain = task_to_domain + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StartWorkflow, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StartWorkflow): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/start_workflow_request.py b/src/conductor/client/codegen/models/start_workflow_request.py new file mode 100644 index 00000000..11875e5f --- /dev/null +++ b/src/conductor/client/codegen/models/start_workflow_request.py @@ -0,0 +1,377 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class StartWorkflowRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'correlation_id': 'str', + 'created_by': 'str', + 'external_input_payload_storage_path': 'str', + 'idempotency_key': 'str', + 'idempotency_strategy': 'str', + 'input': 'dict(str, object)', + 'name': 'str', + 'priority': 'int', + 'task_to_domain': 'dict(str, str)', + 'version': 'int', + 'workflow_def': 'WorkflowDef' + } + + attribute_map = { + 'correlation_id': 'correlationId', + 'created_by': 'createdBy', + 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', + 'idempotency_key': 'idempotencyKey', + 'idempotency_strategy': 'idempotencyStrategy', + 'input': 'input', + 'name': 'name', + 'priority': 'priority', + 'task_to_domain': 'taskToDomain', + 'version': 'version', + 'workflow_def': 'workflowDef' + } + + def __init__(self, correlation_id=None, created_by=None, external_input_payload_storage_path=None, idempotency_key=None, idempotency_strategy=None, input=None, name=None, priority=None, task_to_domain=None, version=None, workflow_def=None): # noqa: E501 + """StartWorkflowRequest - a model defined in Swagger""" # noqa: E501 + self._correlation_id = None + self._created_by = None + self._external_input_payload_storage_path = None + self._idempotency_key = None + self._idempotency_strategy = None + self._input = None + self._name = None + self._priority = None + self._task_to_domain = None + self._version = None + self._workflow_def = None + self.discriminator = None + if correlation_id is not None: + self.correlation_id = correlation_id + if created_by is not None: + self.created_by = created_by + if external_input_payload_storage_path is not None: + self.external_input_payload_storage_path = external_input_payload_storage_path + if idempotency_key is not None: + self.idempotency_key = idempotency_key + if idempotency_strategy is not None: + self.idempotency_strategy = idempotency_strategy + if input is not None: + self.input = input + self.name = name + if priority is not None: + self.priority = priority + if task_to_domain is not None: + self.task_to_domain = task_to_domain + if version is not None: + self.version = version + if workflow_def is not None: + self.workflow_def = workflow_def + + @property + def correlation_id(self): + """Gets the correlation_id of this StartWorkflowRequest. # noqa: E501 + + + :return: The correlation_id of this StartWorkflowRequest. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this StartWorkflowRequest. + + + :param correlation_id: The correlation_id of this StartWorkflowRequest. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def created_by(self): + """Gets the created_by of this StartWorkflowRequest. # noqa: E501 + + + :return: The created_by of this StartWorkflowRequest. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this StartWorkflowRequest. + + + :param created_by: The created_by of this StartWorkflowRequest. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def external_input_payload_storage_path(self): + """Gets the external_input_payload_storage_path of this StartWorkflowRequest. # noqa: E501 + + + :return: The external_input_payload_storage_path of this StartWorkflowRequest. # noqa: E501 + :rtype: str + """ + return self._external_input_payload_storage_path + + @external_input_payload_storage_path.setter + def external_input_payload_storage_path(self, external_input_payload_storage_path): + """Sets the external_input_payload_storage_path of this StartWorkflowRequest. + + + :param external_input_payload_storage_path: The external_input_payload_storage_path of this StartWorkflowRequest. # noqa: E501 + :type: str + """ + + self._external_input_payload_storage_path = external_input_payload_storage_path + + @property + def idempotency_key(self): + """Gets the idempotency_key of this StartWorkflowRequest. # noqa: E501 + + + :return: The idempotency_key of this StartWorkflowRequest. # noqa: E501 + :rtype: str + """ + return self._idempotency_key + + @idempotency_key.setter + def idempotency_key(self, idempotency_key): + """Sets the idempotency_key of this StartWorkflowRequest. + + + :param idempotency_key: The idempotency_key of this StartWorkflowRequest. # noqa: E501 + :type: str + """ + + self._idempotency_key = idempotency_key + + @property + def idempotency_strategy(self): + """Gets the idempotency_strategy of this StartWorkflowRequest. # noqa: E501 + + + :return: The idempotency_strategy of this StartWorkflowRequest. # noqa: E501 + :rtype: str + """ + return self._idempotency_strategy + + @idempotency_strategy.setter + def idempotency_strategy(self, idempotency_strategy): + """Sets the idempotency_strategy of this StartWorkflowRequest. + + + :param idempotency_strategy: The idempotency_strategy of this StartWorkflowRequest. # noqa: E501 + :type: str + """ + allowed_values = ["FAIL", "RETURN_EXISTING", "FAIL_ON_RUNNING"] # noqa: E501 + if idempotency_strategy not in allowed_values: + raise ValueError( + "Invalid value for `idempotency_strategy` ({0}), must be one of {1}" # noqa: E501 + .format(idempotency_strategy, allowed_values) + ) + + self._idempotency_strategy = idempotency_strategy + + @property + def input(self): + """Gets the input of this StartWorkflowRequest. # noqa: E501 + + + :return: The input of this StartWorkflowRequest. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input + + @input.setter + def input(self, input): + """Sets the input of this StartWorkflowRequest. + + + :param input: The input of this StartWorkflowRequest. # noqa: E501 + :type: dict(str, object) + """ + + self._input = input + + @property + def name(self): + """Gets the name of this StartWorkflowRequest. # noqa: E501 + + + :return: The name of this StartWorkflowRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this StartWorkflowRequest. + + + :param name: The name of this StartWorkflowRequest. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def priority(self): + """Gets the priority of this StartWorkflowRequest. # noqa: E501 + + + :return: The priority of this StartWorkflowRequest. # noqa: E501 + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this StartWorkflowRequest. + + + :param priority: The priority of this StartWorkflowRequest. # noqa: E501 + :type: int + """ + + self._priority = priority + + @property + def task_to_domain(self): + """Gets the task_to_domain of this StartWorkflowRequest. # noqa: E501 + + + :return: The task_to_domain of this StartWorkflowRequest. # noqa: E501 + :rtype: dict(str, str) + """ + return self._task_to_domain + + @task_to_domain.setter + def task_to_domain(self, task_to_domain): + """Sets the task_to_domain of this StartWorkflowRequest. + + + :param task_to_domain: The task_to_domain of this StartWorkflowRequest. # noqa: E501 + :type: dict(str, str) + """ + + self._task_to_domain = task_to_domain + + @property + def version(self): + """Gets the version of this StartWorkflowRequest. # noqa: E501 + + + :return: The version of this StartWorkflowRequest. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this StartWorkflowRequest. + + + :param version: The version of this StartWorkflowRequest. # noqa: E501 + :type: int + """ + + self._version = version + + @property + def workflow_def(self): + """Gets the workflow_def of this StartWorkflowRequest. # noqa: E501 + + + :return: The workflow_def of this StartWorkflowRequest. # noqa: E501 + :rtype: WorkflowDef + """ + return self._workflow_def + + @workflow_def.setter + def workflow_def(self, workflow_def): + """Sets the workflow_def of this StartWorkflowRequest. + + + :param workflow_def: The workflow_def of this StartWorkflowRequest. # noqa: E501 + :type: WorkflowDef + """ + + self._workflow_def = workflow_def + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StartWorkflowRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StartWorkflowRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/state_change_event.py b/src/conductor/client/codegen/models/state_change_event.py new file mode 100644 index 00000000..7ade4e63 --- /dev/null +++ b/src/conductor/client/codegen/models/state_change_event.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class StateChangeEvent(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'payload': 'dict(str, object)', + 'type': 'str' + } + + attribute_map = { + 'payload': 'payload', + 'type': 'type' + } + + def __init__(self, payload=None, type=None): # noqa: E501 + """StateChangeEvent - a model defined in Swagger""" # noqa: E501 + self._payload = None + self._type = None + self.discriminator = None + if payload is not None: + self.payload = payload + self.type = type + + @property + def payload(self): + """Gets the payload of this StateChangeEvent. # noqa: E501 + + + :return: The payload of this StateChangeEvent. # noqa: E501 + :rtype: dict(str, object) + """ + return self._payload + + @payload.setter + def payload(self, payload): + """Sets the payload of this StateChangeEvent. + + + :param payload: The payload of this StateChangeEvent. # noqa: E501 + :type: dict(str, object) + """ + + self._payload = payload + + @property + def type(self): + """Gets the type of this StateChangeEvent. # noqa: E501 + + + :return: The type of this StateChangeEvent. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this StateChangeEvent. + + + :param type: The type of this StateChangeEvent. # noqa: E501 + :type: str + """ + print(f"type: {type}") + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StateChangeEvent, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StateChangeEvent): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/sub_workflow_params.py b/src/conductor/client/codegen/models/sub_workflow_params.py new file mode 100644 index 00000000..c37af71b --- /dev/null +++ b/src/conductor/client/codegen/models/sub_workflow_params.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SubWorkflowParams(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'idempotency_key': 'str', + 'idempotency_strategy': 'str', + 'name': 'str', + 'priority': 'int', + 'task_to_domain': 'dict(str, str)', + 'version': 'int', + 'workflow_definition': 'WorkflowDef' + } + + attribute_map = { + 'idempotency_key': 'idempotencyKey', + 'idempotency_strategy': 'idempotencyStrategy', + 'name': 'name', + 'priority': 'priority', + 'task_to_domain': 'taskToDomain', + 'version': 'version', + 'workflow_definition': 'workflowDefinition' + } + + def __init__(self, idempotency_key=None, idempotency_strategy=None, name=None, priority=None, task_to_domain=None, version=None, workflow_definition=None): # noqa: E501 + """SubWorkflowParams - a model defined in Swagger""" # noqa: E501 + self._idempotency_key = None + self._idempotency_strategy = None + self._name = None + self._priority = None + self._task_to_domain = None + self._version = None + self._workflow_definition = None + self.discriminator = None + if idempotency_key is not None: + self.idempotency_key = idempotency_key + if idempotency_strategy is not None: + self.idempotency_strategy = idempotency_strategy + if name is not None: + self.name = name + if priority is not None: + self.priority = priority + if task_to_domain is not None: + self.task_to_domain = task_to_domain + if version is not None: + self.version = version + if workflow_definition is not None: + self.workflow_definition = workflow_definition + + @property + def idempotency_key(self): + """Gets the idempotency_key of this SubWorkflowParams. # noqa: E501 + + + :return: The idempotency_key of this SubWorkflowParams. # noqa: E501 + :rtype: str + """ + return self._idempotency_key + + @idempotency_key.setter + def idempotency_key(self, idempotency_key): + """Sets the idempotency_key of this SubWorkflowParams. + + + :param idempotency_key: The idempotency_key of this SubWorkflowParams. # noqa: E501 + :type: str + """ + + self._idempotency_key = idempotency_key + + @property + def idempotency_strategy(self): + """Gets the idempotency_strategy of this SubWorkflowParams. # noqa: E501 + + + :return: The idempotency_strategy of this SubWorkflowParams. # noqa: E501 + :rtype: str + """ + return self._idempotency_strategy + + @idempotency_strategy.setter + def idempotency_strategy(self, idempotency_strategy): + """Sets the idempotency_strategy of this SubWorkflowParams. + + + :param idempotency_strategy: The idempotency_strategy of this SubWorkflowParams. # noqa: E501 + :type: str + """ + allowed_values = ["FAIL", "RETURN_EXISTING", "FAIL_ON_RUNNING"] # noqa: E501 + if idempotency_strategy not in allowed_values: + raise ValueError( + "Invalid value for `idempotency_strategy` ({0}), must be one of {1}" # noqa: E501 + .format(idempotency_strategy, allowed_values) + ) + + self._idempotency_strategy = idempotency_strategy + + @property + def name(self): + """Gets the name of this SubWorkflowParams. # noqa: E501 + + + :return: The name of this SubWorkflowParams. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SubWorkflowParams. + + + :param name: The name of this SubWorkflowParams. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def priority(self): + """Gets the priority of this SubWorkflowParams. # noqa: E501 + + + :return: The priority of this SubWorkflowParams. # noqa: E501 + :rtype: object + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this SubWorkflowParams. + + + :param priority: The priority of this SubWorkflowParams. # noqa: E501 + :type: object + """ + + self._priority = priority + + @property + def task_to_domain(self): + """Gets the task_to_domain of this SubWorkflowParams. # noqa: E501 + + + :return: The task_to_domain of this SubWorkflowParams. # noqa: E501 + :rtype: dict(str, str) + """ + return self._task_to_domain + + @task_to_domain.setter + def task_to_domain(self, task_to_domain): + """Sets the task_to_domain of this SubWorkflowParams. + + + :param task_to_domain: The task_to_domain of this SubWorkflowParams. # noqa: E501 + :type: dict(str, str) + """ + + self._task_to_domain = task_to_domain + + @property + def version(self): + """Gets the version of this SubWorkflowParams. # noqa: E501 + + + :return: The version of this SubWorkflowParams. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this SubWorkflowParams. + + + :param version: The version of this SubWorkflowParams. # noqa: E501 + :type: int + """ + + self._version = version + + @property + def workflow_definition(self): + """Gets the workflow_definition of this SubWorkflowParams. # noqa: E501 + + + :return: The workflow_definition of this SubWorkflowParams. # noqa: E501 + :rtype: object + """ + return self._workflow_definition + + @workflow_definition.setter + def workflow_definition(self, workflow_definition): + """Sets the workflow_definition of this SubWorkflowParams. + + + :param workflow_definition: The workflow_definition of this SubWorkflowParams. # noqa: E501 + :type: object + """ + + self._workflow_definition = workflow_definition + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SubWorkflowParams, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SubWorkflowParams): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/subject_ref.py b/src/conductor/client/codegen/models/subject_ref.py new file mode 100644 index 00000000..2c48a7ec --- /dev/null +++ b/src/conductor/client/codegen/models/subject_ref.py @@ -0,0 +1,143 @@ +# coding: utf-8 +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SubjectRef(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'type': 'str' + } + + attribute_map = { + 'id': 'id', + 'type': 'type' + } + + def __init__(self, id=None, type=None): # noqa: E501 + """SubjectRef - a model defined in Swagger""" # noqa: E501 + self._id = None + self._type = None + self.discriminator = None + if id is not None: + self.id = id + if type is not None: + self.type = type + + @property + def id(self): + """Gets the id of this SubjectRef. # noqa: E501 + + + :return: The id of this SubjectRef. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SubjectRef. + + + :param id: The id of this SubjectRef. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def type(self): + """Gets the type of this SubjectRef. # noqa: E501 + + User, role or group # noqa: E501 + + :return: The type of this SubjectRef. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SubjectRef. + + User, role or group # noqa: E501 + + :param type: The type of this SubjectRef. # noqa: E501 + :type: str + """ + allowed_values = ["USER", "ROLE", "GROUP"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SubjectRef, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SubjectRef): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/tag.py b/src/conductor/client/codegen/models/tag.py new file mode 100644 index 00000000..e1959bf9 --- /dev/null +++ b/src/conductor/client/codegen/models/tag.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Tag(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'key': 'str', + 'type': 'str', + 'value': 'str' + } + + attribute_map = { + 'key': 'key', + 'type': 'type', + 'value': 'value' + } + + def __init__(self, key=None, type=None, value=None): # noqa: E501 + """Tag - a model defined in Swagger""" # noqa: E501 + self._key = None + self._type = None + self._value = None + self.discriminator = None + if key is not None: + self.key = key + if type is not None: + self.type = type + if value is not None: + self.value = value + + @property + def key(self): + """Gets the key of this Tag. # noqa: E501 + + + :return: The key of this Tag. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this Tag. + + + :param key: The key of this Tag. # noqa: E501 + :type: str + """ + + self._key = key + + @property + def type(self): + """Gets the type of this Tag. # noqa: E501 + + + :return: The type of this Tag. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Tag. + + + :param type: The type of this Tag. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def value(self): + """Gets the value of this Tag. # noqa: E501 + + + :return: The value of this Tag. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this Tag. + + + :param value: The value of this Tag. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Tag, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Tag): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/tag_object.py b/src/conductor/client/codegen/models/tag_object.py new file mode 100644 index 00000000..0beee219 --- /dev/null +++ b/src/conductor/client/codegen/models/tag_object.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +import pprint +import re # noqa: F401 +import six +from dataclasses import dataclass, field, InitVar +from typing import Any, Dict, List, Optional +from enum import Enum +from deprecated import deprecated + +class TypeEnum(str, Enum): + METADATA = "METADATA" + RATE_LIMIT = "RATE_LIMIT" + +@dataclass +class TagObject: + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'key': 'str', + 'type': 'str', + 'value': 'object' + } + + attribute_map = { + 'key': 'key', + 'type': 'type', + 'value': 'value' + } + + # Dataclass fields + _key: Optional[str] = field(default=None) + _type: Optional[str] = field(default=None) + _value: Any = field(default=None) + + # InitVars for constructor parameters + key: InitVar[Optional[str]] = None + type: InitVar[Optional[str]] = None + value: InitVar[Any] = None + + discriminator: Optional[str] = field(default=None) + + def __init__(self, key=None, type=None, value=None): # noqa: E501 + """TagObject - a model defined in Swagger""" # noqa: E501 + self._key = None + self._type = None + self._value = None + self.discriminator = None + if key is not None: + self.key = key + if type is not None: + self.type = type + if value is not None: + self.value = value + + def __post_init__(self, key, type, value): + if key is not None: + self.key = key + if type is not None: + self.type = type + if value is not None: + self.value = value + + @property + def key(self): + """Gets the key of this TagObject. # noqa: E501 + + + :return: The key of this TagObject. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this TagObject. + + + :param key: The key of this TagObject. # noqa: E501 + :type: str + """ + + self._key = key + + @property + @deprecated("This field is deprecated in the Java SDK") + def type(self): + """Gets the type of this TagObject. # noqa: E501 + + + :return: The type of this TagObject. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + @deprecated("This field is deprecated in the Java SDK") + def type(self, type): + """Sets the type of this TagObject. + + + :param type: The type of this TagObject. # noqa: E501 + :type: str + """ + allowed_values = [TypeEnum.METADATA.value, TypeEnum.RATE_LIMIT.value] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def value(self): + """Gets the value of this TagObject. # noqa: E501 + + + :return: The value of this TagObject. # noqa: E501 + :rtype: object + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this TagObject. + + + :param value: The value of this TagObject. # noqa: E501 + :type: object + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TagObject, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TagObject): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/tag_string.py b/src/conductor/client/codegen/models/tag_string.py new file mode 100644 index 00000000..9325683f --- /dev/null +++ b/src/conductor/client/codegen/models/tag_string.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +import pprint +import re # noqa: F401 +import six +from dataclasses import dataclass, field, asdict, fields +from typing import Optional, Dict, List, Any +from enum import Enum +from deprecated import deprecated + + +class TypeEnum(str, Enum): + METADATA = "METADATA" + RATE_LIMIT = "RATE_LIMIT" + + +@dataclass +class TagString: + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + _key: Optional[str] = field(default=None, init=False, repr=False) + _type: Optional[str] = field(default=None, init=False, repr=False) + _value: Optional[str] = field(default=None, init=False, repr=False) + + swagger_types = { + 'key': 'str', + 'type': 'str', + 'value': 'str' + } + + attribute_map = { + 'key': 'key', + 'type': 'type', + 'value': 'value' + } + + discriminator: None = field(default=None, repr=False) + + def __init__(self, key=None, type=None, value=None): # noqa: E501 + """TagString - a model defined in Swagger""" # noqa: E501 + self._key = None + self._type = None + self._value = None + self.discriminator = None + if key is not None: + self.key = key + if type is not None: + self.type = type + if value is not None: + self.value = value + + def __post_init__(self): + """Initialize after dataclass initialization""" + pass + + @property + def key(self): + """Gets the key of this TagString. # noqa: E501 + + + :return: The key of this TagString. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this TagString. + + + :param key: The key of this TagString. # noqa: E501 + :type: str + """ + + self._key = key + + @property + @deprecated(reason="This field is deprecated in the Java SDK") + def type(self): + """Gets the type of this TagString. # noqa: E501 + + + :return: The type of this TagString. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + @deprecated(reason="This field is deprecated in the Java SDK") + def type(self, type): + """Sets the type of this TagString. + + + :param type: The type of this TagString. # noqa: E501 + :type: str + """ + allowed_values = [TypeEnum.METADATA.value, TypeEnum.RATE_LIMIT.value] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def value(self): + """Gets the value of this TagString. # noqa: E501 + + + :return: The value of this TagString. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this TagString. + + + :param value: The value of this TagString. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TagString, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TagString): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/target_ref.py b/src/conductor/client/codegen/models/target_ref.py new file mode 100644 index 00000000..b2dcdda1 --- /dev/null +++ b/src/conductor/client/codegen/models/target_ref.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" +import pprint +import re # noqa: F401 + +import six + +class TargetRef(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'type': 'str' + } + + attribute_map = { + 'id': 'id', + 'type': 'type' + } + + def __init__(self, id=None, type=None): # noqa: E501 + """TargetRef - a model defined in Swagger""" # noqa: E501 + self._id = None + self._type = None + self.discriminator = None + if id is not None: + self.id = id + self.type = type + + @property + def id(self): + """Gets the id of this TargetRef. # noqa: E501 + + + :return: The id of this TargetRef. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TargetRef. + + + :param id: The id of this TargetRef. # noqa: E501 + :type: str + """ + allowed_values = ["Identifier of the target e.g. `name` in case it's a WORKFLOW_DEF"] # noqa: E501 + if id not in allowed_values: + raise ValueError( + "Invalid value for `id` ({0}), must be one of {1}" # noqa: E501 + .format(id, allowed_values) + ) + + self._id = id + + @property + def type(self): + """Gets the type of this TargetRef. # noqa: E501 + + + :return: The type of this TargetRef. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this TargetRef. + + + :param type: The type of this TargetRef. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["WORKFLOW", "WORKFLOW_DEF", "WORKFLOW_SCHEDULE", "EVENT_HANDLER", "TASK_DEF", "TASK_REF_NAME", "TASK_ID", "APPLICATION", "USER", "SECRET_NAME", "ENV_VARIABLE", "TAG", "DOMAIN", "INTEGRATION_PROVIDER", "INTEGRATION", "PROMPT", "USER_FORM_TEMPLATE", "SCHEMA", "CLUSTER_CONFIG", "WEBHOOK"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TargetRef, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TargetRef): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/task.py b/src/conductor/client/codegen/models/task.py new file mode 100644 index 00000000..868fbaa7 --- /dev/null +++ b/src/conductor/client/codegen/models/task.py @@ -0,0 +1,1208 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Task(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'callback_after_seconds': 'int', + 'callback_from_worker': 'bool', + 'correlation_id': 'str', + 'domain': 'str', + 'end_time': 'int', + 'executed': 'bool', + 'execution_name_space': 'str', + 'external_input_payload_storage_path': 'str', + 'external_output_payload_storage_path': 'str', + 'first_start_time': 'int', + 'input_data': 'dict(str, object)', + 'isolation_group_id': 'str', + 'iteration': 'int', + 'loop_over_task': 'bool', + 'output_data': 'dict(str, object)', + 'parent_task_id': 'str', + 'poll_count': 'int', + 'queue_wait_time': 'int', + 'rate_limit_frequency_in_seconds': 'int', + 'rate_limit_per_frequency': 'int', + 'reason_for_incompletion': 'str', + 'reference_task_name': 'str', + 'response_timeout_seconds': 'int', + 'retried': 'bool', + 'retried_task_id': 'str', + 'retry_count': 'int', + 'scheduled_time': 'int', + 'seq': 'int', + 'start_delay_in_seconds': 'int', + 'start_time': 'int', + 'status': 'str', + 'sub_workflow_id': 'str', + 'subworkflow_changed': 'bool', + 'task_def_name': 'str', + 'task_definition': 'TaskDef', + 'task_id': 'str', + 'task_type': 'str', + 'update_time': 'int', + 'worker_id': 'str', + 'workflow_instance_id': 'str', + 'workflow_priority': 'int', + 'workflow_task': 'WorkflowTask', + 'workflow_type': 'str' + } + + attribute_map = { + 'callback_after_seconds': 'callbackAfterSeconds', + 'callback_from_worker': 'callbackFromWorker', + 'correlation_id': 'correlationId', + 'domain': 'domain', + 'end_time': 'endTime', + 'executed': 'executed', + 'execution_name_space': 'executionNameSpace', + 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', + 'external_output_payload_storage_path': 'externalOutputPayloadStoragePath', + 'first_start_time': 'firstStartTime', + 'input_data': 'inputData', + 'isolation_group_id': 'isolationGroupId', + 'iteration': 'iteration', + 'loop_over_task': 'loopOverTask', + 'output_data': 'outputData', + 'parent_task_id': 'parentTaskId', + 'poll_count': 'pollCount', + 'queue_wait_time': 'queueWaitTime', + 'rate_limit_frequency_in_seconds': 'rateLimitFrequencyInSeconds', + 'rate_limit_per_frequency': 'rateLimitPerFrequency', + 'reason_for_incompletion': 'reasonForIncompletion', + 'reference_task_name': 'referenceTaskName', + 'response_timeout_seconds': 'responseTimeoutSeconds', + 'retried': 'retried', + 'retried_task_id': 'retriedTaskId', + 'retry_count': 'retryCount', + 'scheduled_time': 'scheduledTime', + 'seq': 'seq', + 'start_delay_in_seconds': 'startDelayInSeconds', + 'start_time': 'startTime', + 'status': 'status', + 'sub_workflow_id': 'subWorkflowId', + 'subworkflow_changed': 'subworkflowChanged', + 'task_def_name': 'taskDefName', + 'task_definition': 'taskDefinition', + 'task_id': 'taskId', + 'task_type': 'taskType', + 'update_time': 'updateTime', + 'worker_id': 'workerId', + 'workflow_instance_id': 'workflowInstanceId', + 'workflow_priority': 'workflowPriority', + 'workflow_task': 'workflowTask', + 'workflow_type': 'workflowType' + } + + def __init__(self, callback_after_seconds=None, callback_from_worker=None, correlation_id=None, domain=None, end_time=None, executed=None, execution_name_space=None, external_input_payload_storage_path=None, external_output_payload_storage_path=None, first_start_time=None, input_data=None, isolation_group_id=None, iteration=None, loop_over_task=None, output_data=None, parent_task_id=None, poll_count=None, queue_wait_time=None, rate_limit_frequency_in_seconds=None, rate_limit_per_frequency=None, reason_for_incompletion=None, reference_task_name=None, response_timeout_seconds=None, retried=None, retried_task_id=None, retry_count=None, scheduled_time=None, seq=None, start_delay_in_seconds=None, start_time=None, status=None, sub_workflow_id=None, subworkflow_changed=None, task_def_name=None, task_definition=None, task_id=None, task_type=None, update_time=None, worker_id=None, workflow_instance_id=None, workflow_priority=None, workflow_task=None, workflow_type=None): # noqa: E501 + """Task - a model defined in Swagger""" # noqa: E501 + self._callback_after_seconds = None + self._callback_from_worker = None + self._correlation_id = None + self._domain = None + self._end_time = None + self._executed = None + self._execution_name_space = None + self._external_input_payload_storage_path = None + self._external_output_payload_storage_path = None + self._first_start_time = None + self._input_data = None + self._isolation_group_id = None + self._iteration = None + self._loop_over_task = None + self._output_data = None + self._parent_task_id = None + self._poll_count = None + self._queue_wait_time = None + self._rate_limit_frequency_in_seconds = None + self._rate_limit_per_frequency = None + self._reason_for_incompletion = None + self._reference_task_name = None + self._response_timeout_seconds = None + self._retried = None + self._retried_task_id = None + self._retry_count = None + self._scheduled_time = None + self._seq = None + self._start_delay_in_seconds = None + self._start_time = None + self._status = None + self._sub_workflow_id = None + self._subworkflow_changed = None + self._task_def_name = None + self._task_definition = None + self._task_id = None + self._task_type = None + self._update_time = None + self._worker_id = None + self._workflow_instance_id = None + self._workflow_priority = None + self._workflow_task = None + self._workflow_type = None + self.discriminator = None + if callback_after_seconds is not None: + self.callback_after_seconds = callback_after_seconds + if callback_from_worker is not None: + self.callback_from_worker = callback_from_worker + if correlation_id is not None: + self.correlation_id = correlation_id + if domain is not None: + self.domain = domain + if end_time is not None: + self.end_time = end_time + if executed is not None: + self.executed = executed + if execution_name_space is not None: + self.execution_name_space = execution_name_space + if external_input_payload_storage_path is not None: + self.external_input_payload_storage_path = external_input_payload_storage_path + if external_output_payload_storage_path is not None: + self.external_output_payload_storage_path = external_output_payload_storage_path + if first_start_time is not None: + self.first_start_time = first_start_time + if input_data is not None: + self.input_data = input_data + if isolation_group_id is not None: + self.isolation_group_id = isolation_group_id + if iteration is not None: + self.iteration = iteration + if loop_over_task is not None: + self.loop_over_task = loop_over_task + if output_data is not None: + self.output_data = output_data + if parent_task_id is not None: + self.parent_task_id = parent_task_id + if poll_count is not None: + self.poll_count = poll_count + if queue_wait_time is not None: + self.queue_wait_time = queue_wait_time + if rate_limit_frequency_in_seconds is not None: + self.rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds + if rate_limit_per_frequency is not None: + self.rate_limit_per_frequency = rate_limit_per_frequency + if reason_for_incompletion is not None: + self.reason_for_incompletion = reason_for_incompletion + if reference_task_name is not None: + self.reference_task_name = reference_task_name + if response_timeout_seconds is not None: + self.response_timeout_seconds = response_timeout_seconds + if retried is not None: + self.retried = retried + if retried_task_id is not None: + self.retried_task_id = retried_task_id + if retry_count is not None: + self.retry_count = retry_count + if scheduled_time is not None: + self.scheduled_time = scheduled_time + if seq is not None: + self.seq = seq + if start_delay_in_seconds is not None: + self.start_delay_in_seconds = start_delay_in_seconds + if start_time is not None: + self.start_time = start_time + if status is not None: + self.status = status + if sub_workflow_id is not None: + self.sub_workflow_id = sub_workflow_id + if subworkflow_changed is not None: + self.subworkflow_changed = subworkflow_changed + if task_def_name is not None: + self.task_def_name = task_def_name + if task_definition is not None: + self.task_definition = task_definition + if task_id is not None: + self.task_id = task_id + if task_type is not None: + self.task_type = task_type + if update_time is not None: + self.update_time = update_time + if worker_id is not None: + self.worker_id = worker_id + if workflow_instance_id is not None: + self.workflow_instance_id = workflow_instance_id + if workflow_priority is not None: + self.workflow_priority = workflow_priority + if workflow_task is not None: + self.workflow_task = workflow_task + if workflow_type is not None: + self.workflow_type = workflow_type + + @property + def callback_after_seconds(self): + """Gets the callback_after_seconds of this Task. # noqa: E501 + + + :return: The callback_after_seconds of this Task. # noqa: E501 + :rtype: int + """ + return self._callback_after_seconds + + @callback_after_seconds.setter + def callback_after_seconds(self, callback_after_seconds): + """Sets the callback_after_seconds of this Task. + + + :param callback_after_seconds: The callback_after_seconds of this Task. # noqa: E501 + :type: int + """ + + self._callback_after_seconds = callback_after_seconds + + @property + def callback_from_worker(self): + """Gets the callback_from_worker of this Task. # noqa: E501 + + + :return: The callback_from_worker of this Task. # noqa: E501 + :rtype: bool + """ + return self._callback_from_worker + + @callback_from_worker.setter + def callback_from_worker(self, callback_from_worker): + """Sets the callback_from_worker of this Task. + + + :param callback_from_worker: The callback_from_worker of this Task. # noqa: E501 + :type: bool + """ + + self._callback_from_worker = callback_from_worker + + @property + def correlation_id(self): + """Gets the correlation_id of this Task. # noqa: E501 + + + :return: The correlation_id of this Task. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this Task. + + + :param correlation_id: The correlation_id of this Task. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def domain(self): + """Gets the domain of this Task. # noqa: E501 + + + :return: The domain of this Task. # noqa: E501 + :rtype: str + """ + return self._domain + + @domain.setter + def domain(self, domain): + """Sets the domain of this Task. + + + :param domain: The domain of this Task. # noqa: E501 + :type: str + """ + + self._domain = domain + + @property + def end_time(self): + """Gets the end_time of this Task. # noqa: E501 + + + :return: The end_time of this Task. # noqa: E501 + :rtype: int + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this Task. + + + :param end_time: The end_time of this Task. # noqa: E501 + :type: int + """ + + self._end_time = end_time + + @property + def executed(self): + """Gets the executed of this Task. # noqa: E501 + + + :return: The executed of this Task. # noqa: E501 + :rtype: bool + """ + return self._executed + + @executed.setter + def executed(self, executed): + """Sets the executed of this Task. + + + :param executed: The executed of this Task. # noqa: E501 + :type: bool + """ + + self._executed = executed + + @property + def execution_name_space(self): + """Gets the execution_name_space of this Task. # noqa: E501 + + + :return: The execution_name_space of this Task. # noqa: E501 + :rtype: str + """ + return self._execution_name_space + + @execution_name_space.setter + def execution_name_space(self, execution_name_space): + """Sets the execution_name_space of this Task. + + + :param execution_name_space: The execution_name_space of this Task. # noqa: E501 + :type: str + """ + + self._execution_name_space = execution_name_space + + @property + def external_input_payload_storage_path(self): + """Gets the external_input_payload_storage_path of this Task. # noqa: E501 + + + :return: The external_input_payload_storage_path of this Task. # noqa: E501 + :rtype: str + """ + return self._external_input_payload_storage_path + + @external_input_payload_storage_path.setter + def external_input_payload_storage_path(self, external_input_payload_storage_path): + """Sets the external_input_payload_storage_path of this Task. + + + :param external_input_payload_storage_path: The external_input_payload_storage_path of this Task. # noqa: E501 + :type: str + """ + + self._external_input_payload_storage_path = external_input_payload_storage_path + + @property + def external_output_payload_storage_path(self): + """Gets the external_output_payload_storage_path of this Task. # noqa: E501 + + + :return: The external_output_payload_storage_path of this Task. # noqa: E501 + :rtype: str + """ + return self._external_output_payload_storage_path + + @external_output_payload_storage_path.setter + def external_output_payload_storage_path(self, external_output_payload_storage_path): + """Sets the external_output_payload_storage_path of this Task. + + + :param external_output_payload_storage_path: The external_output_payload_storage_path of this Task. # noqa: E501 + :type: str + """ + + self._external_output_payload_storage_path = external_output_payload_storage_path + + @property + def first_start_time(self): + """Gets the first_start_time of this Task. # noqa: E501 + + + :return: The first_start_time of this Task. # noqa: E501 + :rtype: int + """ + return self._first_start_time + + @first_start_time.setter + def first_start_time(self, first_start_time): + """Sets the first_start_time of this Task. + + + :param first_start_time: The first_start_time of this Task. # noqa: E501 + :type: int + """ + + self._first_start_time = first_start_time + + @property + def input_data(self): + """Gets the input_data of this Task. # noqa: E501 + + + :return: The input_data of this Task. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input_data + + @input_data.setter + def input_data(self, input_data): + """Sets the input_data of this Task. + + + :param input_data: The input_data of this Task. # noqa: E501 + :type: dict(str, object) + """ + + self._input_data = input_data + + @property + def isolation_group_id(self): + """Gets the isolation_group_id of this Task. # noqa: E501 + + + :return: The isolation_group_id of this Task. # noqa: E501 + :rtype: str + """ + return self._isolation_group_id + + @isolation_group_id.setter + def isolation_group_id(self, isolation_group_id): + """Sets the isolation_group_id of this Task. + + + :param isolation_group_id: The isolation_group_id of this Task. # noqa: E501 + :type: str + """ + + self._isolation_group_id = isolation_group_id + + @property + def iteration(self): + """Gets the iteration of this Task. # noqa: E501 + + + :return: The iteration of this Task. # noqa: E501 + :rtype: int + """ + return self._iteration + + @iteration.setter + def iteration(self, iteration): + """Sets the iteration of this Task. + + + :param iteration: The iteration of this Task. # noqa: E501 + :type: int + """ + + self._iteration = iteration + + @property + def loop_over_task(self): + """Gets the loop_over_task of this Task. # noqa: E501 + + + :return: The loop_over_task of this Task. # noqa: E501 + :rtype: bool + """ + return self._loop_over_task + + @loop_over_task.setter + def loop_over_task(self, loop_over_task): + """Sets the loop_over_task of this Task. + + + :param loop_over_task: The loop_over_task of this Task. # noqa: E501 + :type: bool + """ + + self._loop_over_task = loop_over_task + + @property + def output_data(self): + """Gets the output_data of this Task. # noqa: E501 + + + :return: The output_data of this Task. # noqa: E501 + :rtype: dict(str, object) + """ + return self._output_data + + @output_data.setter + def output_data(self, output_data): + """Sets the output_data of this Task. + + + :param output_data: The output_data of this Task. # noqa: E501 + :type: dict(str, object) + """ + + self._output_data = output_data + + @property + def parent_task_id(self): + """Gets the parent_task_id of this Task. # noqa: E501 + + + :return: The parent_task_id of this Task. # noqa: E501 + :rtype: str + """ + return self._parent_task_id + + @parent_task_id.setter + def parent_task_id(self, parent_task_id): + """Sets the parent_task_id of this Task. + + + :param parent_task_id: The parent_task_id of this Task. # noqa: E501 + :type: str + """ + + self._parent_task_id = parent_task_id + + @property + def poll_count(self): + """Gets the poll_count of this Task. # noqa: E501 + + + :return: The poll_count of this Task. # noqa: E501 + :rtype: int + """ + return self._poll_count + + @poll_count.setter + def poll_count(self, poll_count): + """Sets the poll_count of this Task. + + + :param poll_count: The poll_count of this Task. # noqa: E501 + :type: int + """ + + self._poll_count = poll_count + + @property + def queue_wait_time(self): + """Gets the queue_wait_time of this Task. # noqa: E501 + + + :return: The queue_wait_time of this Task. # noqa: E501 + :rtype: int + """ + return self._queue_wait_time + + @queue_wait_time.setter + def queue_wait_time(self, queue_wait_time): + """Sets the queue_wait_time of this Task. + + + :param queue_wait_time: The queue_wait_time of this Task. # noqa: E501 + :type: int + """ + + self._queue_wait_time = queue_wait_time + + @property + def rate_limit_frequency_in_seconds(self): + """Gets the rate_limit_frequency_in_seconds of this Task. # noqa: E501 + + + :return: The rate_limit_frequency_in_seconds of this Task. # noqa: E501 + :rtype: int + """ + return self._rate_limit_frequency_in_seconds + + @rate_limit_frequency_in_seconds.setter + def rate_limit_frequency_in_seconds(self, rate_limit_frequency_in_seconds): + """Sets the rate_limit_frequency_in_seconds of this Task. + + + :param rate_limit_frequency_in_seconds: The rate_limit_frequency_in_seconds of this Task. # noqa: E501 + :type: int + """ + + self._rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds + + @property + def rate_limit_per_frequency(self): + """Gets the rate_limit_per_frequency of this Task. # noqa: E501 + + + :return: The rate_limit_per_frequency of this Task. # noqa: E501 + :rtype: int + """ + return self._rate_limit_per_frequency + + @rate_limit_per_frequency.setter + def rate_limit_per_frequency(self, rate_limit_per_frequency): + """Sets the rate_limit_per_frequency of this Task. + + + :param rate_limit_per_frequency: The rate_limit_per_frequency of this Task. # noqa: E501 + :type: int + """ + + self._rate_limit_per_frequency = rate_limit_per_frequency + + @property + def reason_for_incompletion(self): + """Gets the reason_for_incompletion of this Task. # noqa: E501 + + + :return: The reason_for_incompletion of this Task. # noqa: E501 + :rtype: str + """ + return self._reason_for_incompletion + + @reason_for_incompletion.setter + def reason_for_incompletion(self, reason_for_incompletion): + """Sets the reason_for_incompletion of this Task. + + + :param reason_for_incompletion: The reason_for_incompletion of this Task. # noqa: E501 + :type: str + """ + + self._reason_for_incompletion = reason_for_incompletion + + @property + def reference_task_name(self): + """Gets the reference_task_name of this Task. # noqa: E501 + + + :return: The reference_task_name of this Task. # noqa: E501 + :rtype: str + """ + return self._reference_task_name + + @reference_task_name.setter + def reference_task_name(self, reference_task_name): + """Sets the reference_task_name of this Task. + + + :param reference_task_name: The reference_task_name of this Task. # noqa: E501 + :type: str + """ + + self._reference_task_name = reference_task_name + + @property + def response_timeout_seconds(self): + """Gets the response_timeout_seconds of this Task. # noqa: E501 + + + :return: The response_timeout_seconds of this Task. # noqa: E501 + :rtype: int + """ + return self._response_timeout_seconds + + @response_timeout_seconds.setter + def response_timeout_seconds(self, response_timeout_seconds): + """Sets the response_timeout_seconds of this Task. + + + :param response_timeout_seconds: The response_timeout_seconds of this Task. # noqa: E501 + :type: int + """ + + self._response_timeout_seconds = response_timeout_seconds + + @property + def retried(self): + """Gets the retried of this Task. # noqa: E501 + + + :return: The retried of this Task. # noqa: E501 + :rtype: bool + """ + return self._retried + + @retried.setter + def retried(self, retried): + """Sets the retried of this Task. + + + :param retried: The retried of this Task. # noqa: E501 + :type: bool + """ + + self._retried = retried + + @property + def retried_task_id(self): + """Gets the retried_task_id of this Task. # noqa: E501 + + + :return: The retried_task_id of this Task. # noqa: E501 + :rtype: str + """ + return self._retried_task_id + + @retried_task_id.setter + def retried_task_id(self, retried_task_id): + """Sets the retried_task_id of this Task. + + + :param retried_task_id: The retried_task_id of this Task. # noqa: E501 + :type: str + """ + + self._retried_task_id = retried_task_id + + @property + def retry_count(self): + """Gets the retry_count of this Task. # noqa: E501 + + + :return: The retry_count of this Task. # noqa: E501 + :rtype: int + """ + return self._retry_count + + @retry_count.setter + def retry_count(self, retry_count): + """Sets the retry_count of this Task. + + + :param retry_count: The retry_count of this Task. # noqa: E501 + :type: int + """ + + self._retry_count = retry_count + + @property + def scheduled_time(self): + """Gets the scheduled_time of this Task. # noqa: E501 + + + :return: The scheduled_time of this Task. # noqa: E501 + :rtype: int + """ + return self._scheduled_time + + @scheduled_time.setter + def scheduled_time(self, scheduled_time): + """Sets the scheduled_time of this Task. + + + :param scheduled_time: The scheduled_time of this Task. # noqa: E501 + :type: int + """ + + self._scheduled_time = scheduled_time + + @property + def seq(self): + """Gets the seq of this Task. # noqa: E501 + + + :return: The seq of this Task. # noqa: E501 + :rtype: int + """ + return self._seq + + @seq.setter + def seq(self, seq): + """Sets the seq of this Task. + + + :param seq: The seq of this Task. # noqa: E501 + :type: int + """ + + self._seq = seq + + @property + def start_delay_in_seconds(self): + """Gets the start_delay_in_seconds of this Task. # noqa: E501 + + + :return: The start_delay_in_seconds of this Task. # noqa: E501 + :rtype: int + """ + return self._start_delay_in_seconds + + @start_delay_in_seconds.setter + def start_delay_in_seconds(self, start_delay_in_seconds): + """Sets the start_delay_in_seconds of this Task. + + + :param start_delay_in_seconds: The start_delay_in_seconds of this Task. # noqa: E501 + :type: int + """ + + self._start_delay_in_seconds = start_delay_in_seconds + + @property + def start_time(self): + """Gets the start_time of this Task. # noqa: E501 + + + :return: The start_time of this Task. # noqa: E501 + :rtype: int + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this Task. + + + :param start_time: The start_time of this Task. # noqa: E501 + :type: int + """ + + self._start_time = start_time + + @property + def status(self): + """Gets the status of this Task. # noqa: E501 + + + :return: The status of this Task. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Task. + + + :param status: The status of this Task. # noqa: E501 + :type: str + """ + allowed_values = ["IN_PROGRESS", "CANCELED", "FAILED", "FAILED_WITH_TERMINAL_ERROR", "COMPLETED", "COMPLETED_WITH_ERRORS", "SCHEDULED", "TIMED_OUT", "SKIPPED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def sub_workflow_id(self): + """Gets the sub_workflow_id of this Task. # noqa: E501 + + + :return: The sub_workflow_id of this Task. # noqa: E501 + :rtype: str + """ + return self._sub_workflow_id + + @sub_workflow_id.setter + def sub_workflow_id(self, sub_workflow_id): + """Sets the sub_workflow_id of this Task. + + + :param sub_workflow_id: The sub_workflow_id of this Task. # noqa: E501 + :type: str + """ + + self._sub_workflow_id = sub_workflow_id + + @property + def subworkflow_changed(self): + """Gets the subworkflow_changed of this Task. # noqa: E501 + + + :return: The subworkflow_changed of this Task. # noqa: E501 + :rtype: bool + """ + return self._subworkflow_changed + + @subworkflow_changed.setter + def subworkflow_changed(self, subworkflow_changed): + """Sets the subworkflow_changed of this Task. + + + :param subworkflow_changed: The subworkflow_changed of this Task. # noqa: E501 + :type: bool + """ + + self._subworkflow_changed = subworkflow_changed + + @property + def task_def_name(self): + """Gets the task_def_name of this Task. # noqa: E501 + + + :return: The task_def_name of this Task. # noqa: E501 + :rtype: str + """ + return self._task_def_name + + @task_def_name.setter + def task_def_name(self, task_def_name): + """Sets the task_def_name of this Task. + + + :param task_def_name: The task_def_name of this Task. # noqa: E501 + :type: str + """ + + self._task_def_name = task_def_name + + @property + def task_definition(self): + """Gets the task_definition of this Task. # noqa: E501 + + + :return: The task_definition of this Task. # noqa: E501 + :rtype: TaskDef + """ + return self._task_definition + + @task_definition.setter + def task_definition(self, task_definition): + """Sets the task_definition of this Task. + + + :param task_definition: The task_definition of this Task. # noqa: E501 + :type: TaskDef + """ + + self._task_definition = task_definition + + @property + def task_id(self): + """Gets the task_id of this Task. # noqa: E501 + + + :return: The task_id of this Task. # noqa: E501 + :rtype: str + """ + return self._task_id + + @task_id.setter + def task_id(self, task_id): + """Sets the task_id of this Task. + + + :param task_id: The task_id of this Task. # noqa: E501 + :type: str + """ + + self._task_id = task_id + + @property + def task_type(self): + """Gets the task_type of this Task. # noqa: E501 + + + :return: The task_type of this Task. # noqa: E501 + :rtype: str + """ + return self._task_type + + @task_type.setter + def task_type(self, task_type): + """Sets the task_type of this Task. + + + :param task_type: The task_type of this Task. # noqa: E501 + :type: str + """ + + self._task_type = task_type + + @property + def update_time(self): + """Gets the update_time of this Task. # noqa: E501 + + + :return: The update_time of this Task. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this Task. + + + :param update_time: The update_time of this Task. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def worker_id(self): + """Gets the worker_id of this Task. # noqa: E501 + + + :return: The worker_id of this Task. # noqa: E501 + :rtype: str + """ + return self._worker_id + + @worker_id.setter + def worker_id(self, worker_id): + """Sets the worker_id of this Task. + + + :param worker_id: The worker_id of this Task. # noqa: E501 + :type: str + """ + + self._worker_id = worker_id + + @property + def workflow_instance_id(self): + """Gets the workflow_instance_id of this Task. # noqa: E501 + + + :return: The workflow_instance_id of this Task. # noqa: E501 + :rtype: str + """ + return self._workflow_instance_id + + @workflow_instance_id.setter + def workflow_instance_id(self, workflow_instance_id): + """Sets the workflow_instance_id of this Task. + + + :param workflow_instance_id: The workflow_instance_id of this Task. # noqa: E501 + :type: str + """ + + self._workflow_instance_id = workflow_instance_id + + @property + def workflow_priority(self): + """Gets the workflow_priority of this Task. # noqa: E501 + + + :return: The workflow_priority of this Task. # noqa: E501 + :rtype: int + """ + return self._workflow_priority + + @workflow_priority.setter + def workflow_priority(self, workflow_priority): + """Sets the workflow_priority of this Task. + + + :param workflow_priority: The workflow_priority of this Task. # noqa: E501 + :type: int + """ + + self._workflow_priority = workflow_priority + + @property + def workflow_task(self): + """Gets the workflow_task of this Task. # noqa: E501 + + + :return: The workflow_task of this Task. # noqa: E501 + :rtype: WorkflowTask + """ + return self._workflow_task + + @workflow_task.setter + def workflow_task(self, workflow_task): + """Sets the workflow_task of this Task. + + + :param workflow_task: The workflow_task of this Task. # noqa: E501 + :type: WorkflowTask + """ + + self._workflow_task = workflow_task + + @property + def workflow_type(self): + """Gets the workflow_type of this Task. # noqa: E501 + + + :return: The workflow_type of this Task. # noqa: E501 + :rtype: str + """ + return self._workflow_type + + @workflow_type.setter + def workflow_type(self, workflow_type): + """Sets the workflow_type of this Task. + + + :param workflow_type: The workflow_type of this Task. # noqa: E501 + :type: str + """ + + self._workflow_type = workflow_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Task, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Task): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/task_def.py b/src/conductor/client/codegen/models/task_def.py new file mode 100644 index 00000000..9615eb0d --- /dev/null +++ b/src/conductor/client/codegen/models/task_def.py @@ -0,0 +1,852 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TaskDef(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'backoff_scale_factor': 'int', + 'base_type': 'str', + 'concurrent_exec_limit': 'int', + 'create_time': 'int', + 'created_by': 'str', + 'description': 'str', + 'enforce_schema': 'bool', + 'execution_name_space': 'str', + 'input_keys': 'list[str]', + 'input_schema': 'SchemaDef', + 'input_template': 'dict(str, object)', + 'isolation_group_id': 'str', + 'name': 'str', + 'output_keys': 'list[str]', + 'output_schema': 'SchemaDef', + 'owner_app': 'str', + 'owner_email': 'str', + 'poll_timeout_seconds': 'int', + 'rate_limit_frequency_in_seconds': 'int', + 'rate_limit_per_frequency': 'int', + 'response_timeout_seconds': 'int', + 'retry_count': 'int', + 'retry_delay_seconds': 'int', + 'retry_logic': 'str', + 'timeout_policy': 'str', + 'timeout_seconds': 'int', + 'total_timeout_seconds': 'int', + 'update_time': 'int', + 'updated_by': 'str' + } + + attribute_map = { + 'backoff_scale_factor': 'backoffScaleFactor', + 'base_type': 'baseType', + 'concurrent_exec_limit': 'concurrentExecLimit', + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'description': 'description', + 'enforce_schema': 'enforceSchema', + 'execution_name_space': 'executionNameSpace', + 'input_keys': 'inputKeys', + 'input_schema': 'inputSchema', + 'input_template': 'inputTemplate', + 'isolation_group_id': 'isolationGroupId', + 'name': 'name', + 'output_keys': 'outputKeys', + 'output_schema': 'outputSchema', + 'owner_app': 'ownerApp', + 'owner_email': 'ownerEmail', + 'poll_timeout_seconds': 'pollTimeoutSeconds', + 'rate_limit_frequency_in_seconds': 'rateLimitFrequencyInSeconds', + 'rate_limit_per_frequency': 'rateLimitPerFrequency', + 'response_timeout_seconds': 'responseTimeoutSeconds', + 'retry_count': 'retryCount', + 'retry_delay_seconds': 'retryDelaySeconds', + 'retry_logic': 'retryLogic', + 'timeout_policy': 'timeoutPolicy', + 'timeout_seconds': 'timeoutSeconds', + 'total_timeout_seconds': 'totalTimeoutSeconds', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy' + } + + def __init__(self, backoff_scale_factor=None, base_type=None, concurrent_exec_limit=None, create_time=None, created_by=None, description=None, enforce_schema=None, execution_name_space=None, input_keys=None, input_schema=None, input_template=None, isolation_group_id=None, name=None, output_keys=None, output_schema=None, owner_app=None, owner_email=None, poll_timeout_seconds=None, rate_limit_frequency_in_seconds=None, rate_limit_per_frequency=None, response_timeout_seconds=None, retry_count=None, retry_delay_seconds=None, retry_logic=None, timeout_policy=None, timeout_seconds=None, total_timeout_seconds=None, update_time=None, updated_by=None): # noqa: E501 + """TaskDef - a model defined in Swagger""" # noqa: E501 + self._backoff_scale_factor = None + self._base_type = None + self._concurrent_exec_limit = None + self._create_time = None + self._created_by = None + self._description = None + self._enforce_schema = None + self._execution_name_space = None + self._input_keys = None + self._input_schema = None + self._input_template = None + self._isolation_group_id = None + self._name = None + self._output_keys = None + self._output_schema = None + self._owner_app = None + self._owner_email = None + self._poll_timeout_seconds = None + self._rate_limit_frequency_in_seconds = None + self._rate_limit_per_frequency = None + self._response_timeout_seconds = None + self._retry_count = None + self._retry_delay_seconds = None + self._retry_logic = None + self._timeout_policy = None + self._timeout_seconds = None + self._total_timeout_seconds = None + self._update_time = None + self._updated_by = None + self.discriminator = None + if backoff_scale_factor is not None: + self.backoff_scale_factor = backoff_scale_factor + if base_type is not None: + self.base_type = base_type + if concurrent_exec_limit is not None: + self.concurrent_exec_limit = concurrent_exec_limit + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if description is not None: + self.description = description + if enforce_schema is not None: + self.enforce_schema = enforce_schema + if execution_name_space is not None: + self.execution_name_space = execution_name_space + if input_keys is not None: + self.input_keys = input_keys + if input_schema is not None: + self.input_schema = input_schema + if input_template is not None: + self.input_template = input_template + if isolation_group_id is not None: + self.isolation_group_id = isolation_group_id + if name is not None: + self.name = name + if output_keys is not None: + self.output_keys = output_keys + if output_schema is not None: + self.output_schema = output_schema + if owner_app is not None: + self.owner_app = owner_app + if owner_email is not None: + self.owner_email = owner_email + if poll_timeout_seconds is not None: + self.poll_timeout_seconds = poll_timeout_seconds + if rate_limit_frequency_in_seconds is not None: + self.rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds + if rate_limit_per_frequency is not None: + self.rate_limit_per_frequency = rate_limit_per_frequency + if response_timeout_seconds is not None: + self.response_timeout_seconds = response_timeout_seconds + if retry_count is not None: + self.retry_count = retry_count + if retry_delay_seconds is not None: + self.retry_delay_seconds = retry_delay_seconds + if retry_logic is not None: + self.retry_logic = retry_logic + if timeout_policy is not None: + self.timeout_policy = timeout_policy + self.timeout_seconds = timeout_seconds + self.total_timeout_seconds = total_timeout_seconds + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + + @property + def backoff_scale_factor(self): + """Gets the backoff_scale_factor of this TaskDef. # noqa: E501 + + + :return: The backoff_scale_factor of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._backoff_scale_factor + + @backoff_scale_factor.setter + def backoff_scale_factor(self, backoff_scale_factor): + """Sets the backoff_scale_factor of this TaskDef. + + + :param backoff_scale_factor: The backoff_scale_factor of this TaskDef. # noqa: E501 + :type: int + """ + + self._backoff_scale_factor = backoff_scale_factor + + @property + def base_type(self): + """Gets the base_type of this TaskDef. # noqa: E501 + + + :return: The base_type of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._base_type + + @base_type.setter + def base_type(self, base_type): + """Sets the base_type of this TaskDef. + + + :param base_type: The base_type of this TaskDef. # noqa: E501 + :type: str + """ + + self._base_type = base_type + + @property + def concurrent_exec_limit(self): + """Gets the concurrent_exec_limit of this TaskDef. # noqa: E501 + + + :return: The concurrent_exec_limit of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._concurrent_exec_limit + + @concurrent_exec_limit.setter + def concurrent_exec_limit(self, concurrent_exec_limit): + """Sets the concurrent_exec_limit of this TaskDef. + + + :param concurrent_exec_limit: The concurrent_exec_limit of this TaskDef. # noqa: E501 + :type: int + """ + + self._concurrent_exec_limit = concurrent_exec_limit + + @property + def create_time(self): + """Gets the create_time of this TaskDef. # noqa: E501 + + + :return: The create_time of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this TaskDef. + + + :param create_time: The create_time of this TaskDef. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this TaskDef. # noqa: E501 + + + :return: The created_by of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this TaskDef. + + + :param created_by: The created_by of this TaskDef. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def description(self): + """Gets the description of this TaskDef. # noqa: E501 + + + :return: The description of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this TaskDef. + + + :param description: The description of this TaskDef. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def enforce_schema(self): + """Gets the enforce_schema of this TaskDef. # noqa: E501 + + + :return: The enforce_schema of this TaskDef. # noqa: E501 + :rtype: bool + """ + return self._enforce_schema + + @enforce_schema.setter + def enforce_schema(self, enforce_schema): + """Sets the enforce_schema of this TaskDef. + + + :param enforce_schema: The enforce_schema of this TaskDef. # noqa: E501 + :type: bool + """ + + self._enforce_schema = enforce_schema + + @property + def execution_name_space(self): + """Gets the execution_name_space of this TaskDef. # noqa: E501 + + + :return: The execution_name_space of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._execution_name_space + + @execution_name_space.setter + def execution_name_space(self, execution_name_space): + """Sets the execution_name_space of this TaskDef. + + + :param execution_name_space: The execution_name_space of this TaskDef. # noqa: E501 + :type: str + """ + + self._execution_name_space = execution_name_space + + @property + def input_keys(self): + """Gets the input_keys of this TaskDef. # noqa: E501 + + + :return: The input_keys of this TaskDef. # noqa: E501 + :rtype: list[str] + """ + return self._input_keys + + @input_keys.setter + def input_keys(self, input_keys): + """Sets the input_keys of this TaskDef. + + + :param input_keys: The input_keys of this TaskDef. # noqa: E501 + :type: list[str] + """ + + self._input_keys = input_keys + + @property + def input_schema(self): + """Gets the input_schema of this TaskDef. # noqa: E501 + + + :return: The input_schema of this TaskDef. # noqa: E501 + :rtype: SchemaDef + """ + return self._input_schema + + @input_schema.setter + def input_schema(self, input_schema): + """Sets the input_schema of this TaskDef. + + + :param input_schema: The input_schema of this TaskDef. # noqa: E501 + :type: SchemaDef + """ + + self._input_schema = input_schema + + @property + def input_template(self): + """Gets the input_template of this TaskDef. # noqa: E501 + + + :return: The input_template of this TaskDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input_template + + @input_template.setter + def input_template(self, input_template): + """Sets the input_template of this TaskDef. + + + :param input_template: The input_template of this TaskDef. # noqa: E501 + :type: dict(str, object) + """ + + self._input_template = input_template + + @property + def isolation_group_id(self): + """Gets the isolation_group_id of this TaskDef. # noqa: E501 + + + :return: The isolation_group_id of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._isolation_group_id + + @isolation_group_id.setter + def isolation_group_id(self, isolation_group_id): + """Sets the isolation_group_id of this TaskDef. + + + :param isolation_group_id: The isolation_group_id of this TaskDef. # noqa: E501 + :type: str + """ + + self._isolation_group_id = isolation_group_id + + @property + def name(self): + """Gets the name of this TaskDef. # noqa: E501 + + + :return: The name of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TaskDef. + + + :param name: The name of this TaskDef. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def output_keys(self): + """Gets the output_keys of this TaskDef. # noqa: E501 + + + :return: The output_keys of this TaskDef. # noqa: E501 + :rtype: list[str] + """ + return self._output_keys + + @output_keys.setter + def output_keys(self, output_keys): + """Sets the output_keys of this TaskDef. + + + :param output_keys: The output_keys of this TaskDef. # noqa: E501 + :type: list[str] + """ + + self._output_keys = output_keys + + @property + def output_schema(self): + """Gets the output_schema of this TaskDef. # noqa: E501 + + + :return: The output_schema of this TaskDef. # noqa: E501 + :rtype: SchemaDef + """ + return self._output_schema + + @output_schema.setter + def output_schema(self, output_schema): + """Sets the output_schema of this TaskDef. + + + :param output_schema: The output_schema of this TaskDef. # noqa: E501 + :type: SchemaDef + """ + + self._output_schema = output_schema + + @property + def owner_app(self): + """Gets the owner_app of this TaskDef. # noqa: E501 + + + :return: The owner_app of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._owner_app + + @owner_app.setter + def owner_app(self, owner_app): + """Sets the owner_app of this TaskDef. + + + :param owner_app: The owner_app of this TaskDef. # noqa: E501 + :type: str + """ + + self._owner_app = owner_app + + @property + def owner_email(self): + """Gets the owner_email of this TaskDef. # noqa: E501 + + + :return: The owner_email of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._owner_email + + @owner_email.setter + def owner_email(self, owner_email): + """Sets the owner_email of this TaskDef. + + + :param owner_email: The owner_email of this TaskDef. # noqa: E501 + :type: str + """ + + self._owner_email = owner_email + + @property + def poll_timeout_seconds(self): + """Gets the poll_timeout_seconds of this TaskDef. # noqa: E501 + + + :return: The poll_timeout_seconds of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._poll_timeout_seconds + + @poll_timeout_seconds.setter + def poll_timeout_seconds(self, poll_timeout_seconds): + """Sets the poll_timeout_seconds of this TaskDef. + + + :param poll_timeout_seconds: The poll_timeout_seconds of this TaskDef. # noqa: E501 + :type: int + """ + + self._poll_timeout_seconds = poll_timeout_seconds + + @property + def rate_limit_frequency_in_seconds(self): + """Gets the rate_limit_frequency_in_seconds of this TaskDef. # noqa: E501 + + + :return: The rate_limit_frequency_in_seconds of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._rate_limit_frequency_in_seconds + + @rate_limit_frequency_in_seconds.setter + def rate_limit_frequency_in_seconds(self, rate_limit_frequency_in_seconds): + """Sets the rate_limit_frequency_in_seconds of this TaskDef. + + + :param rate_limit_frequency_in_seconds: The rate_limit_frequency_in_seconds of this TaskDef. # noqa: E501 + :type: int + """ + + self._rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds + + @property + def rate_limit_per_frequency(self): + """Gets the rate_limit_per_frequency of this TaskDef. # noqa: E501 + + + :return: The rate_limit_per_frequency of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._rate_limit_per_frequency + + @rate_limit_per_frequency.setter + def rate_limit_per_frequency(self, rate_limit_per_frequency): + """Sets the rate_limit_per_frequency of this TaskDef. + + + :param rate_limit_per_frequency: The rate_limit_per_frequency of this TaskDef. # noqa: E501 + :type: int + """ + + self._rate_limit_per_frequency = rate_limit_per_frequency + + @property + def response_timeout_seconds(self): + """Gets the response_timeout_seconds of this TaskDef. # noqa: E501 + + + :return: The response_timeout_seconds of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._response_timeout_seconds + + @response_timeout_seconds.setter + def response_timeout_seconds(self, response_timeout_seconds): + """Sets the response_timeout_seconds of this TaskDef. + + + :param response_timeout_seconds: The response_timeout_seconds of this TaskDef. # noqa: E501 + :type: int + """ + + self._response_timeout_seconds = response_timeout_seconds + + @property + def retry_count(self): + """Gets the retry_count of this TaskDef. # noqa: E501 + + + :return: The retry_count of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._retry_count + + @retry_count.setter + def retry_count(self, retry_count): + """Sets the retry_count of this TaskDef. + + + :param retry_count: The retry_count of this TaskDef. # noqa: E501 + :type: int + """ + + self._retry_count = retry_count + + @property + def retry_delay_seconds(self): + """Gets the retry_delay_seconds of this TaskDef. # noqa: E501 + + + :return: The retry_delay_seconds of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._retry_delay_seconds + + @retry_delay_seconds.setter + def retry_delay_seconds(self, retry_delay_seconds): + """Sets the retry_delay_seconds of this TaskDef. + + + :param retry_delay_seconds: The retry_delay_seconds of this TaskDef. # noqa: E501 + :type: int + """ + + self._retry_delay_seconds = retry_delay_seconds + + @property + def retry_logic(self): + """Gets the retry_logic of this TaskDef. # noqa: E501 + + + :return: The retry_logic of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._retry_logic + + @retry_logic.setter + def retry_logic(self, retry_logic): + """Sets the retry_logic of this TaskDef. + + + :param retry_logic: The retry_logic of this TaskDef. # noqa: E501 + :type: str + """ + allowed_values = ["FIXED", "EXPONENTIAL_BACKOFF", "LINEAR_BACKOFF"] # noqa: E501 + if retry_logic not in allowed_values: + raise ValueError( + "Invalid value for `retry_logic` ({0}), must be one of {1}" # noqa: E501 + .format(retry_logic, allowed_values) + ) + + self._retry_logic = retry_logic + + @property + def timeout_policy(self): + """Gets the timeout_policy of this TaskDef. # noqa: E501 + + + :return: The timeout_policy of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._timeout_policy + + @timeout_policy.setter + def timeout_policy(self, timeout_policy): + """Sets the timeout_policy of this TaskDef. + + + :param timeout_policy: The timeout_policy of this TaskDef. # noqa: E501 + :type: str + """ + allowed_values = ["RETRY", "TIME_OUT_WF", "ALERT_ONLY"] # noqa: E501 + if timeout_policy not in allowed_values: + raise ValueError( + "Invalid value for `timeout_policy` ({0}), must be one of {1}" # noqa: E501 + .format(timeout_policy, allowed_values) + ) + + self._timeout_policy = timeout_policy + + @property + def timeout_seconds(self): + """Gets the timeout_seconds of this TaskDef. # noqa: E501 + + + :return: The timeout_seconds of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._timeout_seconds + + @timeout_seconds.setter + def timeout_seconds(self, timeout_seconds): + """Sets the timeout_seconds of this TaskDef. + + + :param timeout_seconds: The timeout_seconds of this TaskDef. # noqa: E501 + :type: int + """ + if timeout_seconds is None: + raise ValueError("Invalid value for `timeout_seconds`, must not be `None`") # noqa: E501 + + self._timeout_seconds = timeout_seconds + + @property + def total_timeout_seconds(self): + """Gets the total_timeout_seconds of this TaskDef. # noqa: E501 + + + :return: The total_timeout_seconds of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._total_timeout_seconds + + @total_timeout_seconds.setter + def total_timeout_seconds(self, total_timeout_seconds): + """Sets the total_timeout_seconds of this TaskDef. + + + :param total_timeout_seconds: The total_timeout_seconds of this TaskDef. # noqa: E501 + :type: int + """ + if total_timeout_seconds is None: + raise ValueError("Invalid value for `total_timeout_seconds`, must not be `None`") # noqa: E501 + + self._total_timeout_seconds = total_timeout_seconds + + @property + def update_time(self): + """Gets the update_time of this TaskDef. # noqa: E501 + + + :return: The update_time of this TaskDef. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this TaskDef. + + + :param update_time: The update_time of this TaskDef. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this TaskDef. # noqa: E501 + + + :return: The updated_by of this TaskDef. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this TaskDef. + + + :param updated_by: The updated_by of this TaskDef. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TaskDef, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TaskDef): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/task_details.py b/src/conductor/client/codegen/models/task_details.py new file mode 100644 index 00000000..b8e2126c --- /dev/null +++ b/src/conductor/client/codegen/models/task_details.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TaskDetails(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'output': 'dict(str, object)', + 'output_message': 'Any', + 'task_id': 'str', + 'task_ref_name': 'str', + 'workflow_id': 'str' + } + + attribute_map = { + 'output': 'output', + 'output_message': 'outputMessage', + 'task_id': 'taskId', + 'task_ref_name': 'taskRefName', + 'workflow_id': 'workflowId' + } + + def __init__(self, output=None, output_message=None, task_id=None, task_ref_name=None, workflow_id=None): # noqa: E501 + """TaskDetails - a model defined in Swagger""" # noqa: E501 + self._output = None + self._output_message = None + self._task_id = None + self._task_ref_name = None + self._workflow_id = None + self.discriminator = None + if output is not None: + self.output = output + if output_message is not None: + self.output_message = output_message + if task_id is not None: + self.task_id = task_id + if task_ref_name is not None: + self.task_ref_name = task_ref_name + if workflow_id is not None: + self.workflow_id = workflow_id + + @property + def output(self): + """Gets the output of this TaskDetails. # noqa: E501 + + + :return: The output of this TaskDetails. # noqa: E501 + :rtype: dict(str, object) + """ + return self._output + + @output.setter + def output(self, output): + """Sets the output of this TaskDetails. + + + :param output: The output of this TaskDetails. # noqa: E501 + :type: dict(str, object) + """ + + self._output = output + + @property + def output_message(self): + """Gets the output_message of this TaskDetails. # noqa: E501 + + + :return: The output_message of this TaskDetails. # noqa: E501 + :rtype: Any + """ + return self._output_message + + @output_message.setter + def output_message(self, output_message): + """Sets the output_message of this TaskDetails. + + + :param output_message: The output_message of this TaskDetails. # noqa: E501 + :type: Any + """ + + self._output_message = output_message + + @property + def task_id(self): + """Gets the task_id of this TaskDetails. # noqa: E501 + + + :return: The task_id of this TaskDetails. # noqa: E501 + :rtype: str + """ + return self._task_id + + @task_id.setter + def task_id(self, task_id): + """Sets the task_id of this TaskDetails. + + + :param task_id: The task_id of this TaskDetails. # noqa: E501 + :type: str + """ + + self._task_id = task_id + + @property + def task_ref_name(self): + """Gets the task_ref_name of this TaskDetails. # noqa: E501 + + + :return: The task_ref_name of this TaskDetails. # noqa: E501 + :rtype: str + """ + return self._task_ref_name + + @task_ref_name.setter + def task_ref_name(self, task_ref_name): + """Sets the task_ref_name of this TaskDetails. + + + :param task_ref_name: The task_ref_name of this TaskDetails. # noqa: E501 + :type: str + """ + + self._task_ref_name = task_ref_name + + @property + def workflow_id(self): + """Gets the workflow_id of this TaskDetails. # noqa: E501 + + + :return: The workflow_id of this TaskDetails. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this TaskDetails. + + + :param workflow_id: The workflow_id of this TaskDetails. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TaskDetails, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TaskDetails): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/task_exec_log.py b/src/conductor/client/codegen/models/task_exec_log.py new file mode 100644 index 00000000..b519889e --- /dev/null +++ b/src/conductor/client/codegen/models/task_exec_log.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TaskExecLog(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_time': 'int', + 'log': 'str', + 'task_id': 'str' + } + + attribute_map = { + 'created_time': 'createdTime', + 'log': 'log', + 'task_id': 'taskId' + } + + def __init__(self, created_time=None, log=None, task_id=None): # noqa: E501 + """TaskExecLog - a model defined in Swagger""" # noqa: E501 + self._created_time = None + self._log = None + self._task_id = None + self.discriminator = None + if created_time is not None: + self.created_time = created_time + if log is not None: + self.log = log + if task_id is not None: + self.task_id = task_id + + @property + def created_time(self): + """Gets the created_time of this TaskExecLog. # noqa: E501 + + + :return: The created_time of this TaskExecLog. # noqa: E501 + :rtype: int + """ + return self._created_time + + @created_time.setter + def created_time(self, created_time): + """Sets the created_time of this TaskExecLog. + + + :param created_time: The created_time of this TaskExecLog. # noqa: E501 + :type: int + """ + + self._created_time = created_time + + @property + def log(self): + """Gets the log of this TaskExecLog. # noqa: E501 + + + :return: The log of this TaskExecLog. # noqa: E501 + :rtype: str + """ + return self._log + + @log.setter + def log(self, log): + """Sets the log of this TaskExecLog. + + + :param log: The log of this TaskExecLog. # noqa: E501 + :type: str + """ + + self._log = log + + @property + def task_id(self): + """Gets the task_id of this TaskExecLog. # noqa: E501 + + + :return: The task_id of this TaskExecLog. # noqa: E501 + :rtype: str + """ + return self._task_id + + @task_id.setter + def task_id(self, task_id): + """Sets the task_id of this TaskExecLog. + + + :param task_id: The task_id of this TaskExecLog. # noqa: E501 + :type: str + """ + + self._task_id = task_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TaskExecLog, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TaskExecLog): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/task_list_search_result_summary.py b/src/conductor/client/codegen/models/task_list_search_result_summary.py new file mode 100644 index 00000000..97e1004b --- /dev/null +++ b/src/conductor/client/codegen/models/task_list_search_result_summary.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TaskListSearchResultSummary(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[Task]', + 'summary': 'dict(str, int)', + 'total_hits': 'int' + } + + attribute_map = { + 'results': 'results', + 'summary': 'summary', + 'total_hits': 'totalHits' + } + + def __init__(self, results=None, summary=None, total_hits=None): # noqa: E501 + """TaskListSearchResultSummary - a model defined in Swagger""" # noqa: E501 + self._results = None + self._summary = None + self._total_hits = None + self.discriminator = None + if results is not None: + self.results = results + if summary is not None: + self.summary = summary + if total_hits is not None: + self.total_hits = total_hits + + @property + def results(self): + """Gets the results of this TaskListSearchResultSummary. # noqa: E501 + + + :return: The results of this TaskListSearchResultSummary. # noqa: E501 + :rtype: list[Task] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this TaskListSearchResultSummary. + + + :param results: The results of this TaskListSearchResultSummary. # noqa: E501 + :type: list[Task] + """ + + self._results = results + + @property + def summary(self): + """Gets the summary of this TaskListSearchResultSummary. # noqa: E501 + + + :return: The summary of this TaskListSearchResultSummary. # noqa: E501 + :rtype: dict(str, int) + """ + return self._summary + + @summary.setter + def summary(self, summary): + """Sets the summary of this TaskListSearchResultSummary. + + + :param summary: The summary of this TaskListSearchResultSummary. # noqa: E501 + :type: dict(str, int) + """ + + self._summary = summary + + @property + def total_hits(self): + """Gets the total_hits of this TaskListSearchResultSummary. # noqa: E501 + + + :return: The total_hits of this TaskListSearchResultSummary. # noqa: E501 + :rtype: int + """ + return self._total_hits + + @total_hits.setter + def total_hits(self, total_hits): + """Sets the total_hits of this TaskListSearchResultSummary. + + + :param total_hits: The total_hits of this TaskListSearchResultSummary. # noqa: E501 + :type: int + """ + + self._total_hits = total_hits + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TaskListSearchResultSummary, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TaskListSearchResultSummary): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/task_mock.py b/src/conductor/client/codegen/models/task_mock.py new file mode 100644 index 00000000..08bc1893 --- /dev/null +++ b/src/conductor/client/codegen/models/task_mock.py @@ -0,0 +1,194 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TaskMock(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'execution_time': 'int', + 'output': 'dict(str, object)', + 'queue_wait_time': 'int', + 'status': 'str' + } + + attribute_map = { + 'execution_time': 'executionTime', + 'output': 'output', + 'queue_wait_time': 'queueWaitTime', + 'status': 'status' + } + + def __init__(self, execution_time=None, output=None, queue_wait_time=None, status=None): # noqa: E501 + """TaskMock - a model defined in Swagger""" # noqa: E501 + self._execution_time = None + self._output = None + self._queue_wait_time = None + self._status = None + self.discriminator = None + if execution_time is not None: + self.execution_time = execution_time + if output is not None: + self.output = output + if queue_wait_time is not None: + self.queue_wait_time = queue_wait_time + if status is not None: + self.status = status + + @property + def execution_time(self): + """Gets the execution_time of this TaskMock. # noqa: E501 + + + :return: The execution_time of this TaskMock. # noqa: E501 + :rtype: int + """ + return self._execution_time + + @execution_time.setter + def execution_time(self, execution_time): + """Sets the execution_time of this TaskMock. + + + :param execution_time: The execution_time of this TaskMock. # noqa: E501 + :type: int + """ + + self._execution_time = execution_time + + @property + def output(self): + """Gets the output of this TaskMock. # noqa: E501 + + + :return: The output of this TaskMock. # noqa: E501 + :rtype: dict(str, object) + """ + return self._output + + @output.setter + def output(self, output): + """Sets the output of this TaskMock. + + + :param output: The output of this TaskMock. # noqa: E501 + :type: dict(str, object) + """ + + self._output = output + + @property + def queue_wait_time(self): + """Gets the queue_wait_time of this TaskMock. # noqa: E501 + + + :return: The queue_wait_time of this TaskMock. # noqa: E501 + :rtype: int + """ + return self._queue_wait_time + + @queue_wait_time.setter + def queue_wait_time(self, queue_wait_time): + """Sets the queue_wait_time of this TaskMock. + + + :param queue_wait_time: The queue_wait_time of this TaskMock. # noqa: E501 + :type: int + """ + + self._queue_wait_time = queue_wait_time + + @property + def status(self): + """Gets the status of this TaskMock. # noqa: E501 + + + :return: The status of this TaskMock. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this TaskMock. + + + :param status: The status of this TaskMock. # noqa: E501 + :type: str + """ + allowed_values = ["IN_PROGRESS", "FAILED", "FAILED_WITH_TERMINAL_ERROR", "COMPLETED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TaskMock, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TaskMock): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/task_result.py b/src/conductor/client/codegen/models/task_result.py new file mode 100644 index 00000000..f964bb7d --- /dev/null +++ b/src/conductor/client/codegen/models/task_result.py @@ -0,0 +1,376 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TaskResult(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'callback_after_seconds': 'int', + 'extend_lease': 'bool', + 'external_output_payload_storage_path': 'str', + 'logs': 'list[TaskExecLog]', + 'output_data': 'dict(str, object)', + 'reason_for_incompletion': 'str', + 'status': 'str', + 'sub_workflow_id': 'str', + 'task_id': 'str', + 'worker_id': 'str', + 'workflow_instance_id': 'str' + } + + attribute_map = { + 'callback_after_seconds': 'callbackAfterSeconds', + 'extend_lease': 'extendLease', + 'external_output_payload_storage_path': 'externalOutputPayloadStoragePath', + 'logs': 'logs', + 'output_data': 'outputData', + 'reason_for_incompletion': 'reasonForIncompletion', + 'status': 'status', + 'sub_workflow_id': 'subWorkflowId', + 'task_id': 'taskId', + 'worker_id': 'workerId', + 'workflow_instance_id': 'workflowInstanceId' + } + + def __init__(self, callback_after_seconds=None, extend_lease=None, external_output_payload_storage_path=None, logs=None, output_data=None, reason_for_incompletion=None, status=None, sub_workflow_id=None, task_id=None, worker_id=None, workflow_instance_id=None): # noqa: E501 + """TaskResult - a model defined in Swagger""" # noqa: E501 + self._callback_after_seconds = None + self._extend_lease = None + self._external_output_payload_storage_path = None + self._logs = None + self._output_data = None + self._reason_for_incompletion = None + self._status = None + self._sub_workflow_id = None + self._task_id = None + self._worker_id = None + self._workflow_instance_id = None + self.discriminator = None + if callback_after_seconds is not None: + self.callback_after_seconds = callback_after_seconds + if extend_lease is not None: + self.extend_lease = extend_lease + if external_output_payload_storage_path is not None: + self.external_output_payload_storage_path = external_output_payload_storage_path + if logs is not None: + self.logs = logs + if output_data is not None: + self.output_data = output_data + if reason_for_incompletion is not None: + self.reason_for_incompletion = reason_for_incompletion + if status is not None: + self.status = status + if sub_workflow_id is not None: + self.sub_workflow_id = sub_workflow_id + if task_id is not None: + self.task_id = task_id + if worker_id is not None: + self.worker_id = worker_id + if workflow_instance_id is not None: + self.workflow_instance_id = workflow_instance_id + + @property + def callback_after_seconds(self): + """Gets the callback_after_seconds of this TaskResult. # noqa: E501 + + + :return: The callback_after_seconds of this TaskResult. # noqa: E501 + :rtype: int + """ + return self._callback_after_seconds + + @callback_after_seconds.setter + def callback_after_seconds(self, callback_after_seconds): + """Sets the callback_after_seconds of this TaskResult. + + + :param callback_after_seconds: The callback_after_seconds of this TaskResult. # noqa: E501 + :type: int + """ + + self._callback_after_seconds = callback_after_seconds + + @property + def extend_lease(self): + """Gets the extend_lease of this TaskResult. # noqa: E501 + + + :return: The extend_lease of this TaskResult. # noqa: E501 + :rtype: bool + """ + return self._extend_lease + + @extend_lease.setter + def extend_lease(self, extend_lease): + """Sets the extend_lease of this TaskResult. + + + :param extend_lease: The extend_lease of this TaskResult. # noqa: E501 + :type: bool + """ + + self._extend_lease = extend_lease + + @property + def external_output_payload_storage_path(self): + """Gets the external_output_payload_storage_path of this TaskResult. # noqa: E501 + + + :return: The external_output_payload_storage_path of this TaskResult. # noqa: E501 + :rtype: str + """ + return self._external_output_payload_storage_path + + @external_output_payload_storage_path.setter + def external_output_payload_storage_path(self, external_output_payload_storage_path): + """Sets the external_output_payload_storage_path of this TaskResult. + + + :param external_output_payload_storage_path: The external_output_payload_storage_path of this TaskResult. # noqa: E501 + :type: str + """ + + self._external_output_payload_storage_path = external_output_payload_storage_path + + @property + def logs(self): + """Gets the logs of this TaskResult. # noqa: E501 + + + :return: The logs of this TaskResult. # noqa: E501 + :rtype: list[TaskExecLog] + """ + return self._logs + + @logs.setter + def logs(self, logs): + """Sets the logs of this TaskResult. + + + :param logs: The logs of this TaskResult. # noqa: E501 + :type: list[TaskExecLog] + """ + + self._logs = logs + + @property + def output_data(self): + """Gets the output_data of this TaskResult. # noqa: E501 + + + :return: The output_data of this TaskResult. # noqa: E501 + :rtype: dict(str, object) + """ + return self._output_data + + @output_data.setter + def output_data(self, output_data): + """Sets the output_data of this TaskResult. + + + :param output_data: The output_data of this TaskResult. # noqa: E501 + :type: dict(str, object) + """ + + self._output_data = output_data + + @property + def reason_for_incompletion(self): + """Gets the reason_for_incompletion of this TaskResult. # noqa: E501 + + + :return: The reason_for_incompletion of this TaskResult. # noqa: E501 + :rtype: str + """ + return self._reason_for_incompletion + + @reason_for_incompletion.setter + def reason_for_incompletion(self, reason_for_incompletion): + """Sets the reason_for_incompletion of this TaskResult. + + + :param reason_for_incompletion: The reason_for_incompletion of this TaskResult. # noqa: E501 + :type: str + """ + + self._reason_for_incompletion = reason_for_incompletion + + @property + def status(self): + """Gets the status of this TaskResult. # noqa: E501 + + + :return: The status of this TaskResult. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this TaskResult. + + + :param status: The status of this TaskResult. # noqa: E501 + :type: str + """ + allowed_values = ["IN_PROGRESS", "FAILED", "FAILED_WITH_TERMINAL_ERROR", "COMPLETED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def sub_workflow_id(self): + """Gets the sub_workflow_id of this TaskResult. # noqa: E501 + + + :return: The sub_workflow_id of this TaskResult. # noqa: E501 + :rtype: str + """ + return self._sub_workflow_id + + @sub_workflow_id.setter + def sub_workflow_id(self, sub_workflow_id): + """Sets the sub_workflow_id of this TaskResult. + + + :param sub_workflow_id: The sub_workflow_id of this TaskResult. # noqa: E501 + :type: str + """ + + self._sub_workflow_id = sub_workflow_id + + @property + def task_id(self): + """Gets the task_id of this TaskResult. # noqa: E501 + + + :return: The task_id of this TaskResult. # noqa: E501 + :rtype: str + """ + return self._task_id + + @task_id.setter + def task_id(self, task_id): + """Sets the task_id of this TaskResult. + + + :param task_id: The task_id of this TaskResult. # noqa: E501 + :type: str + """ + + self._task_id = task_id + + @property + def worker_id(self): + """Gets the worker_id of this TaskResult. # noqa: E501 + + + :return: The worker_id of this TaskResult. # noqa: E501 + :rtype: str + """ + return self._worker_id + + @worker_id.setter + def worker_id(self, worker_id): + """Sets the worker_id of this TaskResult. + + + :param worker_id: The worker_id of this TaskResult. # noqa: E501 + :type: str + """ + + self._worker_id = worker_id + + @property + def workflow_instance_id(self): + """Gets the workflow_instance_id of this TaskResult. # noqa: E501 + + + :return: The workflow_instance_id of this TaskResult. # noqa: E501 + :rtype: str + """ + return self._workflow_instance_id + + @workflow_instance_id.setter + def workflow_instance_id(self, workflow_instance_id): + """Sets the workflow_instance_id of this TaskResult. + + + :param workflow_instance_id: The workflow_instance_id of this TaskResult. # noqa: E501 + :type: str + """ + + self._workflow_instance_id = workflow_instance_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TaskResult, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TaskResult): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/task_summary.py b/src/conductor/client/codegen/models/task_summary.py new file mode 100644 index 00000000..de442d67 --- /dev/null +++ b/src/conductor/client/codegen/models/task_summary.py @@ -0,0 +1,610 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TaskSummary(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'correlation_id': 'str', + 'end_time': 'str', + 'execution_time': 'int', + 'external_input_payload_storage_path': 'str', + 'external_output_payload_storage_path': 'str', + 'input': 'str', + 'output': 'str', + 'queue_wait_time': 'int', + 'reason_for_incompletion': 'str', + 'scheduled_time': 'str', + 'start_time': 'str', + 'status': 'str', + 'task_def_name': 'str', + 'task_id': 'str', + 'task_reference_name': 'str', + 'task_type': 'str', + 'update_time': 'str', + 'workflow_id': 'str', + 'workflow_priority': 'int', + 'workflow_type': 'str' + } + + attribute_map = { + 'correlation_id': 'correlationId', + 'end_time': 'endTime', + 'execution_time': 'executionTime', + 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', + 'external_output_payload_storage_path': 'externalOutputPayloadStoragePath', + 'input': 'input', + 'output': 'output', + 'queue_wait_time': 'queueWaitTime', + 'reason_for_incompletion': 'reasonForIncompletion', + 'scheduled_time': 'scheduledTime', + 'start_time': 'startTime', + 'status': 'status', + 'task_def_name': 'taskDefName', + 'task_id': 'taskId', + 'task_reference_name': 'taskReferenceName', + 'task_type': 'taskType', + 'update_time': 'updateTime', + 'workflow_id': 'workflowId', + 'workflow_priority': 'workflowPriority', + 'workflow_type': 'workflowType' + } + + def __init__(self, correlation_id=None, end_time=None, execution_time=None, external_input_payload_storage_path=None, external_output_payload_storage_path=None, input=None, output=None, queue_wait_time=None, reason_for_incompletion=None, scheduled_time=None, start_time=None, status=None, task_def_name=None, task_id=None, task_reference_name=None, task_type=None, update_time=None, workflow_id=None, workflow_priority=None, workflow_type=None): # noqa: E501 + """TaskSummary - a model defined in Swagger""" # noqa: E501 + self._correlation_id = None + self._end_time = None + self._execution_time = None + self._external_input_payload_storage_path = None + self._external_output_payload_storage_path = None + self._input = None + self._output = None + self._queue_wait_time = None + self._reason_for_incompletion = None + self._scheduled_time = None + self._start_time = None + self._status = None + self._task_def_name = None + self._task_id = None + self._task_reference_name = None + self._task_type = None + self._update_time = None + self._workflow_id = None + self._workflow_priority = None + self._workflow_type = None + self.discriminator = None + if correlation_id is not None: + self.correlation_id = correlation_id + if end_time is not None: + self.end_time = end_time + if execution_time is not None: + self.execution_time = execution_time + if external_input_payload_storage_path is not None: + self.external_input_payload_storage_path = external_input_payload_storage_path + if external_output_payload_storage_path is not None: + self.external_output_payload_storage_path = external_output_payload_storage_path + if input is not None: + self.input = input + if output is not None: + self.output = output + if queue_wait_time is not None: + self.queue_wait_time = queue_wait_time + if reason_for_incompletion is not None: + self.reason_for_incompletion = reason_for_incompletion + if scheduled_time is not None: + self.scheduled_time = scheduled_time + if start_time is not None: + self.start_time = start_time + if status is not None: + self.status = status + if task_def_name is not None: + self.task_def_name = task_def_name + if task_id is not None: + self.task_id = task_id + if task_reference_name is not None: + self.task_reference_name = task_reference_name + if task_type is not None: + self.task_type = task_type + if update_time is not None: + self.update_time = update_time + if workflow_id is not None: + self.workflow_id = workflow_id + if workflow_priority is not None: + self.workflow_priority = workflow_priority + if workflow_type is not None: + self.workflow_type = workflow_type + + @property + def correlation_id(self): + """Gets the correlation_id of this TaskSummary. # noqa: E501 + + + :return: The correlation_id of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this TaskSummary. + + + :param correlation_id: The correlation_id of this TaskSummary. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def end_time(self): + """Gets the end_time of this TaskSummary. # noqa: E501 + + + :return: The end_time of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this TaskSummary. + + + :param end_time: The end_time of this TaskSummary. # noqa: E501 + :type: str + """ + + self._end_time = end_time + + @property + def execution_time(self): + """Gets the execution_time of this TaskSummary. # noqa: E501 + + + :return: The execution_time of this TaskSummary. # noqa: E501 + :rtype: int + """ + return self._execution_time + + @execution_time.setter + def execution_time(self, execution_time): + """Sets the execution_time of this TaskSummary. + + + :param execution_time: The execution_time of this TaskSummary. # noqa: E501 + :type: int + """ + + self._execution_time = execution_time + + @property + def external_input_payload_storage_path(self): + """Gets the external_input_payload_storage_path of this TaskSummary. # noqa: E501 + + + :return: The external_input_payload_storage_path of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._external_input_payload_storage_path + + @external_input_payload_storage_path.setter + def external_input_payload_storage_path(self, external_input_payload_storage_path): + """Sets the external_input_payload_storage_path of this TaskSummary. + + + :param external_input_payload_storage_path: The external_input_payload_storage_path of this TaskSummary. # noqa: E501 + :type: str + """ + + self._external_input_payload_storage_path = external_input_payload_storage_path + + @property + def external_output_payload_storage_path(self): + """Gets the external_output_payload_storage_path of this TaskSummary. # noqa: E501 + + + :return: The external_output_payload_storage_path of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._external_output_payload_storage_path + + @external_output_payload_storage_path.setter + def external_output_payload_storage_path(self, external_output_payload_storage_path): + """Sets the external_output_payload_storage_path of this TaskSummary. + + + :param external_output_payload_storage_path: The external_output_payload_storage_path of this TaskSummary. # noqa: E501 + :type: str + """ + + self._external_output_payload_storage_path = external_output_payload_storage_path + + @property + def input(self): + """Gets the input of this TaskSummary. # noqa: E501 + + + :return: The input of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._input + + @input.setter + def input(self, input): + """Sets the input of this TaskSummary. + + + :param input: The input of this TaskSummary. # noqa: E501 + :type: str + """ + + self._input = input + + @property + def output(self): + """Gets the output of this TaskSummary. # noqa: E501 + + + :return: The output of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._output + + @output.setter + def output(self, output): + """Sets the output of this TaskSummary. + + + :param output: The output of this TaskSummary. # noqa: E501 + :type: str + """ + + self._output = output + + @property + def queue_wait_time(self): + """Gets the queue_wait_time of this TaskSummary. # noqa: E501 + + + :return: The queue_wait_time of this TaskSummary. # noqa: E501 + :rtype: int + """ + return self._queue_wait_time + + @queue_wait_time.setter + def queue_wait_time(self, queue_wait_time): + """Sets the queue_wait_time of this TaskSummary. + + + :param queue_wait_time: The queue_wait_time of this TaskSummary. # noqa: E501 + :type: int + """ + + self._queue_wait_time = queue_wait_time + + @property + def reason_for_incompletion(self): + """Gets the reason_for_incompletion of this TaskSummary. # noqa: E501 + + + :return: The reason_for_incompletion of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._reason_for_incompletion + + @reason_for_incompletion.setter + def reason_for_incompletion(self, reason_for_incompletion): + """Sets the reason_for_incompletion of this TaskSummary. + + + :param reason_for_incompletion: The reason_for_incompletion of this TaskSummary. # noqa: E501 + :type: str + """ + + self._reason_for_incompletion = reason_for_incompletion + + @property + def scheduled_time(self): + """Gets the scheduled_time of this TaskSummary. # noqa: E501 + + + :return: The scheduled_time of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._scheduled_time + + @scheduled_time.setter + def scheduled_time(self, scheduled_time): + """Sets the scheduled_time of this TaskSummary. + + + :param scheduled_time: The scheduled_time of this TaskSummary. # noqa: E501 + :type: str + """ + + self._scheduled_time = scheduled_time + + @property + def start_time(self): + """Gets the start_time of this TaskSummary. # noqa: E501 + + + :return: The start_time of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this TaskSummary. + + + :param start_time: The start_time of this TaskSummary. # noqa: E501 + :type: str + """ + + self._start_time = start_time + + @property + def status(self): + """Gets the status of this TaskSummary. # noqa: E501 + + + :return: The status of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this TaskSummary. + + + :param status: The status of this TaskSummary. # noqa: E501 + :type: str + """ + allowed_values = ["IN_PROGRESS", "CANCELED", "FAILED", "FAILED_WITH_TERMINAL_ERROR", "COMPLETED", "COMPLETED_WITH_ERRORS", "SCHEDULED", "TIMED_OUT", "SKIPPED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def task_def_name(self): + """Gets the task_def_name of this TaskSummary. # noqa: E501 + + + :return: The task_def_name of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._task_def_name + + @task_def_name.setter + def task_def_name(self, task_def_name): + """Sets the task_def_name of this TaskSummary. + + + :param task_def_name: The task_def_name of this TaskSummary. # noqa: E501 + :type: str + """ + + self._task_def_name = task_def_name + + @property + def task_id(self): + """Gets the task_id of this TaskSummary. # noqa: E501 + + + :return: The task_id of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._task_id + + @task_id.setter + def task_id(self, task_id): + """Sets the task_id of this TaskSummary. + + + :param task_id: The task_id of this TaskSummary. # noqa: E501 + :type: str + """ + + self._task_id = task_id + + @property + def task_reference_name(self): + """Gets the task_reference_name of this TaskSummary. # noqa: E501 + + + :return: The task_reference_name of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._task_reference_name + + @task_reference_name.setter + def task_reference_name(self, task_reference_name): + """Sets the task_reference_name of this TaskSummary. + + + :param task_reference_name: The task_reference_name of this TaskSummary. # noqa: E501 + :type: str + """ + + self._task_reference_name = task_reference_name + + @property + def task_type(self): + """Gets the task_type of this TaskSummary. # noqa: E501 + + + :return: The task_type of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._task_type + + @task_type.setter + def task_type(self, task_type): + """Sets the task_type of this TaskSummary. + + + :param task_type: The task_type of this TaskSummary. # noqa: E501 + :type: str + """ + + self._task_type = task_type + + @property + def update_time(self): + """Gets the update_time of this TaskSummary. # noqa: E501 + + + :return: The update_time of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this TaskSummary. + + + :param update_time: The update_time of this TaskSummary. # noqa: E501 + :type: str + """ + + self._update_time = update_time + + @property + def workflow_id(self): + """Gets the workflow_id of this TaskSummary. # noqa: E501 + + + :return: The workflow_id of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this TaskSummary. + + + :param workflow_id: The workflow_id of this TaskSummary. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + @property + def workflow_priority(self): + """Gets the workflow_priority of this TaskSummary. # noqa: E501 + + + :return: The workflow_priority of this TaskSummary. # noqa: E501 + :rtype: int + """ + return self._workflow_priority + + @workflow_priority.setter + def workflow_priority(self, workflow_priority): + """Sets the workflow_priority of this TaskSummary. + + + :param workflow_priority: The workflow_priority of this TaskSummary. # noqa: E501 + :type: int + """ + + self._workflow_priority = workflow_priority + + @property + def workflow_type(self): + """Gets the workflow_type of this TaskSummary. # noqa: E501 + + + :return: The workflow_type of this TaskSummary. # noqa: E501 + :rtype: str + """ + return self._workflow_type + + @workflow_type.setter + def workflow_type(self, workflow_type): + """Sets the workflow_type of this TaskSummary. + + + :param workflow_type: The workflow_type of this TaskSummary. # noqa: E501 + :type: str + """ + + self._workflow_type = workflow_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TaskSummary, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TaskSummary): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/terminate_workflow.py b/src/conductor/client/codegen/models/terminate_workflow.py new file mode 100644 index 00000000..cd304928 --- /dev/null +++ b/src/conductor/client/codegen/models/terminate_workflow.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TerminateWorkflow(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'termination_reason': 'str', + 'workflow_id': 'str' + } + + attribute_map = { + 'termination_reason': 'terminationReason', + 'workflow_id': 'workflowId' + } + + def __init__(self, termination_reason=None, workflow_id=None): # noqa: E501 + """TerminateWorkflow - a model defined in Swagger""" # noqa: E501 + self._termination_reason = None + self._workflow_id = None + self.discriminator = None + if termination_reason is not None: + self.termination_reason = termination_reason + if workflow_id is not None: + self.workflow_id = workflow_id + + @property + def termination_reason(self): + """Gets the termination_reason of this TerminateWorkflow. # noqa: E501 + + + :return: The termination_reason of this TerminateWorkflow. # noqa: E501 + :rtype: str + """ + return self._termination_reason + + @termination_reason.setter + def termination_reason(self, termination_reason): + """Sets the termination_reason of this TerminateWorkflow. + + + :param termination_reason: The termination_reason of this TerminateWorkflow. # noqa: E501 + :type: str + """ + + self._termination_reason = termination_reason + + @property + def workflow_id(self): + """Gets the workflow_id of this TerminateWorkflow. # noqa: E501 + + + :return: The workflow_id of this TerminateWorkflow. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this TerminateWorkflow. + + + :param workflow_id: The workflow_id of this TerminateWorkflow. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TerminateWorkflow, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TerminateWorkflow): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/token.py b/src/conductor/client/codegen/models/token.py new file mode 100644 index 00000000..069f95ff --- /dev/null +++ b/src/conductor/client/codegen/models/token.py @@ -0,0 +1,21 @@ +class Token(object): + swagger_types = { + 'token': 'str' + } + + attribute_map = { + 'token': 'token' + } + + def __init__(self, token: str = None): + self.token = None + if token is not None: + self.token = token + + @property + def token(self) -> str: + return self._token + + @token.setter + def token(self, token: str): + self._token = token \ No newline at end of file diff --git a/src/conductor/client/codegen/models/uninterpreted_option.py b/src/conductor/client/codegen/models/uninterpreted_option.py new file mode 100644 index 00000000..20813cc0 --- /dev/null +++ b/src/conductor/client/codegen/models/uninterpreted_option.py @@ -0,0 +1,604 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UninterpretedOption(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'aggregate_value': 'str', + 'aggregate_value_bytes': 'ByteString', + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'UninterpretedOption', + 'descriptor_for_type': 'Descriptor', + 'double_value': 'float', + 'identifier_value': 'str', + 'identifier_value_bytes': 'ByteString', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'memoized_serialized_size': 'int', + 'name_count': 'int', + 'name_list': 'list[NamePart]', + 'name_or_builder_list': 'list[NamePartOrBuilder]', + 'negative_int_value': 'int', + 'parser_for_type': 'ParserUninterpretedOption', + 'positive_int_value': 'int', + 'serialized_size': 'int', + 'string_value': 'ByteString', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'aggregate_value': 'aggregateValue', + 'aggregate_value_bytes': 'aggregateValueBytes', + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'double_value': 'doubleValue', + 'identifier_value': 'identifierValue', + 'identifier_value_bytes': 'identifierValueBytes', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'memoized_serialized_size': 'memoizedSerializedSize', + 'name_count': 'nameCount', + 'name_list': 'nameList', + 'name_or_builder_list': 'nameOrBuilderList', + 'negative_int_value': 'negativeIntValue', + 'parser_for_type': 'parserForType', + 'positive_int_value': 'positiveIntValue', + 'serialized_size': 'serializedSize', + 'string_value': 'stringValue', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, aggregate_value=None, aggregate_value_bytes=None, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, double_value=None, identifier_value=None, identifier_value_bytes=None, initialization_error_string=None, initialized=None, memoized_serialized_size=None, name_count=None, name_list=None, name_or_builder_list=None, negative_int_value=None, parser_for_type=None, positive_int_value=None, serialized_size=None, string_value=None, unknown_fields=None): # noqa: E501 + """UninterpretedOption - a model defined in Swagger""" # noqa: E501 + self._aggregate_value = None + self._aggregate_value_bytes = None + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._double_value = None + self._identifier_value = None + self._identifier_value_bytes = None + self._initialization_error_string = None + self._initialized = None + self._memoized_serialized_size = None + self._name_count = None + self._name_list = None + self._name_or_builder_list = None + self._negative_int_value = None + self._parser_for_type = None + self._positive_int_value = None + self._serialized_size = None + self._string_value = None + self._unknown_fields = None + self.discriminator = None + if aggregate_value is not None: + self.aggregate_value = aggregate_value + if aggregate_value_bytes is not None: + self.aggregate_value_bytes = aggregate_value_bytes + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if double_value is not None: + self.double_value = double_value + if identifier_value is not None: + self.identifier_value = identifier_value + if identifier_value_bytes is not None: + self.identifier_value_bytes = identifier_value_bytes + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if memoized_serialized_size is not None: + self.memoized_serialized_size = memoized_serialized_size + if name_count is not None: + self.name_count = name_count + if name_list is not None: + self.name_list = name_list + if name_or_builder_list is not None: + self.name_or_builder_list = name_or_builder_list + if negative_int_value is not None: + self.negative_int_value = negative_int_value + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if positive_int_value is not None: + self.positive_int_value = positive_int_value + if serialized_size is not None: + self.serialized_size = serialized_size + if string_value is not None: + self.string_value = string_value + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def aggregate_value(self): + """Gets the aggregate_value of this UninterpretedOption. # noqa: E501 + + + :return: The aggregate_value of this UninterpretedOption. # noqa: E501 + :rtype: str + """ + return self._aggregate_value + + @aggregate_value.setter + def aggregate_value(self, aggregate_value): + """Sets the aggregate_value of this UninterpretedOption. + + + :param aggregate_value: The aggregate_value of this UninterpretedOption. # noqa: E501 + :type: str + """ + + self._aggregate_value = aggregate_value + + @property + def aggregate_value_bytes(self): + """Gets the aggregate_value_bytes of this UninterpretedOption. # noqa: E501 + + + :return: The aggregate_value_bytes of this UninterpretedOption. # noqa: E501 + :rtype: ByteString + """ + return self._aggregate_value_bytes + + @aggregate_value_bytes.setter + def aggregate_value_bytes(self, aggregate_value_bytes): + """Sets the aggregate_value_bytes of this UninterpretedOption. + + + :param aggregate_value_bytes: The aggregate_value_bytes of this UninterpretedOption. # noqa: E501 + :type: ByteString + """ + + self._aggregate_value_bytes = aggregate_value_bytes + + @property + def all_fields(self): + """Gets the all_fields of this UninterpretedOption. # noqa: E501 + + + :return: The all_fields of this UninterpretedOption. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this UninterpretedOption. + + + :param all_fields: The all_fields of this UninterpretedOption. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this UninterpretedOption. # noqa: E501 + + + :return: The default_instance_for_type of this UninterpretedOption. # noqa: E501 + :rtype: UninterpretedOption + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this UninterpretedOption. + + + :param default_instance_for_type: The default_instance_for_type of this UninterpretedOption. # noqa: E501 + :type: UninterpretedOption + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this UninterpretedOption. # noqa: E501 + + + :return: The descriptor_for_type of this UninterpretedOption. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this UninterpretedOption. + + + :param descriptor_for_type: The descriptor_for_type of this UninterpretedOption. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def double_value(self): + """Gets the double_value of this UninterpretedOption. # noqa: E501 + + + :return: The double_value of this UninterpretedOption. # noqa: E501 + :rtype: float + """ + return self._double_value + + @double_value.setter + def double_value(self, double_value): + """Sets the double_value of this UninterpretedOption. + + + :param double_value: The double_value of this UninterpretedOption. # noqa: E501 + :type: float + """ + + self._double_value = double_value + + @property + def identifier_value(self): + """Gets the identifier_value of this UninterpretedOption. # noqa: E501 + + + :return: The identifier_value of this UninterpretedOption. # noqa: E501 + :rtype: str + """ + return self._identifier_value + + @identifier_value.setter + def identifier_value(self, identifier_value): + """Sets the identifier_value of this UninterpretedOption. + + + :param identifier_value: The identifier_value of this UninterpretedOption. # noqa: E501 + :type: str + """ + + self._identifier_value = identifier_value + + @property + def identifier_value_bytes(self): + """Gets the identifier_value_bytes of this UninterpretedOption. # noqa: E501 + + + :return: The identifier_value_bytes of this UninterpretedOption. # noqa: E501 + :rtype: ByteString + """ + return self._identifier_value_bytes + + @identifier_value_bytes.setter + def identifier_value_bytes(self, identifier_value_bytes): + """Sets the identifier_value_bytes of this UninterpretedOption. + + + :param identifier_value_bytes: The identifier_value_bytes of this UninterpretedOption. # noqa: E501 + :type: ByteString + """ + + self._identifier_value_bytes = identifier_value_bytes + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this UninterpretedOption. # noqa: E501 + + + :return: The initialization_error_string of this UninterpretedOption. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this UninterpretedOption. + + + :param initialization_error_string: The initialization_error_string of this UninterpretedOption. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this UninterpretedOption. # noqa: E501 + + + :return: The initialized of this UninterpretedOption. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this UninterpretedOption. + + + :param initialized: The initialized of this UninterpretedOption. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def memoized_serialized_size(self): + """Gets the memoized_serialized_size of this UninterpretedOption. # noqa: E501 + + + :return: The memoized_serialized_size of this UninterpretedOption. # noqa: E501 + :rtype: int + """ + return self._memoized_serialized_size + + @memoized_serialized_size.setter + def memoized_serialized_size(self, memoized_serialized_size): + """Sets the memoized_serialized_size of this UninterpretedOption. + + + :param memoized_serialized_size: The memoized_serialized_size of this UninterpretedOption. # noqa: E501 + :type: int + """ + + self._memoized_serialized_size = memoized_serialized_size + + @property + def name_count(self): + """Gets the name_count of this UninterpretedOption. # noqa: E501 + + + :return: The name_count of this UninterpretedOption. # noqa: E501 + :rtype: int + """ + return self._name_count + + @name_count.setter + def name_count(self, name_count): + """Sets the name_count of this UninterpretedOption. + + + :param name_count: The name_count of this UninterpretedOption. # noqa: E501 + :type: int + """ + + self._name_count = name_count + + @property + def name_list(self): + """Gets the name_list of this UninterpretedOption. # noqa: E501 + + + :return: The name_list of this UninterpretedOption. # noqa: E501 + :rtype: list[NamePart] + """ + return self._name_list + + @name_list.setter + def name_list(self, name_list): + """Sets the name_list of this UninterpretedOption. + + + :param name_list: The name_list of this UninterpretedOption. # noqa: E501 + :type: list[NamePart] + """ + + self._name_list = name_list + + @property + def name_or_builder_list(self): + """Gets the name_or_builder_list of this UninterpretedOption. # noqa: E501 + + + :return: The name_or_builder_list of this UninterpretedOption. # noqa: E501 + :rtype: list[NamePartOrBuilder] + """ + return self._name_or_builder_list + + @name_or_builder_list.setter + def name_or_builder_list(self, name_or_builder_list): + """Sets the name_or_builder_list of this UninterpretedOption. + + + :param name_or_builder_list: The name_or_builder_list of this UninterpretedOption. # noqa: E501 + :type: list[NamePartOrBuilder] + """ + + self._name_or_builder_list = name_or_builder_list + + @property + def negative_int_value(self): + """Gets the negative_int_value of this UninterpretedOption. # noqa: E501 + + + :return: The negative_int_value of this UninterpretedOption. # noqa: E501 + :rtype: int + """ + return self._negative_int_value + + @negative_int_value.setter + def negative_int_value(self, negative_int_value): + """Sets the negative_int_value of this UninterpretedOption. + + + :param negative_int_value: The negative_int_value of this UninterpretedOption. # noqa: E501 + :type: int + """ + + self._negative_int_value = negative_int_value + + @property + def parser_for_type(self): + """Gets the parser_for_type of this UninterpretedOption. # noqa: E501 + + + :return: The parser_for_type of this UninterpretedOption. # noqa: E501 + :rtype: ParserUninterpretedOption + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this UninterpretedOption. + + + :param parser_for_type: The parser_for_type of this UninterpretedOption. # noqa: E501 + :type: ParserUninterpretedOption + """ + + self._parser_for_type = parser_for_type + + @property + def positive_int_value(self): + """Gets the positive_int_value of this UninterpretedOption. # noqa: E501 + + + :return: The positive_int_value of this UninterpretedOption. # noqa: E501 + :rtype: int + """ + return self._positive_int_value + + @positive_int_value.setter + def positive_int_value(self, positive_int_value): + """Sets the positive_int_value of this UninterpretedOption. + + + :param positive_int_value: The positive_int_value of this UninterpretedOption. # noqa: E501 + :type: int + """ + + self._positive_int_value = positive_int_value + + @property + def serialized_size(self): + """Gets the serialized_size of this UninterpretedOption. # noqa: E501 + + + :return: The serialized_size of this UninterpretedOption. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this UninterpretedOption. + + + :param serialized_size: The serialized_size of this UninterpretedOption. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def string_value(self): + """Gets the string_value of this UninterpretedOption. # noqa: E501 + + + :return: The string_value of this UninterpretedOption. # noqa: E501 + :rtype: ByteString + """ + return self._string_value + + @string_value.setter + def string_value(self, string_value): + """Sets the string_value of this UninterpretedOption. + + + :param string_value: The string_value of this UninterpretedOption. # noqa: E501 + :type: ByteString + """ + + self._string_value = string_value + + @property + def unknown_fields(self): + """Gets the unknown_fields of this UninterpretedOption. # noqa: E501 + + + :return: The unknown_fields of this UninterpretedOption. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this UninterpretedOption. + + + :param unknown_fields: The unknown_fields of this UninterpretedOption. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UninterpretedOption, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UninterpretedOption): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/uninterpreted_option_or_builder.py b/src/conductor/client/codegen/models/uninterpreted_option_or_builder.py new file mode 100644 index 00000000..8fcf65f0 --- /dev/null +++ b/src/conductor/client/codegen/models/uninterpreted_option_or_builder.py @@ -0,0 +1,526 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UninterpretedOptionOrBuilder(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'aggregate_value': 'str', + 'aggregate_value_bytes': 'ByteString', + 'all_fields': 'dict(str, object)', + 'default_instance_for_type': 'Message', + 'descriptor_for_type': 'Descriptor', + 'double_value': 'float', + 'identifier_value': 'str', + 'identifier_value_bytes': 'ByteString', + 'initialization_error_string': 'str', + 'initialized': 'bool', + 'name_count': 'int', + 'name_list': 'list[NamePart]', + 'name_or_builder_list': 'list[NamePartOrBuilder]', + 'negative_int_value': 'int', + 'positive_int_value': 'int', + 'string_value': 'ByteString', + 'unknown_fields': 'UnknownFieldSet' + } + + attribute_map = { + 'aggregate_value': 'aggregateValue', + 'aggregate_value_bytes': 'aggregateValueBytes', + 'all_fields': 'allFields', + 'default_instance_for_type': 'defaultInstanceForType', + 'descriptor_for_type': 'descriptorForType', + 'double_value': 'doubleValue', + 'identifier_value': 'identifierValue', + 'identifier_value_bytes': 'identifierValueBytes', + 'initialization_error_string': 'initializationErrorString', + 'initialized': 'initialized', + 'name_count': 'nameCount', + 'name_list': 'nameList', + 'name_or_builder_list': 'nameOrBuilderList', + 'negative_int_value': 'negativeIntValue', + 'positive_int_value': 'positiveIntValue', + 'string_value': 'stringValue', + 'unknown_fields': 'unknownFields' + } + + def __init__(self, aggregate_value=None, aggregate_value_bytes=None, all_fields=None, default_instance_for_type=None, descriptor_for_type=None, double_value=None, identifier_value=None, identifier_value_bytes=None, initialization_error_string=None, initialized=None, name_count=None, name_list=None, name_or_builder_list=None, negative_int_value=None, positive_int_value=None, string_value=None, unknown_fields=None): # noqa: E501 + """UninterpretedOptionOrBuilder - a model defined in Swagger""" # noqa: E501 + self._aggregate_value = None + self._aggregate_value_bytes = None + self._all_fields = None + self._default_instance_for_type = None + self._descriptor_for_type = None + self._double_value = None + self._identifier_value = None + self._identifier_value_bytes = None + self._initialization_error_string = None + self._initialized = None + self._name_count = None + self._name_list = None + self._name_or_builder_list = None + self._negative_int_value = None + self._positive_int_value = None + self._string_value = None + self._unknown_fields = None + self.discriminator = None + if aggregate_value is not None: + self.aggregate_value = aggregate_value + if aggregate_value_bytes is not None: + self.aggregate_value_bytes = aggregate_value_bytes + if all_fields is not None: + self.all_fields = all_fields + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if descriptor_for_type is not None: + self.descriptor_for_type = descriptor_for_type + if double_value is not None: + self.double_value = double_value + if identifier_value is not None: + self.identifier_value = identifier_value + if identifier_value_bytes is not None: + self.identifier_value_bytes = identifier_value_bytes + if initialization_error_string is not None: + self.initialization_error_string = initialization_error_string + if initialized is not None: + self.initialized = initialized + if name_count is not None: + self.name_count = name_count + if name_list is not None: + self.name_list = name_list + if name_or_builder_list is not None: + self.name_or_builder_list = name_or_builder_list + if negative_int_value is not None: + self.negative_int_value = negative_int_value + if positive_int_value is not None: + self.positive_int_value = positive_int_value + if string_value is not None: + self.string_value = string_value + if unknown_fields is not None: + self.unknown_fields = unknown_fields + + @property + def aggregate_value(self): + """Gets the aggregate_value of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The aggregate_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: str + """ + return self._aggregate_value + + @aggregate_value.setter + def aggregate_value(self, aggregate_value): + """Sets the aggregate_value of this UninterpretedOptionOrBuilder. + + + :param aggregate_value: The aggregate_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: str + """ + + self._aggregate_value = aggregate_value + + @property + def aggregate_value_bytes(self): + """Gets the aggregate_value_bytes of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The aggregate_value_bytes of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._aggregate_value_bytes + + @aggregate_value_bytes.setter + def aggregate_value_bytes(self, aggregate_value_bytes): + """Sets the aggregate_value_bytes of this UninterpretedOptionOrBuilder. + + + :param aggregate_value_bytes: The aggregate_value_bytes of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._aggregate_value_bytes = aggregate_value_bytes + + @property + def all_fields(self): + """Gets the all_fields of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The all_fields of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: dict(str, object) + """ + return self._all_fields + + @all_fields.setter + def all_fields(self, all_fields): + """Sets the all_fields of this UninterpretedOptionOrBuilder. + + + :param all_fields: The all_fields of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: dict(str, object) + """ + + self._all_fields = all_fields + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The default_instance_for_type of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: Message + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this UninterpretedOptionOrBuilder. + + + :param default_instance_for_type: The default_instance_for_type of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: Message + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def descriptor_for_type(self): + """Gets the descriptor_for_type of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The descriptor_for_type of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: Descriptor + """ + return self._descriptor_for_type + + @descriptor_for_type.setter + def descriptor_for_type(self, descriptor_for_type): + """Sets the descriptor_for_type of this UninterpretedOptionOrBuilder. + + + :param descriptor_for_type: The descriptor_for_type of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: Descriptor + """ + + self._descriptor_for_type = descriptor_for_type + + @property + def double_value(self): + """Gets the double_value of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The double_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: float + """ + return self._double_value + + @double_value.setter + def double_value(self, double_value): + """Sets the double_value of this UninterpretedOptionOrBuilder. + + + :param double_value: The double_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: float + """ + + self._double_value = double_value + + @property + def identifier_value(self): + """Gets the identifier_value of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The identifier_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: str + """ + return self._identifier_value + + @identifier_value.setter + def identifier_value(self, identifier_value): + """Sets the identifier_value of this UninterpretedOptionOrBuilder. + + + :param identifier_value: The identifier_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: str + """ + + self._identifier_value = identifier_value + + @property + def identifier_value_bytes(self): + """Gets the identifier_value_bytes of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The identifier_value_bytes of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._identifier_value_bytes + + @identifier_value_bytes.setter + def identifier_value_bytes(self, identifier_value_bytes): + """Sets the identifier_value_bytes of this UninterpretedOptionOrBuilder. + + + :param identifier_value_bytes: The identifier_value_bytes of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._identifier_value_bytes = identifier_value_bytes + + @property + def initialization_error_string(self): + """Gets the initialization_error_string of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The initialization_error_string of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: str + """ + return self._initialization_error_string + + @initialization_error_string.setter + def initialization_error_string(self, initialization_error_string): + """Sets the initialization_error_string of this UninterpretedOptionOrBuilder. + + + :param initialization_error_string: The initialization_error_string of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: str + """ + + self._initialization_error_string = initialization_error_string + + @property + def initialized(self): + """Gets the initialized of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The initialized of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this UninterpretedOptionOrBuilder. + + + :param initialized: The initialized of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def name_count(self): + """Gets the name_count of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The name_count of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: int + """ + return self._name_count + + @name_count.setter + def name_count(self, name_count): + """Sets the name_count of this UninterpretedOptionOrBuilder. + + + :param name_count: The name_count of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: int + """ + + self._name_count = name_count + + @property + def name_list(self): + """Gets the name_list of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The name_list of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: list[NamePart] + """ + return self._name_list + + @name_list.setter + def name_list(self, name_list): + """Sets the name_list of this UninterpretedOptionOrBuilder. + + + :param name_list: The name_list of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: list[NamePart] + """ + + self._name_list = name_list + + @property + def name_or_builder_list(self): + """Gets the name_or_builder_list of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The name_or_builder_list of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: list[NamePartOrBuilder] + """ + return self._name_or_builder_list + + @name_or_builder_list.setter + def name_or_builder_list(self, name_or_builder_list): + """Sets the name_or_builder_list of this UninterpretedOptionOrBuilder. + + + :param name_or_builder_list: The name_or_builder_list of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: list[NamePartOrBuilder] + """ + + self._name_or_builder_list = name_or_builder_list + + @property + def negative_int_value(self): + """Gets the negative_int_value of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The negative_int_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: int + """ + return self._negative_int_value + + @negative_int_value.setter + def negative_int_value(self, negative_int_value): + """Sets the negative_int_value of this UninterpretedOptionOrBuilder. + + + :param negative_int_value: The negative_int_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: int + """ + + self._negative_int_value = negative_int_value + + @property + def positive_int_value(self): + """Gets the positive_int_value of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The positive_int_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: int + """ + return self._positive_int_value + + @positive_int_value.setter + def positive_int_value(self, positive_int_value): + """Sets the positive_int_value of this UninterpretedOptionOrBuilder. + + + :param positive_int_value: The positive_int_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: int + """ + + self._positive_int_value = positive_int_value + + @property + def string_value(self): + """Gets the string_value of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The string_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: ByteString + """ + return self._string_value + + @string_value.setter + def string_value(self, string_value): + """Sets the string_value of this UninterpretedOptionOrBuilder. + + + :param string_value: The string_value of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: ByteString + """ + + self._string_value = string_value + + @property + def unknown_fields(self): + """Gets the unknown_fields of this UninterpretedOptionOrBuilder. # noqa: E501 + + + :return: The unknown_fields of this UninterpretedOptionOrBuilder. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._unknown_fields + + @unknown_fields.setter + def unknown_fields(self, unknown_fields): + """Sets the unknown_fields of this UninterpretedOptionOrBuilder. + + + :param unknown_fields: The unknown_fields of this UninterpretedOptionOrBuilder. # noqa: E501 + :type: UnknownFieldSet + """ + + self._unknown_fields = unknown_fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UninterpretedOptionOrBuilder, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UninterpretedOptionOrBuilder): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/unknown_field_set.py b/src/conductor/client/codegen/models/unknown_field_set.py new file mode 100644 index 00000000..b9be2eb0 --- /dev/null +++ b/src/conductor/client/codegen/models/unknown_field_set.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UnknownFieldSet(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'default_instance_for_type': 'UnknownFieldSet', + 'initialized': 'bool', + 'parser_for_type': 'Parser', + 'serialized_size': 'int', + 'serialized_size_as_message_set': 'int' + } + + attribute_map = { + 'default_instance_for_type': 'defaultInstanceForType', + 'initialized': 'initialized', + 'parser_for_type': 'parserForType', + 'serialized_size': 'serializedSize', + 'serialized_size_as_message_set': 'serializedSizeAsMessageSet' + } + + def __init__(self, default_instance_for_type=None, initialized=None, parser_for_type=None, serialized_size=None, serialized_size_as_message_set=None): # noqa: E501 + """UnknownFieldSet - a model defined in Swagger""" # noqa: E501 + self._default_instance_for_type = None + self._initialized = None + self._parser_for_type = None + self._serialized_size = None + self._serialized_size_as_message_set = None + self.discriminator = None + if default_instance_for_type is not None: + self.default_instance_for_type = default_instance_for_type + if initialized is not None: + self.initialized = initialized + if parser_for_type is not None: + self.parser_for_type = parser_for_type + if serialized_size is not None: + self.serialized_size = serialized_size + if serialized_size_as_message_set is not None: + self.serialized_size_as_message_set = serialized_size_as_message_set + + @property + def default_instance_for_type(self): + """Gets the default_instance_for_type of this UnknownFieldSet. # noqa: E501 + + + :return: The default_instance_for_type of this UnknownFieldSet. # noqa: E501 + :rtype: UnknownFieldSet + """ + return self._default_instance_for_type + + @default_instance_for_type.setter + def default_instance_for_type(self, default_instance_for_type): + """Sets the default_instance_for_type of this UnknownFieldSet. + + + :param default_instance_for_type: The default_instance_for_type of this UnknownFieldSet. # noqa: E501 + :type: UnknownFieldSet + """ + + self._default_instance_for_type = default_instance_for_type + + @property + def initialized(self): + """Gets the initialized of this UnknownFieldSet. # noqa: E501 + + + :return: The initialized of this UnknownFieldSet. # noqa: E501 + :rtype: bool + """ + return self._initialized + + @initialized.setter + def initialized(self, initialized): + """Sets the initialized of this UnknownFieldSet. + + + :param initialized: The initialized of this UnknownFieldSet. # noqa: E501 + :type: bool + """ + + self._initialized = initialized + + @property + def parser_for_type(self): + """Gets the parser_for_type of this UnknownFieldSet. # noqa: E501 + + + :return: The parser_for_type of this UnknownFieldSet. # noqa: E501 + :rtype: Parser + """ + return self._parser_for_type + + @parser_for_type.setter + def parser_for_type(self, parser_for_type): + """Sets the parser_for_type of this UnknownFieldSet. + + + :param parser_for_type: The parser_for_type of this UnknownFieldSet. # noqa: E501 + :type: Parser + """ + + self._parser_for_type = parser_for_type + + @property + def serialized_size(self): + """Gets the serialized_size of this UnknownFieldSet. # noqa: E501 + + + :return: The serialized_size of this UnknownFieldSet. # noqa: E501 + :rtype: int + """ + return self._serialized_size + + @serialized_size.setter + def serialized_size(self, serialized_size): + """Sets the serialized_size of this UnknownFieldSet. + + + :param serialized_size: The serialized_size of this UnknownFieldSet. # noqa: E501 + :type: int + """ + + self._serialized_size = serialized_size + + @property + def serialized_size_as_message_set(self): + """Gets the serialized_size_as_message_set of this UnknownFieldSet. # noqa: E501 + + + :return: The serialized_size_as_message_set of this UnknownFieldSet. # noqa: E501 + :rtype: int + """ + return self._serialized_size_as_message_set + + @serialized_size_as_message_set.setter + def serialized_size_as_message_set(self, serialized_size_as_message_set): + """Sets the serialized_size_as_message_set of this UnknownFieldSet. + + + :param serialized_size_as_message_set: The serialized_size_as_message_set of this UnknownFieldSet. # noqa: E501 + :type: int + """ + + self._serialized_size_as_message_set = serialized_size_as_message_set + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UnknownFieldSet, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnknownFieldSet): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/update_workflow_variables.py b/src/conductor/client/codegen/models/update_workflow_variables.py new file mode 100644 index 00000000..c2a14ff1 --- /dev/null +++ b/src/conductor/client/codegen/models/update_workflow_variables.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UpdateWorkflowVariables(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'append_array': 'bool', + 'variables': 'dict(str, object)', + 'workflow_id': 'str' + } + + attribute_map = { + 'append_array': 'appendArray', + 'variables': 'variables', + 'workflow_id': 'workflowId' + } + + def __init__(self, append_array=None, variables=None, workflow_id=None): # noqa: E501 + """UpdateWorkflowVariables - a model defined in Swagger""" # noqa: E501 + self._append_array = None + self._variables = None + self._workflow_id = None + self.discriminator = None + if append_array is not None: + self.append_array = append_array + if variables is not None: + self.variables = variables + if workflow_id is not None: + self.workflow_id = workflow_id + + @property + def append_array(self): + """Gets the append_array of this UpdateWorkflowVariables. # noqa: E501 + + + :return: The append_array of this UpdateWorkflowVariables. # noqa: E501 + :rtype: bool + """ + return self._append_array + + @append_array.setter + def append_array(self, append_array): + """Sets the append_array of this UpdateWorkflowVariables. + + + :param append_array: The append_array of this UpdateWorkflowVariables. # noqa: E501 + :type: bool + """ + + self._append_array = append_array + + @property + def variables(self): + """Gets the variables of this UpdateWorkflowVariables. # noqa: E501 + + + :return: The variables of this UpdateWorkflowVariables. # noqa: E501 + :rtype: dict(str, object) + """ + return self._variables + + @variables.setter + def variables(self, variables): + """Sets the variables of this UpdateWorkflowVariables. + + + :param variables: The variables of this UpdateWorkflowVariables. # noqa: E501 + :type: dict(str, object) + """ + + self._variables = variables + + @property + def workflow_id(self): + """Gets the workflow_id of this UpdateWorkflowVariables. # noqa: E501 + + + :return: The workflow_id of this UpdateWorkflowVariables. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this UpdateWorkflowVariables. + + + :param workflow_id: The workflow_id of this UpdateWorkflowVariables. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UpdateWorkflowVariables, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdateWorkflowVariables): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/upgrade_workflow_request.py b/src/conductor/client/codegen/models/upgrade_workflow_request.py new file mode 100644 index 00000000..3adfcd27 --- /dev/null +++ b/src/conductor/client/codegen/models/upgrade_workflow_request.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UpgradeWorkflowRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'task_output': 'dict(str, object)', + 'version': 'int', + 'workflow_input': 'dict(str, object)' + } + + attribute_map = { + 'name': 'name', + 'task_output': 'taskOutput', + 'version': 'version', + 'workflow_input': 'workflowInput' + } + + def __init__(self, name=None, task_output=None, version=None, workflow_input=None): # noqa: E501 + """UpgradeWorkflowRequest - a model defined in Swagger""" # noqa: E501 + self._name = None + self._task_output = None + self._version = None + self._workflow_input = None + self.discriminator = None + self.name = name + if task_output is not None: + self.task_output = task_output + if version is not None: + self.version = version + if workflow_input is not None: + self.workflow_input = workflow_input + + @property + def name(self): + """Gets the name of this UpgradeWorkflowRequest. # noqa: E501 + + + :return: The name of this UpgradeWorkflowRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this UpgradeWorkflowRequest. + + + :param name: The name of this UpgradeWorkflowRequest. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def task_output(self): + """Gets the task_output of this UpgradeWorkflowRequest. # noqa: E501 + + + :return: The task_output of this UpgradeWorkflowRequest. # noqa: E501 + :rtype: dict(str, object) + """ + return self._task_output + + @task_output.setter + def task_output(self, task_output): + """Sets the task_output of this UpgradeWorkflowRequest. + + + :param task_output: The task_output of this UpgradeWorkflowRequest. # noqa: E501 + :type: dict(str, object) + """ + + self._task_output = task_output + + @property + def version(self): + """Gets the version of this UpgradeWorkflowRequest. # noqa: E501 + + + :return: The version of this UpgradeWorkflowRequest. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this UpgradeWorkflowRequest. + + + :param version: The version of this UpgradeWorkflowRequest. # noqa: E501 + :type: int + """ + + self._version = version + + @property + def workflow_input(self): + """Gets the workflow_input of this UpgradeWorkflowRequest. # noqa: E501 + + + :return: The workflow_input of this UpgradeWorkflowRequest. # noqa: E501 + :rtype: dict(str, object) + """ + return self._workflow_input + + @workflow_input.setter + def workflow_input(self, workflow_input): + """Sets the workflow_input of this UpgradeWorkflowRequest. + + + :param workflow_input: The workflow_input of this UpgradeWorkflowRequest. # noqa: E501 + :type: dict(str, object) + """ + + self._workflow_input = workflow_input + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UpgradeWorkflowRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpgradeWorkflowRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/upsert_group_request.py b/src/conductor/client/codegen/models/upsert_group_request.py new file mode 100644 index 00000000..33bf0fe7 --- /dev/null +++ b/src/conductor/client/codegen/models/upsert_group_request.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UpsertGroupRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'default_access': 'dict(str, list[str])', + 'description': 'str', + 'roles': 'list[str]' + } + + attribute_map = { + 'default_access': 'defaultAccess', + 'description': 'description', + 'roles': 'roles' + } + + def __init__(self, default_access=None, description=None, roles=None): # noqa: E501 + """UpsertGroupRequest - a model defined in Swagger""" # noqa: E501 + self._default_access = None + self._description = None + self._roles = None + self.discriminator = None + if default_access is not None: + self.default_access = default_access + if description is not None: + self.description = description + if roles is not None: + self.roles = roles + + @property + def default_access(self): + """Gets the default_access of this UpsertGroupRequest. # noqa: E501 + + a default Map to share permissions, allowed target types: WORKFLOW_DEF, TASK_DEF, WORKFLOW_SCHEDULE # noqa: E501 + + :return: The default_access of this UpsertGroupRequest. # noqa: E501 + :rtype: dict(str, list[str]) + """ + return self._default_access + + @default_access.setter + def default_access(self, default_access): + """Sets the default_access of this UpsertGroupRequest. + + a default Map to share permissions, allowed target types: WORKFLOW_DEF, TASK_DEF, WORKFLOW_SCHEDULE # noqa: E501 + + :param default_access: The default_access of this UpsertGroupRequest. # noqa: E501 + :type: dict(str, list[str]) + """ + allowed_values = [CREATE, READ, EXECUTE, UPDATE, DELETE] # noqa: E501 + if not set(default_access.keys()).issubset(set(allowed_values)): + raise ValueError( + "Invalid keys in `default_access` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(default_access.keys()) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._default_access = default_access + + @property + def description(self): + """Gets the description of this UpsertGroupRequest. # noqa: E501 + + A general description of the group # noqa: E501 + + :return: The description of this UpsertGroupRequest. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this UpsertGroupRequest. + + A general description of the group # noqa: E501 + + :param description: The description of this UpsertGroupRequest. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def roles(self): + """Gets the roles of this UpsertGroupRequest. # noqa: E501 + + + :return: The roles of this UpsertGroupRequest. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this UpsertGroupRequest. + + + :param roles: The roles of this UpsertGroupRequest. # noqa: E501 + :type: list[str] + """ + + self._roles = roles + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UpsertGroupRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpsertGroupRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/upsert_user_request.py b/src/conductor/client/codegen/models/upsert_user_request.py new file mode 100644 index 00000000..045042c8 --- /dev/null +++ b/src/conductor/client/codegen/models/upsert_user_request.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UpsertUserRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'groups': 'list[str]', + 'name': 'str', + 'roles': 'list[str]' + } + + attribute_map = { + 'groups': 'groups', + 'name': 'name', + 'roles': 'roles' + } + + def __init__(self, groups=None, name=None, roles=None): # noqa: E501 + """UpsertUserRequest - a model defined in Swagger""" # noqa: E501 + self._groups = None + self._name = None + self._roles = None + self.discriminator = None + if groups is not None: + self.groups = groups + if name is not None: + self.name = name + if roles is not None: + self.roles = roles + + @property + def groups(self): + """Gets the groups of this UpsertUserRequest. # noqa: E501 + + Ids of the groups this user belongs to # noqa: E501 + + :return: The groups of this UpsertUserRequest. # noqa: E501 + :rtype: list[str] + """ + return self._groups + + @groups.setter + def groups(self, groups): + """Sets the groups of this UpsertUserRequest. + + Ids of the groups this user belongs to # noqa: E501 + + :param groups: The groups of this UpsertUserRequest. # noqa: E501 + :type: list[str] + """ + + self._groups = groups + + @property + def name(self): + """Gets the name of this UpsertUserRequest. # noqa: E501 + + User's full name # noqa: E501 + + :return: The name of this UpsertUserRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this UpsertUserRequest. + + User's full name # noqa: E501 + + :param name: The name of this UpsertUserRequest. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def roles(self): + """Gets the roles of this UpsertUserRequest. # noqa: E501 + + + :return: The roles of this UpsertUserRequest. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this UpsertUserRequest. + + + :param roles: The roles of this UpsertUserRequest. # noqa: E501 + :type: list[str] + """ + + self._roles = roles + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UpsertUserRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpsertUserRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/webhook_config.py b/src/conductor/client/codegen/models/webhook_config.py new file mode 100644 index 00000000..ebfa19bc --- /dev/null +++ b/src/conductor/client/codegen/models/webhook_config.py @@ -0,0 +1,506 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WebhookConfig(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_by': 'str', + 'evaluator_type': 'str', + 'expression': 'str', + 'header_key': 'str', + 'headers': 'dict(str, str)', + 'id': 'str', + 'name': 'str', + 'receiver_workflow_names_to_versions': 'dict(str, int)', + 'secret_key': 'str', + 'secret_value': 'str', + 'source_platform': 'str', + 'tags': 'list[Tag]', + 'url_verified': 'bool', + 'verifier': 'str', + 'webhook_execution_history': 'list[WebhookExecutionHistory]', + 'workflows_to_start': 'dict(str, object)' + } + + attribute_map = { + 'created_by': 'createdBy', + 'evaluator_type': 'evaluatorType', + 'expression': 'expression', + 'header_key': 'headerKey', + 'headers': 'headers', + 'id': 'id', + 'name': 'name', + 'receiver_workflow_names_to_versions': 'receiverWorkflowNamesToVersions', + 'secret_key': 'secretKey', + 'secret_value': 'secretValue', + 'source_platform': 'sourcePlatform', + 'tags': 'tags', + 'url_verified': 'urlVerified', + 'verifier': 'verifier', + 'webhook_execution_history': 'webhookExecutionHistory', + 'workflows_to_start': 'workflowsToStart' + } + + def __init__(self, created_by=None, evaluator_type=None, expression=None, header_key=None, headers=None, id=None, name=None, receiver_workflow_names_to_versions=None, secret_key=None, secret_value=None, source_platform=None, tags=None, url_verified=None, verifier=None, webhook_execution_history=None, workflows_to_start=None): # noqa: E501 + """WebhookConfig - a model defined in Swagger""" # noqa: E501 + self._created_by = None + self._evaluator_type = None + self._expression = None + self._header_key = None + self._headers = None + self._id = None + self._name = None + self._receiver_workflow_names_to_versions = None + self._secret_key = None + self._secret_value = None + self._source_platform = None + self._tags = None + self._url_verified = None + self._verifier = None + self._webhook_execution_history = None + self._workflows_to_start = None + self.discriminator = None + if created_by is not None: + self.created_by = created_by + if evaluator_type is not None: + self.evaluator_type = evaluator_type + if expression is not None: + self.expression = expression + if header_key is not None: + self.header_key = header_key + if headers is not None: + self.headers = headers + if id is not None: + self.id = id + if name is not None: + self.name = name + if receiver_workflow_names_to_versions is not None: + self.receiver_workflow_names_to_versions = receiver_workflow_names_to_versions + if secret_key is not None: + self.secret_key = secret_key + if secret_value is not None: + self.secret_value = secret_value + if source_platform is not None: + self.source_platform = source_platform + if tags is not None: + self.tags = tags + if url_verified is not None: + self.url_verified = url_verified + if verifier is not None: + self.verifier = verifier + if webhook_execution_history is not None: + self.webhook_execution_history = webhook_execution_history + if workflows_to_start is not None: + self.workflows_to_start = workflows_to_start + + @property + def created_by(self): + """Gets the created_by of this WebhookConfig. # noqa: E501 + + + :return: The created_by of this WebhookConfig. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this WebhookConfig. + + + :param created_by: The created_by of this WebhookConfig. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def evaluator_type(self): + """Gets the evaluator_type of this WebhookConfig. # noqa: E501 + + + :return: The evaluator_type of this WebhookConfig. # noqa: E501 + :rtype: str + """ + return self._evaluator_type + + @evaluator_type.setter + def evaluator_type(self, evaluator_type): + """Sets the evaluator_type of this WebhookConfig. + + + :param evaluator_type: The evaluator_type of this WebhookConfig. # noqa: E501 + :type: str + """ + + self._evaluator_type = evaluator_type + + @property + def expression(self): + """Gets the expression of this WebhookConfig. # noqa: E501 + + + :return: The expression of this WebhookConfig. # noqa: E501 + :rtype: str + """ + return self._expression + + @expression.setter + def expression(self, expression): + """Sets the expression of this WebhookConfig. + + + :param expression: The expression of this WebhookConfig. # noqa: E501 + :type: str + """ + + self._expression = expression + + @property + def header_key(self): + """Gets the header_key of this WebhookConfig. # noqa: E501 + + + :return: The header_key of this WebhookConfig. # noqa: E501 + :rtype: str + """ + return self._header_key + + @header_key.setter + def header_key(self, header_key): + """Sets the header_key of this WebhookConfig. + + + :param header_key: The header_key of this WebhookConfig. # noqa: E501 + :type: str + """ + + self._header_key = header_key + + @property + def headers(self): + """Gets the headers of this WebhookConfig. # noqa: E501 + + + :return: The headers of this WebhookConfig. # noqa: E501 + :rtype: dict(str, str) + """ + return self._headers + + @headers.setter + def headers(self, headers): + """Sets the headers of this WebhookConfig. + + + :param headers: The headers of this WebhookConfig. # noqa: E501 + :type: dict(str, str) + """ + + self._headers = headers + + @property + def id(self): + """Gets the id of this WebhookConfig. # noqa: E501 + + + :return: The id of this WebhookConfig. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this WebhookConfig. + + + :param id: The id of this WebhookConfig. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this WebhookConfig. # noqa: E501 + + + :return: The name of this WebhookConfig. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this WebhookConfig. + + + :param name: The name of this WebhookConfig. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def receiver_workflow_names_to_versions(self): + """Gets the receiver_workflow_names_to_versions of this WebhookConfig. # noqa: E501 + + + :return: The receiver_workflow_names_to_versions of this WebhookConfig. # noqa: E501 + :rtype: dict(str, int) + """ + return self._receiver_workflow_names_to_versions + + @receiver_workflow_names_to_versions.setter + def receiver_workflow_names_to_versions(self, receiver_workflow_names_to_versions): + """Sets the receiver_workflow_names_to_versions of this WebhookConfig. + + + :param receiver_workflow_names_to_versions: The receiver_workflow_names_to_versions of this WebhookConfig. # noqa: E501 + :type: dict(str, int) + """ + + self._receiver_workflow_names_to_versions = receiver_workflow_names_to_versions + + @property + def secret_key(self): + """Gets the secret_key of this WebhookConfig. # noqa: E501 + + + :return: The secret_key of this WebhookConfig. # noqa: E501 + :rtype: str + """ + return self._secret_key + + @secret_key.setter + def secret_key(self, secret_key): + """Sets the secret_key of this WebhookConfig. + + + :param secret_key: The secret_key of this WebhookConfig. # noqa: E501 + :type: str + """ + + self._secret_key = secret_key + + @property + def secret_value(self): + """Gets the secret_value of this WebhookConfig. # noqa: E501 + + + :return: The secret_value of this WebhookConfig. # noqa: E501 + :rtype: str + """ + return self._secret_value + + @secret_value.setter + def secret_value(self, secret_value): + """Sets the secret_value of this WebhookConfig. + + + :param secret_value: The secret_value of this WebhookConfig. # noqa: E501 + :type: str + """ + + self._secret_value = secret_value + + @property + def source_platform(self): + """Gets the source_platform of this WebhookConfig. # noqa: E501 + + + :return: The source_platform of this WebhookConfig. # noqa: E501 + :rtype: str + """ + return self._source_platform + + @source_platform.setter + def source_platform(self, source_platform): + """Sets the source_platform of this WebhookConfig. + + + :param source_platform: The source_platform of this WebhookConfig. # noqa: E501 + :type: str + """ + + self._source_platform = source_platform + + @property + def tags(self): + """Gets the tags of this WebhookConfig. # noqa: E501 + + + :return: The tags of this WebhookConfig. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this WebhookConfig. + + + :param tags: The tags of this WebhookConfig. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def url_verified(self): + """Gets the url_verified of this WebhookConfig. # noqa: E501 + + + :return: The url_verified of this WebhookConfig. # noqa: E501 + :rtype: bool + """ + return self._url_verified + + @url_verified.setter + def url_verified(self, url_verified): + """Sets the url_verified of this WebhookConfig. + + + :param url_verified: The url_verified of this WebhookConfig. # noqa: E501 + :type: bool + """ + + self._url_verified = url_verified + + @property + def verifier(self): + """Gets the verifier of this WebhookConfig. # noqa: E501 + + + :return: The verifier of this WebhookConfig. # noqa: E501 + :rtype: str + """ + return self._verifier + + @verifier.setter + def verifier(self, verifier): + """Sets the verifier of this WebhookConfig. + + + :param verifier: The verifier of this WebhookConfig. # noqa: E501 + :type: str + """ + allowed_values = ["SLACK_BASED", "SIGNATURE_BASED", "HEADER_BASED", "STRIPE", "TWITTER", "HMAC_BASED", "SENDGRID"] # noqa: E501 + if verifier not in allowed_values: + raise ValueError( + "Invalid value for `verifier` ({0}), must be one of {1}" # noqa: E501 + .format(verifier, allowed_values) + ) + + self._verifier = verifier + + @property + def webhook_execution_history(self): + """Gets the webhook_execution_history of this WebhookConfig. # noqa: E501 + + + :return: The webhook_execution_history of this WebhookConfig. # noqa: E501 + :rtype: list[WebhookExecutionHistory] + """ + return self._webhook_execution_history + + @webhook_execution_history.setter + def webhook_execution_history(self, webhook_execution_history): + """Sets the webhook_execution_history of this WebhookConfig. + + + :param webhook_execution_history: The webhook_execution_history of this WebhookConfig. # noqa: E501 + :type: list[WebhookExecutionHistory] + """ + + self._webhook_execution_history = webhook_execution_history + + @property + def workflows_to_start(self): + """Gets the workflows_to_start of this WebhookConfig. # noqa: E501 + + + :return: The workflows_to_start of this WebhookConfig. # noqa: E501 + :rtype: dict(str, object) + """ + return self._workflows_to_start + + @workflows_to_start.setter + def workflows_to_start(self, workflows_to_start): + """Sets the workflows_to_start of this WebhookConfig. + + + :param workflows_to_start: The workflows_to_start of this WebhookConfig. # noqa: E501 + :type: dict(str, object) + """ + + self._workflows_to_start = workflows_to_start + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WebhookConfig, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WebhookConfig): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/webhook_execution_history.py b/src/conductor/client/codegen/models/webhook_execution_history.py new file mode 100644 index 00000000..acdb614f --- /dev/null +++ b/src/conductor/client/codegen/models/webhook_execution_history.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WebhookExecutionHistory(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'event_id': 'str', + 'matched': 'bool', + 'payload': 'str', + 'time_stamp': 'int', + 'workflow_ids': 'list[str]' + } + + attribute_map = { + 'event_id': 'eventId', + 'matched': 'matched', + 'payload': 'payload', + 'time_stamp': 'timeStamp', + 'workflow_ids': 'workflowIds' + } + + def __init__(self, event_id=None, matched=None, payload=None, time_stamp=None, workflow_ids=None): # noqa: E501 + """WebhookExecutionHistory - a model defined in Swagger""" # noqa: E501 + self._event_id = None + self._matched = None + self._payload = None + self._time_stamp = None + self._workflow_ids = None + self.discriminator = None + if event_id is not None: + self.event_id = event_id + if matched is not None: + self.matched = matched + if payload is not None: + self.payload = payload + if time_stamp is not None: + self.time_stamp = time_stamp + if workflow_ids is not None: + self.workflow_ids = workflow_ids + + @property + def event_id(self): + """Gets the event_id of this WebhookExecutionHistory. # noqa: E501 + + + :return: The event_id of this WebhookExecutionHistory. # noqa: E501 + :rtype: str + """ + return self._event_id + + @event_id.setter + def event_id(self, event_id): + """Sets the event_id of this WebhookExecutionHistory. + + + :param event_id: The event_id of this WebhookExecutionHistory. # noqa: E501 + :type: str + """ + + self._event_id = event_id + + @property + def matched(self): + """Gets the matched of this WebhookExecutionHistory. # noqa: E501 + + + :return: The matched of this WebhookExecutionHistory. # noqa: E501 + :rtype: bool + """ + return self._matched + + @matched.setter + def matched(self, matched): + """Sets the matched of this WebhookExecutionHistory. + + + :param matched: The matched of this WebhookExecutionHistory. # noqa: E501 + :type: bool + """ + + self._matched = matched + + @property + def payload(self): + """Gets the payload of this WebhookExecutionHistory. # noqa: E501 + + + :return: The payload of this WebhookExecutionHistory. # noqa: E501 + :rtype: str + """ + return self._payload + + @payload.setter + def payload(self, payload): + """Sets the payload of this WebhookExecutionHistory. + + + :param payload: The payload of this WebhookExecutionHistory. # noqa: E501 + :type: str + """ + + self._payload = payload + + @property + def time_stamp(self): + """Gets the time_stamp of this WebhookExecutionHistory. # noqa: E501 + + + :return: The time_stamp of this WebhookExecutionHistory. # noqa: E501 + :rtype: int + """ + return self._time_stamp + + @time_stamp.setter + def time_stamp(self, time_stamp): + """Sets the time_stamp of this WebhookExecutionHistory. + + + :param time_stamp: The time_stamp of this WebhookExecutionHistory. # noqa: E501 + :type: int + """ + + self._time_stamp = time_stamp + + @property + def workflow_ids(self): + """Gets the workflow_ids of this WebhookExecutionHistory. # noqa: E501 + + + :return: The workflow_ids of this WebhookExecutionHistory. # noqa: E501 + :rtype: list[str] + """ + return self._workflow_ids + + @workflow_ids.setter + def workflow_ids(self, workflow_ids): + """Sets the workflow_ids of this WebhookExecutionHistory. + + + :param workflow_ids: The workflow_ids of this WebhookExecutionHistory. # noqa: E501 + :type: list[str] + """ + + self._workflow_ids = workflow_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WebhookExecutionHistory, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WebhookExecutionHistory): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow.py b/src/conductor/client/codegen/models/workflow.py new file mode 100644 index 00000000..82ab32fc --- /dev/null +++ b/src/conductor/client/codegen/models/workflow.py @@ -0,0 +1,948 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Workflow(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'correlation_id': 'str', + 'create_time': 'int', + 'created_by': 'str', + 'end_time': 'int', + 'event': 'str', + 'external_input_payload_storage_path': 'str', + 'external_output_payload_storage_path': 'str', + 'failed_reference_task_names': 'list[str]', + 'failed_task_names': 'list[str]', + 'history': 'list[Workflow]', + 'idempotency_key': 'str', + 'input': 'dict(str, object)', + 'last_retried_time': 'int', + 'output': 'dict(str, object)', + 'owner_app': 'str', + 'parent_workflow_id': 'str', + 'parent_workflow_task_id': 'str', + 'priority': 'int', + 'rate_limit_key': 'str', + 'rate_limited': 'bool', + 're_run_from_workflow_id': 'str', + 'reason_for_incompletion': 'str', + 'start_time': 'int', + 'status': 'str', + 'task_to_domain': 'dict(str, str)', + 'tasks': 'list[Task]', + 'update_time': 'int', + 'updated_by': 'str', + 'variables': 'dict(str, object)', + 'workflow_definition': 'WorkflowDef', + 'workflow_id': 'str', + 'workflow_name': 'str', + 'workflow_version': 'int' + } + + attribute_map = { + 'correlation_id': 'correlationId', + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'end_time': 'endTime', + 'event': 'event', + 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', + 'external_output_payload_storage_path': 'externalOutputPayloadStoragePath', + 'failed_reference_task_names': 'failedReferenceTaskNames', + 'failed_task_names': 'failedTaskNames', + 'history': 'history', + 'idempotency_key': 'idempotencyKey', + 'input': 'input', + 'last_retried_time': 'lastRetriedTime', + 'output': 'output', + 'owner_app': 'ownerApp', + 'parent_workflow_id': 'parentWorkflowId', + 'parent_workflow_task_id': 'parentWorkflowTaskId', + 'priority': 'priority', + 'rate_limit_key': 'rateLimitKey', + 'rate_limited': 'rateLimited', + 're_run_from_workflow_id': 'reRunFromWorkflowId', + 'reason_for_incompletion': 'reasonForIncompletion', + 'start_time': 'startTime', + 'status': 'status', + 'task_to_domain': 'taskToDomain', + 'tasks': 'tasks', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy', + 'variables': 'variables', + 'workflow_definition': 'workflowDefinition', + 'workflow_id': 'workflowId', + 'workflow_name': 'workflowName', + 'workflow_version': 'workflowVersion' + } + + def __init__(self, correlation_id=None, create_time=None, created_by=None, end_time=None, event=None, external_input_payload_storage_path=None, external_output_payload_storage_path=None, failed_reference_task_names=None, failed_task_names=None, history=None, idempotency_key=None, input=None, last_retried_time=None, output=None, owner_app=None, parent_workflow_id=None, parent_workflow_task_id=None, priority=None, rate_limit_key=None, rate_limited=None, re_run_from_workflow_id=None, reason_for_incompletion=None, start_time=None, status=None, task_to_domain=None, tasks=None, update_time=None, updated_by=None, variables=None, workflow_definition=None, workflow_id=None, workflow_name=None, workflow_version=None): # noqa: E501 + """Workflow - a model defined in Swagger""" # noqa: E501 + self._correlation_id = None + self._create_time = None + self._created_by = None + self._end_time = None + self._event = None + self._external_input_payload_storage_path = None + self._external_output_payload_storage_path = None + self._failed_reference_task_names = None + self._failed_task_names = None + self._history = None + self._idempotency_key = None + self._input = None + self._last_retried_time = None + self._output = None + self._owner_app = None + self._parent_workflow_id = None + self._parent_workflow_task_id = None + self._priority = None + self._rate_limit_key = None + self._rate_limited = None + self._re_run_from_workflow_id = None + self._reason_for_incompletion = None + self._start_time = None + self._status = None + self._task_to_domain = None + self._tasks = None + self._update_time = None + self._updated_by = None + self._variables = None + self._workflow_definition = None + self._workflow_id = None + self._workflow_name = None + self._workflow_version = None + self.discriminator = None + if correlation_id is not None: + self.correlation_id = correlation_id + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if end_time is not None: + self.end_time = end_time + if event is not None: + self.event = event + if external_input_payload_storage_path is not None: + self.external_input_payload_storage_path = external_input_payload_storage_path + if external_output_payload_storage_path is not None: + self.external_output_payload_storage_path = external_output_payload_storage_path + if failed_reference_task_names is not None: + self.failed_reference_task_names = failed_reference_task_names + if failed_task_names is not None: + self.failed_task_names = failed_task_names + if history is not None: + self.history = history + if idempotency_key is not None: + self.idempotency_key = idempotency_key + if input is not None: + self.input = input + if last_retried_time is not None: + self.last_retried_time = last_retried_time + if output is not None: + self.output = output + if owner_app is not None: + self.owner_app = owner_app + if parent_workflow_id is not None: + self.parent_workflow_id = parent_workflow_id + if parent_workflow_task_id is not None: + self.parent_workflow_task_id = parent_workflow_task_id + if priority is not None: + self.priority = priority + if rate_limit_key is not None: + self.rate_limit_key = rate_limit_key + if rate_limited is not None: + self.rate_limited = rate_limited + if re_run_from_workflow_id is not None: + self.re_run_from_workflow_id = re_run_from_workflow_id + if reason_for_incompletion is not None: + self.reason_for_incompletion = reason_for_incompletion + if start_time is not None: + self.start_time = start_time + if status is not None: + self.status = status + if task_to_domain is not None: + self.task_to_domain = task_to_domain + if tasks is not None: + self.tasks = tasks + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + if variables is not None: + self.variables = variables + if workflow_definition is not None: + self.workflow_definition = workflow_definition + if workflow_id is not None: + self.workflow_id = workflow_id + if workflow_name is not None: + self.workflow_name = workflow_name + if workflow_version is not None: + self.workflow_version = workflow_version + + @property + def correlation_id(self): + """Gets the correlation_id of this Workflow. # noqa: E501 + + + :return: The correlation_id of this Workflow. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this Workflow. + + + :param correlation_id: The correlation_id of this Workflow. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def create_time(self): + """Gets the create_time of this Workflow. # noqa: E501 + + + :return: The create_time of this Workflow. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this Workflow. + + + :param create_time: The create_time of this Workflow. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this Workflow. # noqa: E501 + + + :return: The created_by of this Workflow. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this Workflow. + + + :param created_by: The created_by of this Workflow. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def end_time(self): + """Gets the end_time of this Workflow. # noqa: E501 + + + :return: The end_time of this Workflow. # noqa: E501 + :rtype: int + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this Workflow. + + + :param end_time: The end_time of this Workflow. # noqa: E501 + :type: int + """ + + self._end_time = end_time + + @property + def event(self): + """Gets the event of this Workflow. # noqa: E501 + + + :return: The event of this Workflow. # noqa: E501 + :rtype: str + """ + return self._event + + @event.setter + def event(self, event): + """Sets the event of this Workflow. + + + :param event: The event of this Workflow. # noqa: E501 + :type: str + """ + + self._event = event + + @property + def external_input_payload_storage_path(self): + """Gets the external_input_payload_storage_path of this Workflow. # noqa: E501 + + + :return: The external_input_payload_storage_path of this Workflow. # noqa: E501 + :rtype: str + """ + return self._external_input_payload_storage_path + + @external_input_payload_storage_path.setter + def external_input_payload_storage_path(self, external_input_payload_storage_path): + """Sets the external_input_payload_storage_path of this Workflow. + + + :param external_input_payload_storage_path: The external_input_payload_storage_path of this Workflow. # noqa: E501 + :type: str + """ + + self._external_input_payload_storage_path = external_input_payload_storage_path + + @property + def external_output_payload_storage_path(self): + """Gets the external_output_payload_storage_path of this Workflow. # noqa: E501 + + + :return: The external_output_payload_storage_path of this Workflow. # noqa: E501 + :rtype: str + """ + return self._external_output_payload_storage_path + + @external_output_payload_storage_path.setter + def external_output_payload_storage_path(self, external_output_payload_storage_path): + """Sets the external_output_payload_storage_path of this Workflow. + + + :param external_output_payload_storage_path: The external_output_payload_storage_path of this Workflow. # noqa: E501 + :type: str + """ + + self._external_output_payload_storage_path = external_output_payload_storage_path + + @property + def failed_reference_task_names(self): + """Gets the failed_reference_task_names of this Workflow. # noqa: E501 + + + :return: The failed_reference_task_names of this Workflow. # noqa: E501 + :rtype: list[str] + """ + return self._failed_reference_task_names + + @failed_reference_task_names.setter + def failed_reference_task_names(self, failed_reference_task_names): + """Sets the failed_reference_task_names of this Workflow. + + + :param failed_reference_task_names: The failed_reference_task_names of this Workflow. # noqa: E501 + :type: list[str] + """ + + self._failed_reference_task_names = failed_reference_task_names + + @property + def failed_task_names(self): + """Gets the failed_task_names of this Workflow. # noqa: E501 + + + :return: The failed_task_names of this Workflow. # noqa: E501 + :rtype: list[str] + """ + return self._failed_task_names + + @failed_task_names.setter + def failed_task_names(self, failed_task_names): + """Sets the failed_task_names of this Workflow. + + + :param failed_task_names: The failed_task_names of this Workflow. # noqa: E501 + :type: list[str] + """ + + self._failed_task_names = failed_task_names + + @property + def history(self): + """Gets the history of this Workflow. # noqa: E501 + + + :return: The history of this Workflow. # noqa: E501 + :rtype: list[Workflow] + """ + return self._history + + @history.setter + def history(self, history): + """Sets the history of this Workflow. + + + :param history: The history of this Workflow. # noqa: E501 + :type: list[Workflow] + """ + + self._history = history + + @property + def idempotency_key(self): + """Gets the idempotency_key of this Workflow. # noqa: E501 + + + :return: The idempotency_key of this Workflow. # noqa: E501 + :rtype: str + """ + return self._idempotency_key + + @idempotency_key.setter + def idempotency_key(self, idempotency_key): + """Sets the idempotency_key of this Workflow. + + + :param idempotency_key: The idempotency_key of this Workflow. # noqa: E501 + :type: str + """ + + self._idempotency_key = idempotency_key + + @property + def input(self): + """Gets the input of this Workflow. # noqa: E501 + + + :return: The input of this Workflow. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input + + @input.setter + def input(self, input): + """Sets the input of this Workflow. + + + :param input: The input of this Workflow. # noqa: E501 + :type: dict(str, object) + """ + + self._input = input + + @property + def last_retried_time(self): + """Gets the last_retried_time of this Workflow. # noqa: E501 + + + :return: The last_retried_time of this Workflow. # noqa: E501 + :rtype: int + """ + return self._last_retried_time + + @last_retried_time.setter + def last_retried_time(self, last_retried_time): + """Sets the last_retried_time of this Workflow. + + + :param last_retried_time: The last_retried_time of this Workflow. # noqa: E501 + :type: int + """ + + self._last_retried_time = last_retried_time + + @property + def output(self): + """Gets the output of this Workflow. # noqa: E501 + + + :return: The output of this Workflow. # noqa: E501 + :rtype: dict(str, object) + """ + return self._output + + @output.setter + def output(self, output): + """Sets the output of this Workflow. + + + :param output: The output of this Workflow. # noqa: E501 + :type: dict(str, object) + """ + + self._output = output + + @property + def owner_app(self): + """Gets the owner_app of this Workflow. # noqa: E501 + + + :return: The owner_app of this Workflow. # noqa: E501 + :rtype: str + """ + return self._owner_app + + @owner_app.setter + def owner_app(self, owner_app): + """Sets the owner_app of this Workflow. + + + :param owner_app: The owner_app of this Workflow. # noqa: E501 + :type: str + """ + + self._owner_app = owner_app + + @property + def parent_workflow_id(self): + """Gets the parent_workflow_id of this Workflow. # noqa: E501 + + + :return: The parent_workflow_id of this Workflow. # noqa: E501 + :rtype: str + """ + return self._parent_workflow_id + + @parent_workflow_id.setter + def parent_workflow_id(self, parent_workflow_id): + """Sets the parent_workflow_id of this Workflow. + + + :param parent_workflow_id: The parent_workflow_id of this Workflow. # noqa: E501 + :type: str + """ + + self._parent_workflow_id = parent_workflow_id + + @property + def parent_workflow_task_id(self): + """Gets the parent_workflow_task_id of this Workflow. # noqa: E501 + + + :return: The parent_workflow_task_id of this Workflow. # noqa: E501 + :rtype: str + """ + return self._parent_workflow_task_id + + @parent_workflow_task_id.setter + def parent_workflow_task_id(self, parent_workflow_task_id): + """Sets the parent_workflow_task_id of this Workflow. + + + :param parent_workflow_task_id: The parent_workflow_task_id of this Workflow. # noqa: E501 + :type: str + """ + + self._parent_workflow_task_id = parent_workflow_task_id + + @property + def priority(self): + """Gets the priority of this Workflow. # noqa: E501 + + + :return: The priority of this Workflow. # noqa: E501 + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this Workflow. + + + :param priority: The priority of this Workflow. # noqa: E501 + :type: int + """ + + self._priority = priority + + @property + def rate_limit_key(self): + """Gets the rate_limit_key of this Workflow. # noqa: E501 + + + :return: The rate_limit_key of this Workflow. # noqa: E501 + :rtype: str + """ + return self._rate_limit_key + + @rate_limit_key.setter + def rate_limit_key(self, rate_limit_key): + """Sets the rate_limit_key of this Workflow. + + + :param rate_limit_key: The rate_limit_key of this Workflow. # noqa: E501 + :type: str + """ + + self._rate_limit_key = rate_limit_key + + @property + def rate_limited(self): + """Gets the rate_limited of this Workflow. # noqa: E501 + + + :return: The rate_limited of this Workflow. # noqa: E501 + :rtype: bool + """ + return self._rate_limited + + @rate_limited.setter + def rate_limited(self, rate_limited): + """Sets the rate_limited of this Workflow. + + + :param rate_limited: The rate_limited of this Workflow. # noqa: E501 + :type: bool + """ + + self._rate_limited = rate_limited + + @property + def re_run_from_workflow_id(self): + """Gets the re_run_from_workflow_id of this Workflow. # noqa: E501 + + + :return: The re_run_from_workflow_id of this Workflow. # noqa: E501 + :rtype: str + """ + return self._re_run_from_workflow_id + + @re_run_from_workflow_id.setter + def re_run_from_workflow_id(self, re_run_from_workflow_id): + """Sets the re_run_from_workflow_id of this Workflow. + + + :param re_run_from_workflow_id: The re_run_from_workflow_id of this Workflow. # noqa: E501 + :type: str + """ + + self._re_run_from_workflow_id = re_run_from_workflow_id + + @property + def reason_for_incompletion(self): + """Gets the reason_for_incompletion of this Workflow. # noqa: E501 + + + :return: The reason_for_incompletion of this Workflow. # noqa: E501 + :rtype: str + """ + return self._reason_for_incompletion + + @reason_for_incompletion.setter + def reason_for_incompletion(self, reason_for_incompletion): + """Sets the reason_for_incompletion of this Workflow. + + + :param reason_for_incompletion: The reason_for_incompletion of this Workflow. # noqa: E501 + :type: str + """ + + self._reason_for_incompletion = reason_for_incompletion + + @property + def start_time(self): + """Gets the start_time of this Workflow. # noqa: E501 + + + :return: The start_time of this Workflow. # noqa: E501 + :rtype: int + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this Workflow. + + + :param start_time: The start_time of this Workflow. # noqa: E501 + :type: int + """ + + self._start_time = start_time + + @property + def status(self): + """Gets the status of this Workflow. # noqa: E501 + + + :return: The status of this Workflow. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Workflow. + + + :param status: The status of this Workflow. # noqa: E501 + :type: str + """ + allowed_values = ["RUNNING", "COMPLETED", "FAILED", "TIMED_OUT", "TERMINATED", "PAUSED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def task_to_domain(self): + """Gets the task_to_domain of this Workflow. # noqa: E501 + + + :return: The task_to_domain of this Workflow. # noqa: E501 + :rtype: dict(str, str) + """ + return self._task_to_domain + + @task_to_domain.setter + def task_to_domain(self, task_to_domain): + """Sets the task_to_domain of this Workflow. + + + :param task_to_domain: The task_to_domain of this Workflow. # noqa: E501 + :type: dict(str, str) + """ + + self._task_to_domain = task_to_domain + + @property + def tasks(self): + """Gets the tasks of this Workflow. # noqa: E501 + + + :return: The tasks of this Workflow. # noqa: E501 + :rtype: list[Task] + """ + return self._tasks + + @tasks.setter + def tasks(self, tasks): + """Sets the tasks of this Workflow. + + + :param tasks: The tasks of this Workflow. # noqa: E501 + :type: list[Task] + """ + + self._tasks = tasks + + @property + def update_time(self): + """Gets the update_time of this Workflow. # noqa: E501 + + + :return: The update_time of this Workflow. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this Workflow. + + + :param update_time: The update_time of this Workflow. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this Workflow. # noqa: E501 + + + :return: The updated_by of this Workflow. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this Workflow. + + + :param updated_by: The updated_by of this Workflow. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + @property + def variables(self): + """Gets the variables of this Workflow. # noqa: E501 + + + :return: The variables of this Workflow. # noqa: E501 + :rtype: dict(str, object) + """ + return self._variables + + @variables.setter + def variables(self, variables): + """Sets the variables of this Workflow. + + + :param variables: The variables of this Workflow. # noqa: E501 + :type: dict(str, object) + """ + + self._variables = variables + + @property + def workflow_definition(self): + """Gets the workflow_definition of this Workflow. # noqa: E501 + + + :return: The workflow_definition of this Workflow. # noqa: E501 + :rtype: WorkflowDef + """ + return self._workflow_definition + + @workflow_definition.setter + def workflow_definition(self, workflow_definition): + """Sets the workflow_definition of this Workflow. + + + :param workflow_definition: The workflow_definition of this Workflow. # noqa: E501 + :type: WorkflowDef + """ + + self._workflow_definition = workflow_definition + + @property + def workflow_id(self): + """Gets the workflow_id of this Workflow. # noqa: E501 + + + :return: The workflow_id of this Workflow. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this Workflow. + + + :param workflow_id: The workflow_id of this Workflow. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + @property + def workflow_name(self): + """Gets the workflow_name of this Workflow. # noqa: E501 + + + :return: The workflow_name of this Workflow. # noqa: E501 + :rtype: str + """ + return self._workflow_name + + @workflow_name.setter + def workflow_name(self, workflow_name): + """Sets the workflow_name of this Workflow. + + + :param workflow_name: The workflow_name of this Workflow. # noqa: E501 + :type: str + """ + + self._workflow_name = workflow_name + + @property + def workflow_version(self): + """Gets the workflow_version of this Workflow. # noqa: E501 + + + :return: The workflow_version of this Workflow. # noqa: E501 + :rtype: int + """ + return self._workflow_version + + @workflow_version.setter + def workflow_version(self, workflow_version): + """Sets the workflow_version of this Workflow. + + + :param workflow_version: The workflow_version of this Workflow. # noqa: E501 + :type: int + """ + + self._workflow_version = workflow_version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Workflow, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Workflow): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow_def.py b/src/conductor/client/codegen/models/workflow_def.py new file mode 100644 index 00000000..d1b3f92f --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_def.py @@ -0,0 +1,820 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WorkflowDef(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'cache_config': 'CacheConfig', + 'create_time': 'int', + 'created_by': 'str', + 'description': 'str', + 'enforce_schema': 'bool', + 'failure_workflow': 'str', + 'input_parameters': 'list[str]', + 'input_schema': 'SchemaDef', + 'input_template': 'dict(str, object)', + 'masked_fields': 'list[str]', + 'metadata': 'dict(str, object)', + 'name': 'str', + 'output_parameters': 'dict(str, object)', + 'output_schema': 'SchemaDef', + 'owner_app': 'str', + 'owner_email': 'str', + 'rate_limit_config': 'RateLimitConfig', + 'restartable': 'bool', + 'schema_version': 'int', + 'tasks': 'list[WorkflowTask]', + 'timeout_policy': 'str', + 'timeout_seconds': 'int', + 'update_time': 'int', + 'updated_by': 'str', + 'variables': 'dict(str, object)', + 'version': 'int', + 'workflow_status_listener_enabled': 'bool', + 'workflow_status_listener_sink': 'str' + } + + attribute_map = { + 'cache_config': 'cacheConfig', + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'description': 'description', + 'enforce_schema': 'enforceSchema', + 'failure_workflow': 'failureWorkflow', + 'input_parameters': 'inputParameters', + 'input_schema': 'inputSchema', + 'input_template': 'inputTemplate', + 'masked_fields': 'maskedFields', + 'metadata': 'metadata', + 'name': 'name', + 'output_parameters': 'outputParameters', + 'output_schema': 'outputSchema', + 'owner_app': 'ownerApp', + 'owner_email': 'ownerEmail', + 'rate_limit_config': 'rateLimitConfig', + 'restartable': 'restartable', + 'schema_version': 'schemaVersion', + 'tasks': 'tasks', + 'timeout_policy': 'timeoutPolicy', + 'timeout_seconds': 'timeoutSeconds', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy', + 'variables': 'variables', + 'version': 'version', + 'workflow_status_listener_enabled': 'workflowStatusListenerEnabled', + 'workflow_status_listener_sink': 'workflowStatusListenerSink' + } + + def __init__(self, cache_config=None, create_time=None, created_by=None, description=None, enforce_schema=None, failure_workflow=None, input_parameters=None, input_schema=None, input_template=None, masked_fields=None, metadata=None, name=None, output_parameters=None, output_schema=None, owner_app=None, owner_email=None, rate_limit_config=None, restartable=None, schema_version=None, tasks=None, timeout_policy=None, timeout_seconds=None, update_time=None, updated_by=None, variables=None, version=None, workflow_status_listener_enabled=None, workflow_status_listener_sink=None): # noqa: E501 + """WorkflowDef - a model defined in Swagger""" # noqa: E501 + self._cache_config = None + self._create_time = None + self._created_by = None + self._description = None + self._enforce_schema = None + self._failure_workflow = None + self._input_parameters = None + self._input_schema = None + self._input_template = None + self._masked_fields = None + self._metadata = None + self._name = None + self._output_parameters = None + self._output_schema = None + self._owner_app = None + self._owner_email = None + self._rate_limit_config = None + self._restartable = None + self._schema_version = None + self._tasks = None + self._timeout_policy = None + self._timeout_seconds = None + self._update_time = None + self._updated_by = None + self._variables = None + self._version = None + self._workflow_status_listener_enabled = None + self._workflow_status_listener_sink = None + self.discriminator = None + if cache_config is not None: + self.cache_config = cache_config + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if description is not None: + self.description = description + if enforce_schema is not None: + self.enforce_schema = enforce_schema + if failure_workflow is not None: + self.failure_workflow = failure_workflow + if input_parameters is not None: + self.input_parameters = input_parameters + if input_schema is not None: + self.input_schema = input_schema + if input_template is not None: + self.input_template = input_template + if masked_fields is not None: + self.masked_fields = masked_fields + if metadata is not None: + self.metadata = metadata + if name is not None: + self.name = name + if output_parameters is not None: + self.output_parameters = output_parameters + if output_schema is not None: + self.output_schema = output_schema + if owner_app is not None: + self.owner_app = owner_app + if owner_email is not None: + self.owner_email = owner_email + if rate_limit_config is not None: + self.rate_limit_config = rate_limit_config + if restartable is not None: + self.restartable = restartable + if schema_version is not None: + self.schema_version = schema_version + self.tasks = tasks + if timeout_policy is not None: + self.timeout_policy = timeout_policy + self.timeout_seconds = timeout_seconds + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + if variables is not None: + self.variables = variables + if version is not None: + self.version = version + if workflow_status_listener_enabled is not None: + self.workflow_status_listener_enabled = workflow_status_listener_enabled + if workflow_status_listener_sink is not None: + self.workflow_status_listener_sink = workflow_status_listener_sink + + @property + def cache_config(self): + """Gets the cache_config of this WorkflowDef. # noqa: E501 + + + :return: The cache_config of this WorkflowDef. # noqa: E501 + :rtype: CacheConfig + """ + return self._cache_config + + @cache_config.setter + def cache_config(self, cache_config): + """Sets the cache_config of this WorkflowDef. + + + :param cache_config: The cache_config of this WorkflowDef. # noqa: E501 + :type: CacheConfig + """ + + self._cache_config = cache_config + + @property + def create_time(self): + """Gets the create_time of this WorkflowDef. # noqa: E501 + + + :return: The create_time of this WorkflowDef. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this WorkflowDef. + + + :param create_time: The create_time of this WorkflowDef. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this WorkflowDef. # noqa: E501 + + + :return: The created_by of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this WorkflowDef. + + + :param created_by: The created_by of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def description(self): + """Gets the description of this WorkflowDef. # noqa: E501 + + + :return: The description of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this WorkflowDef. + + + :param description: The description of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def enforce_schema(self): + """Gets the enforce_schema of this WorkflowDef. # noqa: E501 + + + :return: The enforce_schema of this WorkflowDef. # noqa: E501 + :rtype: bool + """ + return self._enforce_schema + + @enforce_schema.setter + def enforce_schema(self, enforce_schema): + """Sets the enforce_schema of this WorkflowDef. + + + :param enforce_schema: The enforce_schema of this WorkflowDef. # noqa: E501 + :type: bool + """ + + self._enforce_schema = enforce_schema + + @property + def failure_workflow(self): + """Gets the failure_workflow of this WorkflowDef. # noqa: E501 + + + :return: The failure_workflow of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._failure_workflow + + @failure_workflow.setter + def failure_workflow(self, failure_workflow): + """Sets the failure_workflow of this WorkflowDef. + + + :param failure_workflow: The failure_workflow of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._failure_workflow = failure_workflow + + @property + def input_parameters(self): + """Gets the input_parameters of this WorkflowDef. # noqa: E501 + + + :return: The input_parameters of this WorkflowDef. # noqa: E501 + :rtype: list[str] + """ + return self._input_parameters + + @input_parameters.setter + def input_parameters(self, input_parameters): + """Sets the input_parameters of this WorkflowDef. + + + :param input_parameters: The input_parameters of this WorkflowDef. # noqa: E501 + :type: list[str] + """ + + self._input_parameters = input_parameters + + @property + def input_schema(self): + """Gets the input_schema of this WorkflowDef. # noqa: E501 + + + :return: The input_schema of this WorkflowDef. # noqa: E501 + :rtype: SchemaDef + """ + return self._input_schema + + @input_schema.setter + def input_schema(self, input_schema): + """Sets the input_schema of this WorkflowDef. + + + :param input_schema: The input_schema of this WorkflowDef. # noqa: E501 + :type: SchemaDef + """ + + self._input_schema = input_schema + + @property + def input_template(self): + """Gets the input_template of this WorkflowDef. # noqa: E501 + + + :return: The input_template of this WorkflowDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input_template + + @input_template.setter + def input_template(self, input_template): + """Sets the input_template of this WorkflowDef. + + + :param input_template: The input_template of this WorkflowDef. # noqa: E501 + :type: dict(str, object) + """ + + self._input_template = input_template + + @property + def masked_fields(self): + """Gets the masked_fields of this WorkflowDef. # noqa: E501 + + + :return: The masked_fields of this WorkflowDef. # noqa: E501 + :rtype: list[str] + """ + return self._masked_fields + + @masked_fields.setter + def masked_fields(self, masked_fields): + """Sets the masked_fields of this WorkflowDef. + + + :param masked_fields: The masked_fields of this WorkflowDef. # noqa: E501 + :type: list[str] + """ + + self._masked_fields = masked_fields + + @property + def metadata(self): + """Gets the metadata of this WorkflowDef. # noqa: E501 + + + :return: The metadata of this WorkflowDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this WorkflowDef. + + + :param metadata: The metadata of this WorkflowDef. # noqa: E501 + :type: dict(str, object) + """ + + self._metadata = metadata + + @property + def name(self): + """Gets the name of this WorkflowDef. # noqa: E501 + + + :return: The name of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this WorkflowDef. + + + :param name: The name of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def output_parameters(self): + """Gets the output_parameters of this WorkflowDef. # noqa: E501 + + + :return: The output_parameters of this WorkflowDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._output_parameters + + @output_parameters.setter + def output_parameters(self, output_parameters): + """Sets the output_parameters of this WorkflowDef. + + + :param output_parameters: The output_parameters of this WorkflowDef. # noqa: E501 + :type: dict(str, object) + """ + + self._output_parameters = output_parameters + + @property + def output_schema(self): + """Gets the output_schema of this WorkflowDef. # noqa: E501 + + + :return: The output_schema of this WorkflowDef. # noqa: E501 + :rtype: SchemaDef + """ + return self._output_schema + + @output_schema.setter + def output_schema(self, output_schema): + """Sets the output_schema of this WorkflowDef. + + + :param output_schema: The output_schema of this WorkflowDef. # noqa: E501 + :type: SchemaDef + """ + + self._output_schema = output_schema + + @property + def owner_app(self): + """Gets the owner_app of this WorkflowDef. # noqa: E501 + + + :return: The owner_app of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._owner_app + + @owner_app.setter + def owner_app(self, owner_app): + """Sets the owner_app of this WorkflowDef. + + + :param owner_app: The owner_app of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._owner_app = owner_app + + @property + def owner_email(self): + """Gets the owner_email of this WorkflowDef. # noqa: E501 + + + :return: The owner_email of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._owner_email + + @owner_email.setter + def owner_email(self, owner_email): + """Sets the owner_email of this WorkflowDef. + + + :param owner_email: The owner_email of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._owner_email = owner_email + + @property + def rate_limit_config(self): + """Gets the rate_limit_config of this WorkflowDef. # noqa: E501 + + + :return: The rate_limit_config of this WorkflowDef. # noqa: E501 + :rtype: RateLimitConfig + """ + return self._rate_limit_config + + @rate_limit_config.setter + def rate_limit_config(self, rate_limit_config): + """Sets the rate_limit_config of this WorkflowDef. + + + :param rate_limit_config: The rate_limit_config of this WorkflowDef. # noqa: E501 + :type: RateLimitConfig + """ + + self._rate_limit_config = rate_limit_config + + @property + def restartable(self): + """Gets the restartable of this WorkflowDef. # noqa: E501 + + + :return: The restartable of this WorkflowDef. # noqa: E501 + :rtype: bool + """ + return self._restartable + + @restartable.setter + def restartable(self, restartable): + """Sets the restartable of this WorkflowDef. + + + :param restartable: The restartable of this WorkflowDef. # noqa: E501 + :type: bool + """ + + self._restartable = restartable + + @property + def schema_version(self): + """Gets the schema_version of this WorkflowDef. # noqa: E501 + + + :return: The schema_version of this WorkflowDef. # noqa: E501 + :rtype: int + """ + return self._schema_version + + @schema_version.setter + def schema_version(self, schema_version): + """Sets the schema_version of this WorkflowDef. + + + :param schema_version: The schema_version of this WorkflowDef. # noqa: E501 + :type: int + """ + + self._schema_version = schema_version + + @property + def tasks(self): + """Gets the tasks of this WorkflowDef. # noqa: E501 + + + :return: The tasks of this WorkflowDef. # noqa: E501 + :rtype: list[WorkflowTask] + """ + return self._tasks + + @tasks.setter + def tasks(self, tasks): + """Sets the tasks of this WorkflowDef. + + + :param tasks: The tasks of this WorkflowDef. # noqa: E501 + :type: list[WorkflowTask] + """ + if tasks is None: + raise ValueError("Invalid value for `tasks`, must not be `None`") # noqa: E501 + + self._tasks = tasks + + @property + def timeout_policy(self): + """Gets the timeout_policy of this WorkflowDef. # noqa: E501 + + + :return: The timeout_policy of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._timeout_policy + + @timeout_policy.setter + def timeout_policy(self, timeout_policy): + """Sets the timeout_policy of this WorkflowDef. + + + :param timeout_policy: The timeout_policy of this WorkflowDef. # noqa: E501 + :type: str + """ + allowed_values = ["TIME_OUT_WF", "ALERT_ONLY"] # noqa: E501 + if timeout_policy not in allowed_values: + raise ValueError( + "Invalid value for `timeout_policy` ({0}), must be one of {1}" # noqa: E501 + .format(timeout_policy, allowed_values) + ) + + self._timeout_policy = timeout_policy + + @property + def timeout_seconds(self): + """Gets the timeout_seconds of this WorkflowDef. # noqa: E501 + + + :return: The timeout_seconds of this WorkflowDef. # noqa: E501 + :rtype: int + """ + return self._timeout_seconds + + @timeout_seconds.setter + def timeout_seconds(self, timeout_seconds): + """Sets the timeout_seconds of this WorkflowDef. + + + :param timeout_seconds: The timeout_seconds of this WorkflowDef. # noqa: E501 + :type: int + """ + if timeout_seconds is None: + raise ValueError("Invalid value for `timeout_seconds`, must not be `None`") # noqa: E501 + + self._timeout_seconds = timeout_seconds + + @property + def update_time(self): + """Gets the update_time of this WorkflowDef. # noqa: E501 + + + :return: The update_time of this WorkflowDef. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this WorkflowDef. + + + :param update_time: The update_time of this WorkflowDef. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self): + """Gets the updated_by of this WorkflowDef. # noqa: E501 + + + :return: The updated_by of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this WorkflowDef. + + + :param updated_by: The updated_by of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + @property + def variables(self): + """Gets the variables of this WorkflowDef. # noqa: E501 + + + :return: The variables of this WorkflowDef. # noqa: E501 + :rtype: dict(str, object) + """ + return self._variables + + @variables.setter + def variables(self, variables): + """Sets the variables of this WorkflowDef. + + + :param variables: The variables of this WorkflowDef. # noqa: E501 + :type: dict(str, object) + """ + + self._variables = variables + + @property + def version(self): + """Gets the version of this WorkflowDef. # noqa: E501 + + + :return: The version of this WorkflowDef. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this WorkflowDef. + + + :param version: The version of this WorkflowDef. # noqa: E501 + :type: int + """ + + self._version = version + + @property + def workflow_status_listener_enabled(self): + """Gets the workflow_status_listener_enabled of this WorkflowDef. # noqa: E501 + + + :return: The workflow_status_listener_enabled of this WorkflowDef. # noqa: E501 + :rtype: bool + """ + return self._workflow_status_listener_enabled + + @workflow_status_listener_enabled.setter + def workflow_status_listener_enabled(self, workflow_status_listener_enabled): + """Sets the workflow_status_listener_enabled of this WorkflowDef. + + + :param workflow_status_listener_enabled: The workflow_status_listener_enabled of this WorkflowDef. # noqa: E501 + :type: bool + """ + + self._workflow_status_listener_enabled = workflow_status_listener_enabled + + @property + def workflow_status_listener_sink(self): + """Gets the workflow_status_listener_sink of this WorkflowDef. # noqa: E501 + + + :return: The workflow_status_listener_sink of this WorkflowDef. # noqa: E501 + :rtype: str + """ + return self._workflow_status_listener_sink + + @workflow_status_listener_sink.setter + def workflow_status_listener_sink(self, workflow_status_listener_sink): + """Sets the workflow_status_listener_sink of this WorkflowDef. + + + :param workflow_status_listener_sink: The workflow_status_listener_sink of this WorkflowDef. # noqa: E501 + :type: str + """ + + self._workflow_status_listener_sink = workflow_status_listener_sink + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowDef, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowDef): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow_run.py b/src/conductor/client/codegen/models/workflow_run.py new file mode 100644 index 00000000..ac9189f2 --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_run.py @@ -0,0 +1,402 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WorkflowRun(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'correlation_id': 'str', + 'create_time': 'int', + 'created_by': 'str', + 'input': 'dict(str, object)', + 'output': 'dict(str, object)', + 'priority': 'int', + 'request_id': 'str', + 'status': 'str', + 'tasks': 'list[Task]', + 'update_time': 'int', + 'variables': 'dict(str, object)', + 'workflow_id': 'str' + } + + attribute_map = { + 'correlation_id': 'correlationId', + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'input': 'input', + 'output': 'output', + 'priority': 'priority', + 'request_id': 'requestId', + 'status': 'status', + 'tasks': 'tasks', + 'update_time': 'updateTime', + 'variables': 'variables', + 'workflow_id': 'workflowId' + } + + def __init__(self, correlation_id=None, create_time=None, created_by=None, input=None, output=None, priority=None, request_id=None, status=None, tasks=None, update_time=None, variables=None, workflow_id=None): # noqa: E501 + """WorkflowRun - a model defined in Swagger""" # noqa: E501 + self._correlation_id = None + self._create_time = None + self._created_by = None + self._input = None + self._output = None + self._priority = None + self._request_id = None + self._status = None + self._tasks = None + self._update_time = None + self._variables = None + self._workflow_id = None + self.discriminator = None + if correlation_id is not None: + self.correlation_id = correlation_id + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if input is not None: + self.input = input + if output is not None: + self.output = output + if priority is not None: + self.priority = priority + if request_id is not None: + self.request_id = request_id + if status is not None: + self.status = status + if tasks is not None: + self.tasks = tasks + if update_time is not None: + self.update_time = update_time + if variables is not None: + self.variables = variables + if workflow_id is not None: + self.workflow_id = workflow_id + + @property + def correlation_id(self): + """Gets the correlation_id of this WorkflowRun. # noqa: E501 + + + :return: The correlation_id of this WorkflowRun. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this WorkflowRun. + + + :param correlation_id: The correlation_id of this WorkflowRun. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def create_time(self): + """Gets the create_time of this WorkflowRun. # noqa: E501 + + + :return: The create_time of this WorkflowRun. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this WorkflowRun. + + + :param create_time: The create_time of this WorkflowRun. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this WorkflowRun. # noqa: E501 + + + :return: The created_by of this WorkflowRun. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this WorkflowRun. + + + :param created_by: The created_by of this WorkflowRun. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def input(self): + """Gets the input of this WorkflowRun. # noqa: E501 + + + :return: The input of this WorkflowRun. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input + + @input.setter + def input(self, input): + """Sets the input of this WorkflowRun. + + + :param input: The input of this WorkflowRun. # noqa: E501 + :type: dict(str, object) + """ + + self._input = input + + @property + def output(self): + """Gets the output of this WorkflowRun. # noqa: E501 + + + :return: The output of this WorkflowRun. # noqa: E501 + :rtype: dict(str, object) + """ + return self._output + + @output.setter + def output(self, output): + """Sets the output of this WorkflowRun. + + + :param output: The output of this WorkflowRun. # noqa: E501 + :type: dict(str, object) + """ + + self._output = output + + @property + def priority(self): + """Gets the priority of this WorkflowRun. # noqa: E501 + + + :return: The priority of this WorkflowRun. # noqa: E501 + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this WorkflowRun. + + + :param priority: The priority of this WorkflowRun. # noqa: E501 + :type: int + """ + + self._priority = priority + + @property + def request_id(self): + """Gets the request_id of this WorkflowRun. # noqa: E501 + + + :return: The request_id of this WorkflowRun. # noqa: E501 + :rtype: str + """ + return self._request_id + + @request_id.setter + def request_id(self, request_id): + """Sets the request_id of this WorkflowRun. + + + :param request_id: The request_id of this WorkflowRun. # noqa: E501 + :type: str + """ + + self._request_id = request_id + + @property + def status(self): + """Gets the status of this WorkflowRun. # noqa: E501 + + + :return: The status of this WorkflowRun. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this WorkflowRun. + + + :param status: The status of this WorkflowRun. # noqa: E501 + :type: str + """ + allowed_values = ["RUNNING", "COMPLETED", "FAILED", "TIMED_OUT", "TERMINATED", "PAUSED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def tasks(self): + """Gets the tasks of this WorkflowRun. # noqa: E501 + + + :return: The tasks of this WorkflowRun. # noqa: E501 + :rtype: list[Task] + """ + return self._tasks + + @tasks.setter + def tasks(self, tasks): + """Sets the tasks of this WorkflowRun. + + + :param tasks: The tasks of this WorkflowRun. # noqa: E501 + :type: list[Task] + """ + + self._tasks = tasks + + @property + def update_time(self): + """Gets the update_time of this WorkflowRun. # noqa: E501 + + + :return: The update_time of this WorkflowRun. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this WorkflowRun. + + + :param update_time: The update_time of this WorkflowRun. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def variables(self): + """Gets the variables of this WorkflowRun. # noqa: E501 + + + :return: The variables of this WorkflowRun. # noqa: E501 + :rtype: dict(str, object) + """ + return self._variables + + @variables.setter + def variables(self, variables): + """Sets the variables of this WorkflowRun. + + + :param variables: The variables of this WorkflowRun. # noqa: E501 + :type: dict(str, object) + """ + + self._variables = variables + + @property + def workflow_id(self): + """Gets the workflow_id of this WorkflowRun. # noqa: E501 + + + :return: The workflow_id of this WorkflowRun. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this WorkflowRun. + + + :param workflow_id: The workflow_id of this WorkflowRun. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowRun, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowRun): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow_schedule.py b/src/conductor/client/codegen/models/workflow_schedule.py new file mode 100644 index 00000000..4a6377f2 --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_schedule.py @@ -0,0 +1,474 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WorkflowSchedule(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'create_time': 'int', + 'created_by': 'str', + 'cron_expression': 'str', + 'description': 'str', + 'name': 'str', + 'paused': 'bool', + 'paused_reason': 'str', + 'run_catchup_schedule_instances': 'bool', + 'schedule_end_time': 'int', + 'schedule_start_time': 'int', + 'start_workflow_request': 'StartWorkflowRequest', + 'tags': 'list[Tag]', + 'updated_by': 'str', + 'updated_time': 'int', + 'zone_id': 'str' + } + + attribute_map = { + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'cron_expression': 'cronExpression', + 'description': 'description', + 'name': 'name', + 'paused': 'paused', + 'paused_reason': 'pausedReason', + 'run_catchup_schedule_instances': 'runCatchupScheduleInstances', + 'schedule_end_time': 'scheduleEndTime', + 'schedule_start_time': 'scheduleStartTime', + 'start_workflow_request': 'startWorkflowRequest', + 'tags': 'tags', + 'updated_by': 'updatedBy', + 'updated_time': 'updatedTime', + 'zone_id': 'zoneId' + } + + def __init__(self, create_time=None, created_by=None, cron_expression=None, description=None, name=None, paused=None, paused_reason=None, run_catchup_schedule_instances=None, schedule_end_time=None, schedule_start_time=None, start_workflow_request=None, tags=None, updated_by=None, updated_time=None, zone_id=None): # noqa: E501 + """WorkflowSchedule - a model defined in Swagger""" # noqa: E501 + self._create_time = None + self._created_by = None + self._cron_expression = None + self._description = None + self._name = None + self._paused = None + self._paused_reason = None + self._run_catchup_schedule_instances = None + self._schedule_end_time = None + self._schedule_start_time = None + self._start_workflow_request = None + self._tags = None + self._updated_by = None + self._updated_time = None + self._zone_id = None + self.discriminator = None + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if cron_expression is not None: + self.cron_expression = cron_expression + if description is not None: + self.description = description + if name is not None: + self.name = name + if paused is not None: + self.paused = paused + if paused_reason is not None: + self.paused_reason = paused_reason + if run_catchup_schedule_instances is not None: + self.run_catchup_schedule_instances = run_catchup_schedule_instances + if schedule_end_time is not None: + self.schedule_end_time = schedule_end_time + if schedule_start_time is not None: + self.schedule_start_time = schedule_start_time + if start_workflow_request is not None: + self.start_workflow_request = start_workflow_request + if tags is not None: + self.tags = tags + if updated_by is not None: + self.updated_by = updated_by + if updated_time is not None: + self.updated_time = updated_time + if zone_id is not None: + self.zone_id = zone_id + + @property + def create_time(self): + """Gets the create_time of this WorkflowSchedule. # noqa: E501 + + + :return: The create_time of this WorkflowSchedule. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this WorkflowSchedule. + + + :param create_time: The create_time of this WorkflowSchedule. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this WorkflowSchedule. # noqa: E501 + + + :return: The created_by of this WorkflowSchedule. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this WorkflowSchedule. + + + :param created_by: The created_by of this WorkflowSchedule. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def cron_expression(self): + """Gets the cron_expression of this WorkflowSchedule. # noqa: E501 + + + :return: The cron_expression of this WorkflowSchedule. # noqa: E501 + :rtype: str + """ + return self._cron_expression + + @cron_expression.setter + def cron_expression(self, cron_expression): + """Sets the cron_expression of this WorkflowSchedule. + + + :param cron_expression: The cron_expression of this WorkflowSchedule. # noqa: E501 + :type: str + """ + + self._cron_expression = cron_expression + + @property + def description(self): + """Gets the description of this WorkflowSchedule. # noqa: E501 + + + :return: The description of this WorkflowSchedule. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this WorkflowSchedule. + + + :param description: The description of this WorkflowSchedule. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def name(self): + """Gets the name of this WorkflowSchedule. # noqa: E501 + + + :return: The name of this WorkflowSchedule. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this WorkflowSchedule. + + + :param name: The name of this WorkflowSchedule. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def paused(self): + """Gets the paused of this WorkflowSchedule. # noqa: E501 + + + :return: The paused of this WorkflowSchedule. # noqa: E501 + :rtype: bool + """ + return self._paused + + @paused.setter + def paused(self, paused): + """Sets the paused of this WorkflowSchedule. + + + :param paused: The paused of this WorkflowSchedule. # noqa: E501 + :type: bool + """ + + self._paused = paused + + @property + def paused_reason(self): + """Gets the paused_reason of this WorkflowSchedule. # noqa: E501 + + + :return: The paused_reason of this WorkflowSchedule. # noqa: E501 + :rtype: str + """ + return self._paused_reason + + @paused_reason.setter + def paused_reason(self, paused_reason): + """Sets the paused_reason of this WorkflowSchedule. + + + :param paused_reason: The paused_reason of this WorkflowSchedule. # noqa: E501 + :type: str + """ + + self._paused_reason = paused_reason + + @property + def run_catchup_schedule_instances(self): + """Gets the run_catchup_schedule_instances of this WorkflowSchedule. # noqa: E501 + + + :return: The run_catchup_schedule_instances of this WorkflowSchedule. # noqa: E501 + :rtype: bool + """ + return self._run_catchup_schedule_instances + + @run_catchup_schedule_instances.setter + def run_catchup_schedule_instances(self, run_catchup_schedule_instances): + """Sets the run_catchup_schedule_instances of this WorkflowSchedule. + + + :param run_catchup_schedule_instances: The run_catchup_schedule_instances of this WorkflowSchedule. # noqa: E501 + :type: bool + """ + + self._run_catchup_schedule_instances = run_catchup_schedule_instances + + @property + def schedule_end_time(self): + """Gets the schedule_end_time of this WorkflowSchedule. # noqa: E501 + + + :return: The schedule_end_time of this WorkflowSchedule. # noqa: E501 + :rtype: int + """ + return self._schedule_end_time + + @schedule_end_time.setter + def schedule_end_time(self, schedule_end_time): + """Sets the schedule_end_time of this WorkflowSchedule. + + + :param schedule_end_time: The schedule_end_time of this WorkflowSchedule. # noqa: E501 + :type: int + """ + + self._schedule_end_time = schedule_end_time + + @property + def schedule_start_time(self): + """Gets the schedule_start_time of this WorkflowSchedule. # noqa: E501 + + + :return: The schedule_start_time of this WorkflowSchedule. # noqa: E501 + :rtype: int + """ + return self._schedule_start_time + + @schedule_start_time.setter + def schedule_start_time(self, schedule_start_time): + """Sets the schedule_start_time of this WorkflowSchedule. + + + :param schedule_start_time: The schedule_start_time of this WorkflowSchedule. # noqa: E501 + :type: int + """ + + self._schedule_start_time = schedule_start_time + + @property + def start_workflow_request(self): + """Gets the start_workflow_request of this WorkflowSchedule. # noqa: E501 + + + :return: The start_workflow_request of this WorkflowSchedule. # noqa: E501 + :rtype: StartWorkflowRequest + """ + return self._start_workflow_request + + @start_workflow_request.setter + def start_workflow_request(self, start_workflow_request): + """Sets the start_workflow_request of this WorkflowSchedule. + + + :param start_workflow_request: The start_workflow_request of this WorkflowSchedule. # noqa: E501 + :type: StartWorkflowRequest + """ + + self._start_workflow_request = start_workflow_request + + @property + def tags(self): + """Gets the tags of this WorkflowSchedule. # noqa: E501 + + + :return: The tags of this WorkflowSchedule. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this WorkflowSchedule. + + + :param tags: The tags of this WorkflowSchedule. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def updated_by(self): + """Gets the updated_by of this WorkflowSchedule. # noqa: E501 + + + :return: The updated_by of this WorkflowSchedule. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this WorkflowSchedule. + + + :param updated_by: The updated_by of this WorkflowSchedule. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + @property + def updated_time(self): + """Gets the updated_time of this WorkflowSchedule. # noqa: E501 + + + :return: The updated_time of this WorkflowSchedule. # noqa: E501 + :rtype: int + """ + return self._updated_time + + @updated_time.setter + def updated_time(self, updated_time): + """Sets the updated_time of this WorkflowSchedule. + + + :param updated_time: The updated_time of this WorkflowSchedule. # noqa: E501 + :type: int + """ + + self._updated_time = updated_time + + @property + def zone_id(self): + """Gets the zone_id of this WorkflowSchedule. # noqa: E501 + + + :return: The zone_id of this WorkflowSchedule. # noqa: E501 + :rtype: str + """ + return self._zone_id + + @zone_id.setter + def zone_id(self, zone_id): + """Sets the zone_id of this WorkflowSchedule. + + + :param zone_id: The zone_id of this WorkflowSchedule. # noqa: E501 + :type: str + """ + + self._zone_id = zone_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowSchedule, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowSchedule): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow_schedule_execution_model.py b/src/conductor/client/codegen/models/workflow_schedule_execution_model.py new file mode 100644 index 00000000..b6c24293 --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_schedule_execution_model.py @@ -0,0 +1,428 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WorkflowScheduleExecutionModel(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'execution_id': 'str', + 'execution_time': 'int', + 'org_id': 'str', + 'queue_msg_id': 'str', + 'reason': 'str', + 'schedule_name': 'str', + 'scheduled_time': 'int', + 'stack_trace': 'str', + 'start_workflow_request': 'StartWorkflowRequest', + 'state': 'str', + 'workflow_id': 'str', + 'workflow_name': 'str', + 'zone_id': 'str' + } + + attribute_map = { + 'execution_id': 'executionId', + 'execution_time': 'executionTime', + 'org_id': 'orgId', + 'queue_msg_id': 'queueMsgId', + 'reason': 'reason', + 'schedule_name': 'scheduleName', + 'scheduled_time': 'scheduledTime', + 'stack_trace': 'stackTrace', + 'start_workflow_request': 'startWorkflowRequest', + 'state': 'state', + 'workflow_id': 'workflowId', + 'workflow_name': 'workflowName', + 'zone_id': 'zoneId' + } + + def __init__(self, execution_id=None, execution_time=None, org_id=None, queue_msg_id=None, reason=None, schedule_name=None, scheduled_time=None, stack_trace=None, start_workflow_request=None, state=None, workflow_id=None, workflow_name=None, zone_id=None): # noqa: E501 + """WorkflowScheduleExecutionModel - a model defined in Swagger""" # noqa: E501 + self._execution_id = None + self._execution_time = None + self._org_id = None + self._queue_msg_id = None + self._reason = None + self._schedule_name = None + self._scheduled_time = None + self._stack_trace = None + self._start_workflow_request = None + self._state = None + self._workflow_id = None + self._workflow_name = None + self._zone_id = None + self.discriminator = None + if execution_id is not None: + self.execution_id = execution_id + if execution_time is not None: + self.execution_time = execution_time + if org_id is not None: + self.org_id = org_id + if queue_msg_id is not None: + self.queue_msg_id = queue_msg_id + if reason is not None: + self.reason = reason + if schedule_name is not None: + self.schedule_name = schedule_name + if scheduled_time is not None: + self.scheduled_time = scheduled_time + if stack_trace is not None: + self.stack_trace = stack_trace + if start_workflow_request is not None: + self.start_workflow_request = start_workflow_request + if state is not None: + self.state = state + if workflow_id is not None: + self.workflow_id = workflow_id + if workflow_name is not None: + self.workflow_name = workflow_name + if zone_id is not None: + self.zone_id = zone_id + + @property + def execution_id(self): + """Gets the execution_id of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The execution_id of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: str + """ + return self._execution_id + + @execution_id.setter + def execution_id(self, execution_id): + """Sets the execution_id of this WorkflowScheduleExecutionModel. + + + :param execution_id: The execution_id of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: str + """ + + self._execution_id = execution_id + + @property + def execution_time(self): + """Gets the execution_time of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The execution_time of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: int + """ + return self._execution_time + + @execution_time.setter + def execution_time(self, execution_time): + """Sets the execution_time of this WorkflowScheduleExecutionModel. + + + :param execution_time: The execution_time of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: int + """ + + self._execution_time = execution_time + + @property + def org_id(self): + """Gets the org_id of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The org_id of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: str + """ + return self._org_id + + @org_id.setter + def org_id(self, org_id): + """Sets the org_id of this WorkflowScheduleExecutionModel. + + + :param org_id: The org_id of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: str + """ + + self._org_id = org_id + + @property + def queue_msg_id(self): + """Gets the queue_msg_id of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The queue_msg_id of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: str + """ + return self._queue_msg_id + + @queue_msg_id.setter + def queue_msg_id(self, queue_msg_id): + """Sets the queue_msg_id of this WorkflowScheduleExecutionModel. + + + :param queue_msg_id: The queue_msg_id of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: str + """ + + self._queue_msg_id = queue_msg_id + + @property + def reason(self): + """Gets the reason of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The reason of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this WorkflowScheduleExecutionModel. + + + :param reason: The reason of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: str + """ + + self._reason = reason + + @property + def schedule_name(self): + """Gets the schedule_name of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The schedule_name of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: str + """ + return self._schedule_name + + @schedule_name.setter + def schedule_name(self, schedule_name): + """Sets the schedule_name of this WorkflowScheduleExecutionModel. + + + :param schedule_name: The schedule_name of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: str + """ + + self._schedule_name = schedule_name + + @property + def scheduled_time(self): + """Gets the scheduled_time of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The scheduled_time of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: int + """ + return self._scheduled_time + + @scheduled_time.setter + def scheduled_time(self, scheduled_time): + """Sets the scheduled_time of this WorkflowScheduleExecutionModel. + + + :param scheduled_time: The scheduled_time of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: int + """ + + self._scheduled_time = scheduled_time + + @property + def stack_trace(self): + """Gets the stack_trace of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The stack_trace of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: str + """ + return self._stack_trace + + @stack_trace.setter + def stack_trace(self, stack_trace): + """Sets the stack_trace of this WorkflowScheduleExecutionModel. + + + :param stack_trace: The stack_trace of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: str + """ + + self._stack_trace = stack_trace + + @property + def start_workflow_request(self): + """Gets the start_workflow_request of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The start_workflow_request of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: StartWorkflowRequest + """ + return self._start_workflow_request + + @start_workflow_request.setter + def start_workflow_request(self, start_workflow_request): + """Sets the start_workflow_request of this WorkflowScheduleExecutionModel. + + + :param start_workflow_request: The start_workflow_request of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: StartWorkflowRequest + """ + + self._start_workflow_request = start_workflow_request + + @property + def state(self): + """Gets the state of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The state of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this WorkflowScheduleExecutionModel. + + + :param state: The state of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: str + """ + allowed_values = ["POLLED", "FAILED", "EXECUTED"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + @property + def workflow_id(self): + """Gets the workflow_id of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The workflow_id of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this WorkflowScheduleExecutionModel. + + + :param workflow_id: The workflow_id of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + @property + def workflow_name(self): + """Gets the workflow_name of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The workflow_name of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: str + """ + return self._workflow_name + + @workflow_name.setter + def workflow_name(self, workflow_name): + """Sets the workflow_name of this WorkflowScheduleExecutionModel. + + + :param workflow_name: The workflow_name of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: str + """ + + self._workflow_name = workflow_name + + @property + def zone_id(self): + """Gets the zone_id of this WorkflowScheduleExecutionModel. # noqa: E501 + + + :return: The zone_id of this WorkflowScheduleExecutionModel. # noqa: E501 + :rtype: str + """ + return self._zone_id + + @zone_id.setter + def zone_id(self, zone_id): + """Sets the zone_id of this WorkflowScheduleExecutionModel. + + + :param zone_id: The zone_id of this WorkflowScheduleExecutionModel. # noqa: E501 + :type: str + """ + + self._zone_id = zone_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowScheduleExecutionModel, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowScheduleExecutionModel): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow_schedule_model.py b/src/conductor/client/codegen/models/workflow_schedule_model.py new file mode 100644 index 00000000..79371af3 --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_schedule_model.py @@ -0,0 +1,526 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WorkflowScheduleModel(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'create_time': 'int', + 'created_by': 'str', + 'cron_expression': 'str', + 'description': 'str', + 'name': 'str', + 'org_id': 'str', + 'paused': 'bool', + 'paused_reason': 'str', + 'queue_msg_id': 'str', + 'run_catchup_schedule_instances': 'bool', + 'schedule_end_time': 'int', + 'schedule_start_time': 'int', + 'start_workflow_request': 'StartWorkflowRequest', + 'tags': 'list[Tag]', + 'updated_by': 'str', + 'updated_time': 'int', + 'zone_id': 'str' + } + + attribute_map = { + 'create_time': 'createTime', + 'created_by': 'createdBy', + 'cron_expression': 'cronExpression', + 'description': 'description', + 'name': 'name', + 'org_id': 'orgId', + 'paused': 'paused', + 'paused_reason': 'pausedReason', + 'queue_msg_id': 'queueMsgId', + 'run_catchup_schedule_instances': 'runCatchupScheduleInstances', + 'schedule_end_time': 'scheduleEndTime', + 'schedule_start_time': 'scheduleStartTime', + 'start_workflow_request': 'startWorkflowRequest', + 'tags': 'tags', + 'updated_by': 'updatedBy', + 'updated_time': 'updatedTime', + 'zone_id': 'zoneId' + } + + def __init__(self, create_time=None, created_by=None, cron_expression=None, description=None, name=None, org_id=None, paused=None, paused_reason=None, queue_msg_id=None, run_catchup_schedule_instances=None, schedule_end_time=None, schedule_start_time=None, start_workflow_request=None, tags=None, updated_by=None, updated_time=None, zone_id=None): # noqa: E501 + """WorkflowScheduleModel - a model defined in Swagger""" # noqa: E501 + self._create_time = None + self._created_by = None + self._cron_expression = None + self._description = None + self._name = None + self._org_id = None + self._paused = None + self._paused_reason = None + self._queue_msg_id = None + self._run_catchup_schedule_instances = None + self._schedule_end_time = None + self._schedule_start_time = None + self._start_workflow_request = None + self._tags = None + self._updated_by = None + self._updated_time = None + self._zone_id = None + self.discriminator = None + if create_time is not None: + self.create_time = create_time + if created_by is not None: + self.created_by = created_by + if cron_expression is not None: + self.cron_expression = cron_expression + if description is not None: + self.description = description + if name is not None: + self.name = name + if org_id is not None: + self.org_id = org_id + if paused is not None: + self.paused = paused + if paused_reason is not None: + self.paused_reason = paused_reason + if queue_msg_id is not None: + self.queue_msg_id = queue_msg_id + if run_catchup_schedule_instances is not None: + self.run_catchup_schedule_instances = run_catchup_schedule_instances + if schedule_end_time is not None: + self.schedule_end_time = schedule_end_time + if schedule_start_time is not None: + self.schedule_start_time = schedule_start_time + if start_workflow_request is not None: + self.start_workflow_request = start_workflow_request + if tags is not None: + self.tags = tags + if updated_by is not None: + self.updated_by = updated_by + if updated_time is not None: + self.updated_time = updated_time + if zone_id is not None: + self.zone_id = zone_id + + @property + def create_time(self): + """Gets the create_time of this WorkflowScheduleModel. # noqa: E501 + + + :return: The create_time of this WorkflowScheduleModel. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this WorkflowScheduleModel. + + + :param create_time: The create_time of this WorkflowScheduleModel. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def created_by(self): + """Gets the created_by of this WorkflowScheduleModel. # noqa: E501 + + + :return: The created_by of this WorkflowScheduleModel. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this WorkflowScheduleModel. + + + :param created_by: The created_by of this WorkflowScheduleModel. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def cron_expression(self): + """Gets the cron_expression of this WorkflowScheduleModel. # noqa: E501 + + + :return: The cron_expression of this WorkflowScheduleModel. # noqa: E501 + :rtype: str + """ + return self._cron_expression + + @cron_expression.setter + def cron_expression(self, cron_expression): + """Sets the cron_expression of this WorkflowScheduleModel. + + + :param cron_expression: The cron_expression of this WorkflowScheduleModel. # noqa: E501 + :type: str + """ + + self._cron_expression = cron_expression + + @property + def description(self): + """Gets the description of this WorkflowScheduleModel. # noqa: E501 + + + :return: The description of this WorkflowScheduleModel. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this WorkflowScheduleModel. + + + :param description: The description of this WorkflowScheduleModel. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def name(self): + """Gets the name of this WorkflowScheduleModel. # noqa: E501 + + + :return: The name of this WorkflowScheduleModel. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this WorkflowScheduleModel. + + + :param name: The name of this WorkflowScheduleModel. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def org_id(self): + """Gets the org_id of this WorkflowScheduleModel. # noqa: E501 + + + :return: The org_id of this WorkflowScheduleModel. # noqa: E501 + :rtype: str + """ + return self._org_id + + @org_id.setter + def org_id(self, org_id): + """Sets the org_id of this WorkflowScheduleModel. + + + :param org_id: The org_id of this WorkflowScheduleModel. # noqa: E501 + :type: str + """ + + self._org_id = org_id + + @property + def paused(self): + """Gets the paused of this WorkflowScheduleModel. # noqa: E501 + + + :return: The paused of this WorkflowScheduleModel. # noqa: E501 + :rtype: bool + """ + return self._paused + + @paused.setter + def paused(self, paused): + """Sets the paused of this WorkflowScheduleModel. + + + :param paused: The paused of this WorkflowScheduleModel. # noqa: E501 + :type: bool + """ + + self._paused = paused + + @property + def paused_reason(self): + """Gets the paused_reason of this WorkflowScheduleModel. # noqa: E501 + + + :return: The paused_reason of this WorkflowScheduleModel. # noqa: E501 + :rtype: str + """ + return self._paused_reason + + @paused_reason.setter + def paused_reason(self, paused_reason): + """Sets the paused_reason of this WorkflowScheduleModel. + + + :param paused_reason: The paused_reason of this WorkflowScheduleModel. # noqa: E501 + :type: str + """ + + self._paused_reason = paused_reason + + @property + def queue_msg_id(self): + """Gets the queue_msg_id of this WorkflowScheduleModel. # noqa: E501 + + + :return: The queue_msg_id of this WorkflowScheduleModel. # noqa: E501 + :rtype: str + """ + return self._queue_msg_id + + @queue_msg_id.setter + def queue_msg_id(self, queue_msg_id): + """Sets the queue_msg_id of this WorkflowScheduleModel. + + + :param queue_msg_id: The queue_msg_id of this WorkflowScheduleModel. # noqa: E501 + :type: str + """ + + self._queue_msg_id = queue_msg_id + + @property + def run_catchup_schedule_instances(self): + """Gets the run_catchup_schedule_instances of this WorkflowScheduleModel. # noqa: E501 + + + :return: The run_catchup_schedule_instances of this WorkflowScheduleModel. # noqa: E501 + :rtype: bool + """ + return self._run_catchup_schedule_instances + + @run_catchup_schedule_instances.setter + def run_catchup_schedule_instances(self, run_catchup_schedule_instances): + """Sets the run_catchup_schedule_instances of this WorkflowScheduleModel. + + + :param run_catchup_schedule_instances: The run_catchup_schedule_instances of this WorkflowScheduleModel. # noqa: E501 + :type: bool + """ + + self._run_catchup_schedule_instances = run_catchup_schedule_instances + + @property + def schedule_end_time(self): + """Gets the schedule_end_time of this WorkflowScheduleModel. # noqa: E501 + + + :return: The schedule_end_time of this WorkflowScheduleModel. # noqa: E501 + :rtype: int + """ + return self._schedule_end_time + + @schedule_end_time.setter + def schedule_end_time(self, schedule_end_time): + """Sets the schedule_end_time of this WorkflowScheduleModel. + + + :param schedule_end_time: The schedule_end_time of this WorkflowScheduleModel. # noqa: E501 + :type: int + """ + + self._schedule_end_time = schedule_end_time + + @property + def schedule_start_time(self): + """Gets the schedule_start_time of this WorkflowScheduleModel. # noqa: E501 + + + :return: The schedule_start_time of this WorkflowScheduleModel. # noqa: E501 + :rtype: int + """ + return self._schedule_start_time + + @schedule_start_time.setter + def schedule_start_time(self, schedule_start_time): + """Sets the schedule_start_time of this WorkflowScheduleModel. + + + :param schedule_start_time: The schedule_start_time of this WorkflowScheduleModel. # noqa: E501 + :type: int + """ + + self._schedule_start_time = schedule_start_time + + @property + def start_workflow_request(self): + """Gets the start_workflow_request of this WorkflowScheduleModel. # noqa: E501 + + + :return: The start_workflow_request of this WorkflowScheduleModel. # noqa: E501 + :rtype: StartWorkflowRequest + """ + return self._start_workflow_request + + @start_workflow_request.setter + def start_workflow_request(self, start_workflow_request): + """Sets the start_workflow_request of this WorkflowScheduleModel. + + + :param start_workflow_request: The start_workflow_request of this WorkflowScheduleModel. # noqa: E501 + :type: StartWorkflowRequest + """ + + self._start_workflow_request = start_workflow_request + + @property + def tags(self): + """Gets the tags of this WorkflowScheduleModel. # noqa: E501 + + + :return: The tags of this WorkflowScheduleModel. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this WorkflowScheduleModel. + + + :param tags: The tags of this WorkflowScheduleModel. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def updated_by(self): + """Gets the updated_by of this WorkflowScheduleModel. # noqa: E501 + + + :return: The updated_by of this WorkflowScheduleModel. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by): + """Sets the updated_by of this WorkflowScheduleModel. + + + :param updated_by: The updated_by of this WorkflowScheduleModel. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + @property + def updated_time(self): + """Gets the updated_time of this WorkflowScheduleModel. # noqa: E501 + + + :return: The updated_time of this WorkflowScheduleModel. # noqa: E501 + :rtype: int + """ + return self._updated_time + + @updated_time.setter + def updated_time(self, updated_time): + """Sets the updated_time of this WorkflowScheduleModel. + + + :param updated_time: The updated_time of this WorkflowScheduleModel. # noqa: E501 + :type: int + """ + + self._updated_time = updated_time + + @property + def zone_id(self): + """Gets the zone_id of this WorkflowScheduleModel. # noqa: E501 + + + :return: The zone_id of this WorkflowScheduleModel. # noqa: E501 + :rtype: str + """ + return self._zone_id + + @zone_id.setter + def zone_id(self, zone_id): + """Sets the zone_id of this WorkflowScheduleModel. + + + :param zone_id: The zone_id of this WorkflowScheduleModel. # noqa: E501 + :type: str + """ + + self._zone_id = zone_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowScheduleModel, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowScheduleModel): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow_state_update.py b/src/conductor/client/codegen/models/workflow_state_update.py new file mode 100644 index 00000000..ed00d502 --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_state_update.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WorkflowStateUpdate(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'task_reference_name': 'str', + 'task_result': 'TaskResult', + 'variables': 'dict(str, object)' + } + + attribute_map = { + 'task_reference_name': 'taskReferenceName', + 'task_result': 'taskResult', + 'variables': 'variables' + } + + def __init__(self, task_reference_name=None, task_result=None, variables=None): # noqa: E501 + """WorkflowStateUpdate - a model defined in Swagger""" # noqa: E501 + self._task_reference_name = None + self._task_result = None + self._variables = None + self.discriminator = None + if task_reference_name is not None: + self.task_reference_name = task_reference_name + if task_result is not None: + self.task_result = task_result + if variables is not None: + self.variables = variables + + @property + def task_reference_name(self): + """Gets the task_reference_name of this WorkflowStateUpdate. # noqa: E501 + + + :return: The task_reference_name of this WorkflowStateUpdate. # noqa: E501 + :rtype: str + """ + return self._task_reference_name + + @task_reference_name.setter + def task_reference_name(self, task_reference_name): + """Sets the task_reference_name of this WorkflowStateUpdate. + + + :param task_reference_name: The task_reference_name of this WorkflowStateUpdate. # noqa: E501 + :type: str + """ + + self._task_reference_name = task_reference_name + + @property + def task_result(self): + """Gets the task_result of this WorkflowStateUpdate. # noqa: E501 + + + :return: The task_result of this WorkflowStateUpdate. # noqa: E501 + :rtype: TaskResult + """ + return self._task_result + + @task_result.setter + def task_result(self, task_result): + """Sets the task_result of this WorkflowStateUpdate. + + + :param task_result: The task_result of this WorkflowStateUpdate. # noqa: E501 + :type: TaskResult + """ + + self._task_result = task_result + + @property + def variables(self): + """Gets the variables of this WorkflowStateUpdate. # noqa: E501 + + + :return: The variables of this WorkflowStateUpdate. # noqa: E501 + :rtype: dict(str, object) + """ + return self._variables + + @variables.setter + def variables(self, variables): + """Sets the variables of this WorkflowStateUpdate. + + + :param variables: The variables of this WorkflowStateUpdate. # noqa: E501 + :type: dict(str, object) + """ + + self._variables = variables + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowStateUpdate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowStateUpdate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow_status.py b/src/conductor/client/codegen/models/workflow_status.py new file mode 100644 index 00000000..267d0f9e --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_status.py @@ -0,0 +1,220 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WorkflowStatus(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'correlation_id': 'str', + 'output': 'dict(str, object)', + 'status': 'str', + 'variables': 'dict(str, object)', + 'workflow_id': 'str' + } + + attribute_map = { + 'correlation_id': 'correlationId', + 'output': 'output', + 'status': 'status', + 'variables': 'variables', + 'workflow_id': 'workflowId' + } + + def __init__(self, correlation_id=None, output=None, status=None, variables=None, workflow_id=None): # noqa: E501 + """WorkflowStatus - a model defined in Swagger""" # noqa: E501 + self._correlation_id = None + self._output = None + self._status = None + self._variables = None + self._workflow_id = None + self.discriminator = None + if correlation_id is not None: + self.correlation_id = correlation_id + if output is not None: + self.output = output + if status is not None: + self.status = status + if variables is not None: + self.variables = variables + if workflow_id is not None: + self.workflow_id = workflow_id + + @property + def correlation_id(self): + """Gets the correlation_id of this WorkflowStatus. # noqa: E501 + + + :return: The correlation_id of this WorkflowStatus. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this WorkflowStatus. + + + :param correlation_id: The correlation_id of this WorkflowStatus. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def output(self): + """Gets the output of this WorkflowStatus. # noqa: E501 + + + :return: The output of this WorkflowStatus. # noqa: E501 + :rtype: dict(str, object) + """ + return self._output + + @output.setter + def output(self, output): + """Sets the output of this WorkflowStatus. + + + :param output: The output of this WorkflowStatus. # noqa: E501 + :type: dict(str, object) + """ + + self._output = output + + @property + def status(self): + """Gets the status of this WorkflowStatus. # noqa: E501 + + + :return: The status of this WorkflowStatus. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this WorkflowStatus. + + + :param status: The status of this WorkflowStatus. # noqa: E501 + :type: str + """ + allowed_values = ["RUNNING", "COMPLETED", "FAILED", "TIMED_OUT", "TERMINATED", "PAUSED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def variables(self): + """Gets the variables of this WorkflowStatus. # noqa: E501 + + + :return: The variables of this WorkflowStatus. # noqa: E501 + :rtype: dict(str, object) + """ + return self._variables + + @variables.setter + def variables(self, variables): + """Sets the variables of this WorkflowStatus. + + + :param variables: The variables of this WorkflowStatus. # noqa: E501 + :type: dict(str, object) + """ + + self._variables = variables + + @property + def workflow_id(self): + """Gets the workflow_id of this WorkflowStatus. # noqa: E501 + + + :return: The workflow_id of this WorkflowStatus. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this WorkflowStatus. + + + :param workflow_id: The workflow_id of this WorkflowStatus. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowStatus, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowStatus): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow_summary.py b/src/conductor/client/codegen/models/workflow_summary.py new file mode 100644 index 00000000..2de177a9 --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_summary.py @@ -0,0 +1,688 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WorkflowSummary(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'correlation_id': 'str', + 'created_by': 'str', + 'end_time': 'str', + 'event': 'str', + 'execution_time': 'int', + 'external_input_payload_storage_path': 'str', + 'external_output_payload_storage_path': 'str', + 'failed_reference_task_names': 'str', + 'failed_task_names': 'list[str]', + 'idempotency_key': 'str', + 'input': 'str', + 'input_size': 'int', + 'output': 'str', + 'output_size': 'int', + 'priority': 'int', + 'reason_for_incompletion': 'str', + 'start_time': 'str', + 'status': 'str', + 'task_to_domain': 'dict(str, str)', + 'update_time': 'str', + 'version': 'int', + 'workflow_id': 'str', + 'workflow_type': 'str' + } + + attribute_map = { + 'correlation_id': 'correlationId', + 'created_by': 'createdBy', + 'end_time': 'endTime', + 'event': 'event', + 'execution_time': 'executionTime', + 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', + 'external_output_payload_storage_path': 'externalOutputPayloadStoragePath', + 'failed_reference_task_names': 'failedReferenceTaskNames', + 'failed_task_names': 'failedTaskNames', + 'idempotency_key': 'idempotencyKey', + 'input': 'input', + 'input_size': 'inputSize', + 'output': 'output', + 'output_size': 'outputSize', + 'priority': 'priority', + 'reason_for_incompletion': 'reasonForIncompletion', + 'start_time': 'startTime', + 'status': 'status', + 'task_to_domain': 'taskToDomain', + 'update_time': 'updateTime', + 'version': 'version', + 'workflow_id': 'workflowId', + 'workflow_type': 'workflowType' + } + + def __init__(self, correlation_id=None, created_by=None, end_time=None, event=None, execution_time=None, external_input_payload_storage_path=None, external_output_payload_storage_path=None, failed_reference_task_names=None, failed_task_names=None, idempotency_key=None, input=None, input_size=None, output=None, output_size=None, priority=None, reason_for_incompletion=None, start_time=None, status=None, task_to_domain=None, update_time=None, version=None, workflow_id=None, workflow_type=None): # noqa: E501 + """WorkflowSummary - a model defined in Swagger""" # noqa: E501 + self._correlation_id = None + self._created_by = None + self._end_time = None + self._event = None + self._execution_time = None + self._external_input_payload_storage_path = None + self._external_output_payload_storage_path = None + self._failed_reference_task_names = None + self._failed_task_names = None + self._idempotency_key = None + self._input = None + self._input_size = None + self._output = None + self._output_size = None + self._priority = None + self._reason_for_incompletion = None + self._start_time = None + self._status = None + self._task_to_domain = None + self._update_time = None + self._version = None + self._workflow_id = None + self._workflow_type = None + self.discriminator = None + if correlation_id is not None: + self.correlation_id = correlation_id + if created_by is not None: + self.created_by = created_by + if end_time is not None: + self.end_time = end_time + if event is not None: + self.event = event + if execution_time is not None: + self.execution_time = execution_time + if external_input_payload_storage_path is not None: + self.external_input_payload_storage_path = external_input_payload_storage_path + if external_output_payload_storage_path is not None: + self.external_output_payload_storage_path = external_output_payload_storage_path + if failed_reference_task_names is not None: + self.failed_reference_task_names = failed_reference_task_names + if failed_task_names is not None: + self.failed_task_names = failed_task_names + if idempotency_key is not None: + self.idempotency_key = idempotency_key + if input is not None: + self.input = input + if input_size is not None: + self.input_size = input_size + if output is not None: + self.output = output + if output_size is not None: + self.output_size = output_size + if priority is not None: + self.priority = priority + if reason_for_incompletion is not None: + self.reason_for_incompletion = reason_for_incompletion + if start_time is not None: + self.start_time = start_time + if status is not None: + self.status = status + if task_to_domain is not None: + self.task_to_domain = task_to_domain + if update_time is not None: + self.update_time = update_time + if version is not None: + self.version = version + if workflow_id is not None: + self.workflow_id = workflow_id + if workflow_type is not None: + self.workflow_type = workflow_type + + @property + def correlation_id(self): + """Gets the correlation_id of this WorkflowSummary. # noqa: E501 + + + :return: The correlation_id of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this WorkflowSummary. + + + :param correlation_id: The correlation_id of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def created_by(self): + """Gets the created_by of this WorkflowSummary. # noqa: E501 + + + :return: The created_by of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this WorkflowSummary. + + + :param created_by: The created_by of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def end_time(self): + """Gets the end_time of this WorkflowSummary. # noqa: E501 + + + :return: The end_time of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this WorkflowSummary. + + + :param end_time: The end_time of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._end_time = end_time + + @property + def event(self): + """Gets the event of this WorkflowSummary. # noqa: E501 + + + :return: The event of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._event + + @event.setter + def event(self, event): + """Sets the event of this WorkflowSummary. + + + :param event: The event of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._event = event + + @property + def execution_time(self): + """Gets the execution_time of this WorkflowSummary. # noqa: E501 + + + :return: The execution_time of this WorkflowSummary. # noqa: E501 + :rtype: int + """ + return self._execution_time + + @execution_time.setter + def execution_time(self, execution_time): + """Sets the execution_time of this WorkflowSummary. + + + :param execution_time: The execution_time of this WorkflowSummary. # noqa: E501 + :type: int + """ + + self._execution_time = execution_time + + @property + def external_input_payload_storage_path(self): + """Gets the external_input_payload_storage_path of this WorkflowSummary. # noqa: E501 + + + :return: The external_input_payload_storage_path of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._external_input_payload_storage_path + + @external_input_payload_storage_path.setter + def external_input_payload_storage_path(self, external_input_payload_storage_path): + """Sets the external_input_payload_storage_path of this WorkflowSummary. + + + :param external_input_payload_storage_path: The external_input_payload_storage_path of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._external_input_payload_storage_path = external_input_payload_storage_path + + @property + def external_output_payload_storage_path(self): + """Gets the external_output_payload_storage_path of this WorkflowSummary. # noqa: E501 + + + :return: The external_output_payload_storage_path of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._external_output_payload_storage_path + + @external_output_payload_storage_path.setter + def external_output_payload_storage_path(self, external_output_payload_storage_path): + """Sets the external_output_payload_storage_path of this WorkflowSummary. + + + :param external_output_payload_storage_path: The external_output_payload_storage_path of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._external_output_payload_storage_path = external_output_payload_storage_path + + @property + def failed_reference_task_names(self): + """Gets the failed_reference_task_names of this WorkflowSummary. # noqa: E501 + + + :return: The failed_reference_task_names of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._failed_reference_task_names + + @failed_reference_task_names.setter + def failed_reference_task_names(self, failed_reference_task_names): + """Sets the failed_reference_task_names of this WorkflowSummary. + + + :param failed_reference_task_names: The failed_reference_task_names of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._failed_reference_task_names = failed_reference_task_names + + @property + def failed_task_names(self): + """Gets the failed_task_names of this WorkflowSummary. # noqa: E501 + + + :return: The failed_task_names of this WorkflowSummary. # noqa: E501 + :rtype: list[str] + """ + return self._failed_task_names + + @failed_task_names.setter + def failed_task_names(self, failed_task_names): + """Sets the failed_task_names of this WorkflowSummary. + + + :param failed_task_names: The failed_task_names of this WorkflowSummary. # noqa: E501 + :type: list[str] + """ + + self._failed_task_names = failed_task_names + + @property + def idempotency_key(self): + """Gets the idempotency_key of this WorkflowSummary. # noqa: E501 + + + :return: The idempotency_key of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._idempotency_key + + @idempotency_key.setter + def idempotency_key(self, idempotency_key): + """Sets the idempotency_key of this WorkflowSummary. + + + :param idempotency_key: The idempotency_key of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._idempotency_key = idempotency_key + + @property + def input(self): + """Gets the input of this WorkflowSummary. # noqa: E501 + + + :return: The input of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._input + + @input.setter + def input(self, input): + """Sets the input of this WorkflowSummary. + + + :param input: The input of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._input = input + + @property + def input_size(self): + """Gets the input_size of this WorkflowSummary. # noqa: E501 + + + :return: The input_size of this WorkflowSummary. # noqa: E501 + :rtype: int + """ + return self._input_size + + @input_size.setter + def input_size(self, input_size): + """Sets the input_size of this WorkflowSummary. + + + :param input_size: The input_size of this WorkflowSummary. # noqa: E501 + :type: int + """ + + self._input_size = input_size + + @property + def output(self): + """Gets the output of this WorkflowSummary. # noqa: E501 + + + :return: The output of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._output + + @output.setter + def output(self, output): + """Sets the output of this WorkflowSummary. + + + :param output: The output of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._output = output + + @property + def output_size(self): + """Gets the output_size of this WorkflowSummary. # noqa: E501 + + + :return: The output_size of this WorkflowSummary. # noqa: E501 + :rtype: int + """ + return self._output_size + + @output_size.setter + def output_size(self, output_size): + """Sets the output_size of this WorkflowSummary. + + + :param output_size: The output_size of this WorkflowSummary. # noqa: E501 + :type: int + """ + + self._output_size = output_size + + @property + def priority(self): + """Gets the priority of this WorkflowSummary. # noqa: E501 + + + :return: The priority of this WorkflowSummary. # noqa: E501 + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this WorkflowSummary. + + + :param priority: The priority of this WorkflowSummary. # noqa: E501 + :type: int + """ + + self._priority = priority + + @property + def reason_for_incompletion(self): + """Gets the reason_for_incompletion of this WorkflowSummary. # noqa: E501 + + + :return: The reason_for_incompletion of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._reason_for_incompletion + + @reason_for_incompletion.setter + def reason_for_incompletion(self, reason_for_incompletion): + """Sets the reason_for_incompletion of this WorkflowSummary. + + + :param reason_for_incompletion: The reason_for_incompletion of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._reason_for_incompletion = reason_for_incompletion + + @property + def start_time(self): + """Gets the start_time of this WorkflowSummary. # noqa: E501 + + + :return: The start_time of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this WorkflowSummary. + + + :param start_time: The start_time of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._start_time = start_time + + @property + def status(self): + """Gets the status of this WorkflowSummary. # noqa: E501 + + + :return: The status of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this WorkflowSummary. + + + :param status: The status of this WorkflowSummary. # noqa: E501 + :type: str + """ + allowed_values = ["RUNNING", "COMPLETED", "FAILED", "TIMED_OUT", "TERMINATED", "PAUSED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def task_to_domain(self): + """Gets the task_to_domain of this WorkflowSummary. # noqa: E501 + + + :return: The task_to_domain of this WorkflowSummary. # noqa: E501 + :rtype: dict(str, str) + """ + return self._task_to_domain + + @task_to_domain.setter + def task_to_domain(self, task_to_domain): + """Sets the task_to_domain of this WorkflowSummary. + + + :param task_to_domain: The task_to_domain of this WorkflowSummary. # noqa: E501 + :type: dict(str, str) + """ + + self._task_to_domain = task_to_domain + + @property + def update_time(self): + """Gets the update_time of this WorkflowSummary. # noqa: E501 + + + :return: The update_time of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this WorkflowSummary. + + + :param update_time: The update_time of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._update_time = update_time + + @property + def version(self): + """Gets the version of this WorkflowSummary. # noqa: E501 + + + :return: The version of this WorkflowSummary. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this WorkflowSummary. + + + :param version: The version of this WorkflowSummary. # noqa: E501 + :type: int + """ + + self._version = version + + @property + def workflow_id(self): + """Gets the workflow_id of this WorkflowSummary. # noqa: E501 + + + :return: The workflow_id of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this WorkflowSummary. + + + :param workflow_id: The workflow_id of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + @property + def workflow_type(self): + """Gets the workflow_type of this WorkflowSummary. # noqa: E501 + + + :return: The workflow_type of this WorkflowSummary. # noqa: E501 + :rtype: str + """ + return self._workflow_type + + @workflow_type.setter + def workflow_type(self, workflow_type): + """Sets the workflow_type of this WorkflowSummary. + + + :param workflow_type: The workflow_type of this WorkflowSummary. # noqa: E501 + :type: str + """ + + self._workflow_type = workflow_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowSummary, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowSummary): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow_tag.py b/src/conductor/client/codegen/models/workflow_tag.py new file mode 100644 index 00000000..3e6366f9 --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_tag.py @@ -0,0 +1,99 @@ +import pprint +import re # noqa: F401 + +import six + + +class WorkflowTag(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'rate_limit': 'RateLimit' + } + + attribute_map = { + 'rate_limit': 'rateLimit' + } + + def __init__(self, rate_limit=None): # noqa: E501 + """WorkflowTag - a model defined in Swagger""" # noqa: E501 + self._rate_limit = None + self.discriminator = None + if rate_limit is not None: + self.rate_limit = rate_limit + + @property + def rate_limit(self): + """Gets the rate_limit of this WorkflowTag. # noqa: E501 + + + :return: The rate_limit of this WorkflowTag. # noqa: E501 + :rtype: RateLimit + """ + return self._rate_limit + + @rate_limit.setter + def rate_limit(self, rate_limit): + """Sets the rate_limit of this WorkflowTag. + + + :param rate_limit: The rate_limit of this WorkflowTag. # noqa: E501 + :type: RateLimit + """ + + self._rate_limit = rate_limit + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowTag, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowTag): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/src/conductor/client/codegen/models/workflow_task.py b/src/conductor/client/codegen/models/workflow_task.py new file mode 100644 index 00000000..5d3ee07a --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_task.py @@ -0,0 +1,974 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WorkflowTask(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'async_complete': 'bool', + 'cache_config': 'CacheConfig', + 'case_expression': 'str', + 'case_value_param': 'str', + 'decision_cases': 'dict(str, list[WorkflowTask])', + 'default_case': 'list[WorkflowTask]', + 'default_exclusive_join_task': 'list[str]', + 'description': 'str', + 'dynamic_fork_join_tasks_param': 'str', + 'dynamic_fork_tasks_input_param_name': 'str', + 'dynamic_fork_tasks_param': 'str', + 'dynamic_task_name_param': 'str', + 'evaluator_type': 'str', + 'expression': 'str', + 'fork_tasks': 'list[list[WorkflowTask]]', + 'input_parameters': 'dict(str, object)', + 'join_on': 'list[str]', + 'join_status': 'str', + 'loop_condition': 'str', + 'loop_over': 'list[WorkflowTask]', + 'name': 'str', + 'on_state_change': 'dict(str, list[StateChangeEvent])', + 'optional': 'bool', + 'permissive': 'bool', + 'rate_limited': 'bool', + 'retry_count': 'int', + 'script_expression': 'str', + 'sink': 'str', + 'start_delay': 'int', + 'sub_workflow_param': 'SubWorkflowParams', + 'task_definition': 'TaskDef', + 'task_reference_name': 'str', + 'type': 'str', + 'workflow_task_type': 'str' + } + + attribute_map = { + 'async_complete': 'asyncComplete', + 'cache_config': 'cacheConfig', + 'case_expression': 'caseExpression', + 'case_value_param': 'caseValueParam', + 'decision_cases': 'decisionCases', + 'default_case': 'defaultCase', + 'default_exclusive_join_task': 'defaultExclusiveJoinTask', + 'description': 'description', + 'dynamic_fork_join_tasks_param': 'dynamicForkJoinTasksParam', + 'dynamic_fork_tasks_input_param_name': 'dynamicForkTasksInputParamName', + 'dynamic_fork_tasks_param': 'dynamicForkTasksParam', + 'dynamic_task_name_param': 'dynamicTaskNameParam', + 'evaluator_type': 'evaluatorType', + 'expression': 'expression', + 'fork_tasks': 'forkTasks', + 'input_parameters': 'inputParameters', + 'join_on': 'joinOn', + 'join_status': 'joinStatus', + 'loop_condition': 'loopCondition', + 'loop_over': 'loopOver', + 'name': 'name', + 'on_state_change': 'onStateChange', + 'optional': 'optional', + 'permissive': 'permissive', + 'rate_limited': 'rateLimited', + 'retry_count': 'retryCount', + 'script_expression': 'scriptExpression', + 'sink': 'sink', + 'start_delay': 'startDelay', + 'sub_workflow_param': 'subWorkflowParam', + 'task_definition': 'taskDefinition', + 'task_reference_name': 'taskReferenceName', + 'type': 'type', + 'workflow_task_type': 'workflowTaskType' + } + + def __init__(self, async_complete=None, cache_config=None, case_expression=None, case_value_param=None, decision_cases=None, default_case=None, default_exclusive_join_task=None, description=None, dynamic_fork_join_tasks_param=None, dynamic_fork_tasks_input_param_name=None, dynamic_fork_tasks_param=None, dynamic_task_name_param=None, evaluator_type=None, expression=None, fork_tasks=None, input_parameters=None, join_on=None, join_status=None, loop_condition=None, loop_over=None, name=None, on_state_change=None, optional=None, permissive=None, rate_limited=None, retry_count=None, script_expression=None, sink=None, start_delay=None, sub_workflow_param=None, task_definition=None, task_reference_name=None, type=None, workflow_task_type=None): # noqa: E501 + """WorkflowTask - a model defined in Swagger""" # noqa: E501 + self._async_complete = None + self._cache_config = None + self._case_expression = None + self._case_value_param = None + self._decision_cases = None + self._default_case = None + self._default_exclusive_join_task = None + self._description = None + self._dynamic_fork_join_tasks_param = None + self._dynamic_fork_tasks_input_param_name = None + self._dynamic_fork_tasks_param = None + self._dynamic_task_name_param = None + self._evaluator_type = None + self._expression = None + self._fork_tasks = None + self._input_parameters = None + self._join_on = None + self._join_status = None + self._loop_condition = None + self._loop_over = None + self._name = None + self._on_state_change = None + self._optional = None + self._permissive = None + self._rate_limited = None + self._retry_count = None + self._script_expression = None + self._sink = None + self._start_delay = None + self._sub_workflow_param = None + self._task_definition = None + self._task_reference_name = None + self._type = None + self._workflow_task_type = None + self.discriminator = None + if async_complete is not None: + self.async_complete = async_complete + if cache_config is not None: + self.cache_config = cache_config + if case_expression is not None: + self.case_expression = case_expression + if case_value_param is not None: + self.case_value_param = case_value_param + if decision_cases is not None: + self.decision_cases = decision_cases + if default_case is not None: + self.default_case = default_case + if default_exclusive_join_task is not None: + self.default_exclusive_join_task = default_exclusive_join_task + if description is not None: + self.description = description + if dynamic_fork_join_tasks_param is not None: + self.dynamic_fork_join_tasks_param = dynamic_fork_join_tasks_param + if dynamic_fork_tasks_input_param_name is not None: + self.dynamic_fork_tasks_input_param_name = dynamic_fork_tasks_input_param_name + if dynamic_fork_tasks_param is not None: + self.dynamic_fork_tasks_param = dynamic_fork_tasks_param + if dynamic_task_name_param is not None: + self.dynamic_task_name_param = dynamic_task_name_param + if evaluator_type is not None: + self.evaluator_type = evaluator_type + if expression is not None: + self.expression = expression + if fork_tasks is not None: + self.fork_tasks = fork_tasks + if input_parameters is not None: + self.input_parameters = input_parameters + if join_on is not None: + self.join_on = join_on + if join_status is not None: + self.join_status = join_status + if loop_condition is not None: + self.loop_condition = loop_condition + if loop_over is not None: + self.loop_over = loop_over + if name is not None: + self.name = name + if on_state_change is not None: + self.on_state_change = on_state_change + if optional is not None: + self.optional = optional + if permissive is not None: + self.permissive = permissive + if rate_limited is not None: + self.rate_limited = rate_limited + if retry_count is not None: + self.retry_count = retry_count + if script_expression is not None: + self.script_expression = script_expression + if sink is not None: + self.sink = sink + if start_delay is not None: + self.start_delay = start_delay + if sub_workflow_param is not None: + self.sub_workflow_param = sub_workflow_param + if task_definition is not None: + self.task_definition = task_definition + if task_reference_name is not None: + self.task_reference_name = task_reference_name + if type is not None: + self.type = type + if workflow_task_type is not None: + self.workflow_task_type = workflow_task_type + + @property + def async_complete(self): + """Gets the async_complete of this WorkflowTask. # noqa: E501 + + + :return: The async_complete of this WorkflowTask. # noqa: E501 + :rtype: bool + """ + return self._async_complete + + @async_complete.setter + def async_complete(self, async_complete): + """Sets the async_complete of this WorkflowTask. + + + :param async_complete: The async_complete of this WorkflowTask. # noqa: E501 + :type: bool + """ + + self._async_complete = async_complete + + @property + def cache_config(self): + """Gets the cache_config of this WorkflowTask. # noqa: E501 + + + :return: The cache_config of this WorkflowTask. # noqa: E501 + :rtype: CacheConfig + """ + return self._cache_config + + @cache_config.setter + def cache_config(self, cache_config): + """Sets the cache_config of this WorkflowTask. + + + :param cache_config: The cache_config of this WorkflowTask. # noqa: E501 + :type: CacheConfig + """ + + self._cache_config = cache_config + + @property + def case_expression(self): + """Gets the case_expression of this WorkflowTask. # noqa: E501 + + + :return: The case_expression of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._case_expression + + @case_expression.setter + def case_expression(self, case_expression): + """Sets the case_expression of this WorkflowTask. + + + :param case_expression: The case_expression of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._case_expression = case_expression + + @property + def case_value_param(self): + """Gets the case_value_param of this WorkflowTask. # noqa: E501 + + + :return: The case_value_param of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._case_value_param + + @case_value_param.setter + def case_value_param(self, case_value_param): + """Sets the case_value_param of this WorkflowTask. + + + :param case_value_param: The case_value_param of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._case_value_param = case_value_param + + @property + def decision_cases(self): + """Gets the decision_cases of this WorkflowTask. # noqa: E501 + + + :return: The decision_cases of this WorkflowTask. # noqa: E501 + :rtype: dict(str, list[WorkflowTask]) + """ + return self._decision_cases + + @decision_cases.setter + def decision_cases(self, decision_cases): + """Sets the decision_cases of this WorkflowTask. + + + :param decision_cases: The decision_cases of this WorkflowTask. # noqa: E501 + :type: dict(str, list[WorkflowTask]) + """ + + self._decision_cases = decision_cases + + @property + def default_case(self): + """Gets the default_case of this WorkflowTask. # noqa: E501 + + + :return: The default_case of this WorkflowTask. # noqa: E501 + :rtype: list[WorkflowTask] + """ + return self._default_case + + @default_case.setter + def default_case(self, default_case): + """Sets the default_case of this WorkflowTask. + + + :param default_case: The default_case of this WorkflowTask. # noqa: E501 + :type: list[WorkflowTask] + """ + + self._default_case = default_case + + @property + def default_exclusive_join_task(self): + """Gets the default_exclusive_join_task of this WorkflowTask. # noqa: E501 + + + :return: The default_exclusive_join_task of this WorkflowTask. # noqa: E501 + :rtype: list[str] + """ + return self._default_exclusive_join_task + + @default_exclusive_join_task.setter + def default_exclusive_join_task(self, default_exclusive_join_task): + """Sets the default_exclusive_join_task of this WorkflowTask. + + + :param default_exclusive_join_task: The default_exclusive_join_task of this WorkflowTask. # noqa: E501 + :type: list[str] + """ + + self._default_exclusive_join_task = default_exclusive_join_task + + @property + def description(self): + """Gets the description of this WorkflowTask. # noqa: E501 + + + :return: The description of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this WorkflowTask. + + + :param description: The description of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def dynamic_fork_join_tasks_param(self): + """Gets the dynamic_fork_join_tasks_param of this WorkflowTask. # noqa: E501 + + + :return: The dynamic_fork_join_tasks_param of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._dynamic_fork_join_tasks_param + + @dynamic_fork_join_tasks_param.setter + def dynamic_fork_join_tasks_param(self, dynamic_fork_join_tasks_param): + """Sets the dynamic_fork_join_tasks_param of this WorkflowTask. + + + :param dynamic_fork_join_tasks_param: The dynamic_fork_join_tasks_param of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._dynamic_fork_join_tasks_param = dynamic_fork_join_tasks_param + + @property + def dynamic_fork_tasks_input_param_name(self): + """Gets the dynamic_fork_tasks_input_param_name of this WorkflowTask. # noqa: E501 + + + :return: The dynamic_fork_tasks_input_param_name of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._dynamic_fork_tasks_input_param_name + + @dynamic_fork_tasks_input_param_name.setter + def dynamic_fork_tasks_input_param_name(self, dynamic_fork_tasks_input_param_name): + """Sets the dynamic_fork_tasks_input_param_name of this WorkflowTask. + + + :param dynamic_fork_tasks_input_param_name: The dynamic_fork_tasks_input_param_name of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._dynamic_fork_tasks_input_param_name = dynamic_fork_tasks_input_param_name + + @property + def dynamic_fork_tasks_param(self): + """Gets the dynamic_fork_tasks_param of this WorkflowTask. # noqa: E501 + + + :return: The dynamic_fork_tasks_param of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._dynamic_fork_tasks_param + + @dynamic_fork_tasks_param.setter + def dynamic_fork_tasks_param(self, dynamic_fork_tasks_param): + """Sets the dynamic_fork_tasks_param of this WorkflowTask. + + + :param dynamic_fork_tasks_param: The dynamic_fork_tasks_param of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._dynamic_fork_tasks_param = dynamic_fork_tasks_param + + @property + def dynamic_task_name_param(self): + """Gets the dynamic_task_name_param of this WorkflowTask. # noqa: E501 + + + :return: The dynamic_task_name_param of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._dynamic_task_name_param + + @dynamic_task_name_param.setter + def dynamic_task_name_param(self, dynamic_task_name_param): + """Sets the dynamic_task_name_param of this WorkflowTask. + + + :param dynamic_task_name_param: The dynamic_task_name_param of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._dynamic_task_name_param = dynamic_task_name_param + + @property + def evaluator_type(self): + """Gets the evaluator_type of this WorkflowTask. # noqa: E501 + + + :return: The evaluator_type of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._evaluator_type + + @evaluator_type.setter + def evaluator_type(self, evaluator_type): + """Sets the evaluator_type of this WorkflowTask. + + + :param evaluator_type: The evaluator_type of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._evaluator_type = evaluator_type + + @property + def expression(self): + """Gets the expression of this WorkflowTask. # noqa: E501 + + + :return: The expression of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._expression + + @expression.setter + def expression(self, expression): + """Sets the expression of this WorkflowTask. + + + :param expression: The expression of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._expression = expression + + @property + def fork_tasks(self): + """Gets the fork_tasks of this WorkflowTask. # noqa: E501 + + + :return: The fork_tasks of this WorkflowTask. # noqa: E501 + :rtype: list[list[WorkflowTask]] + """ + return self._fork_tasks + + @fork_tasks.setter + def fork_tasks(self, fork_tasks): + """Sets the fork_tasks of this WorkflowTask. + + + :param fork_tasks: The fork_tasks of this WorkflowTask. # noqa: E501 + :type: list[list[WorkflowTask]] + """ + + self._fork_tasks = fork_tasks + + @property + def input_parameters(self): + """Gets the input_parameters of this WorkflowTask. # noqa: E501 + + + :return: The input_parameters of this WorkflowTask. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input_parameters + + @input_parameters.setter + def input_parameters(self, input_parameters): + """Sets the input_parameters of this WorkflowTask. + + + :param input_parameters: The input_parameters of this WorkflowTask. # noqa: E501 + :type: dict(str, object) + """ + + self._input_parameters = input_parameters + + @property + def join_on(self): + """Gets the join_on of this WorkflowTask. # noqa: E501 + + + :return: The join_on of this WorkflowTask. # noqa: E501 + :rtype: list[str] + """ + return self._join_on + + @join_on.setter + def join_on(self, join_on): + """Sets the join_on of this WorkflowTask. + + + :param join_on: The join_on of this WorkflowTask. # noqa: E501 + :type: list[str] + """ + + self._join_on = join_on + + @property + def join_status(self): + """Gets the join_status of this WorkflowTask. # noqa: E501 + + + :return: The join_status of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._join_status + + @join_status.setter + def join_status(self, join_status): + """Sets the join_status of this WorkflowTask. + + + :param join_status: The join_status of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._join_status = join_status + + @property + def loop_condition(self): + """Gets the loop_condition of this WorkflowTask. # noqa: E501 + + + :return: The loop_condition of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._loop_condition + + @loop_condition.setter + def loop_condition(self, loop_condition): + """Sets the loop_condition of this WorkflowTask. + + + :param loop_condition: The loop_condition of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._loop_condition = loop_condition + + @property + def loop_over(self): + """Gets the loop_over of this WorkflowTask. # noqa: E501 + + + :return: The loop_over of this WorkflowTask. # noqa: E501 + :rtype: list[WorkflowTask] + """ + return self._loop_over + + @loop_over.setter + def loop_over(self, loop_over): + """Sets the loop_over of this WorkflowTask. + + + :param loop_over: The loop_over of this WorkflowTask. # noqa: E501 + :type: list[WorkflowTask] + """ + + self._loop_over = loop_over + + @property + def name(self): + """Gets the name of this WorkflowTask. # noqa: E501 + + + :return: The name of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this WorkflowTask. + + + :param name: The name of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def on_state_change(self): + """Gets the on_state_change of this WorkflowTask. # noqa: E501 + + + :return: The on_state_change of this WorkflowTask. # noqa: E501 + :rtype: dict(str, list[StateChangeEvent]) + """ + return self._on_state_change + + @on_state_change.setter + def on_state_change(self, on_state_change): + """Sets the on_state_change of this WorkflowTask. + + + :param on_state_change: The on_state_change of this WorkflowTask. # noqa: E501 + :type: dict(str, list[StateChangeEvent]) + """ + + self._on_state_change = on_state_change + + @property + def optional(self): + """Gets the optional of this WorkflowTask. # noqa: E501 + + + :return: The optional of this WorkflowTask. # noqa: E501 + :rtype: bool + """ + return self._optional + + @optional.setter + def optional(self, optional): + """Sets the optional of this WorkflowTask. + + + :param optional: The optional of this WorkflowTask. # noqa: E501 + :type: bool + """ + + self._optional = optional + + @property + def permissive(self): + """Gets the permissive of this WorkflowTask. # noqa: E501 + + + :return: The permissive of this WorkflowTask. # noqa: E501 + :rtype: bool + """ + return self._permissive + + @permissive.setter + def permissive(self, permissive): + """Sets the permissive of this WorkflowTask. + + + :param permissive: The permissive of this WorkflowTask. # noqa: E501 + :type: bool + """ + + self._permissive = permissive + + @property + def rate_limited(self): + """Gets the rate_limited of this WorkflowTask. # noqa: E501 + + + :return: The rate_limited of this WorkflowTask. # noqa: E501 + :rtype: bool + """ + return self._rate_limited + + @rate_limited.setter + def rate_limited(self, rate_limited): + """Sets the rate_limited of this WorkflowTask. + + + :param rate_limited: The rate_limited of this WorkflowTask. # noqa: E501 + :type: bool + """ + + self._rate_limited = rate_limited + + @property + def retry_count(self): + """Gets the retry_count of this WorkflowTask. # noqa: E501 + + + :return: The retry_count of this WorkflowTask. # noqa: E501 + :rtype: int + """ + return self._retry_count + + @retry_count.setter + def retry_count(self, retry_count): + """Sets the retry_count of this WorkflowTask. + + + :param retry_count: The retry_count of this WorkflowTask. # noqa: E501 + :type: int + """ + + self._retry_count = retry_count + + @property + def script_expression(self): + """Gets the script_expression of this WorkflowTask. # noqa: E501 + + + :return: The script_expression of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._script_expression + + @script_expression.setter + def script_expression(self, script_expression): + """Sets the script_expression of this WorkflowTask. + + + :param script_expression: The script_expression of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._script_expression = script_expression + + @property + def sink(self): + """Gets the sink of this WorkflowTask. # noqa: E501 + + + :return: The sink of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._sink + + @sink.setter + def sink(self, sink): + """Sets the sink of this WorkflowTask. + + + :param sink: The sink of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._sink = sink + + @property + def start_delay(self): + """Gets the start_delay of this WorkflowTask. # noqa: E501 + + + :return: The start_delay of this WorkflowTask. # noqa: E501 + :rtype: int + """ + return self._start_delay + + @start_delay.setter + def start_delay(self, start_delay): + """Sets the start_delay of this WorkflowTask. + + + :param start_delay: The start_delay of this WorkflowTask. # noqa: E501 + :type: int + """ + + self._start_delay = start_delay + + @property + def sub_workflow_param(self): + """Gets the sub_workflow_param of this WorkflowTask. # noqa: E501 + + + :return: The sub_workflow_param of this WorkflowTask. # noqa: E501 + :rtype: SubWorkflowParams + """ + return self._sub_workflow_param + + @sub_workflow_param.setter + def sub_workflow_param(self, sub_workflow_param): + """Sets the sub_workflow_param of this WorkflowTask. + + + :param sub_workflow_param: The sub_workflow_param of this WorkflowTask. # noqa: E501 + :type: SubWorkflowParams + """ + + self._sub_workflow_param = sub_workflow_param + + @property + def task_definition(self): + """Gets the task_definition of this WorkflowTask. # noqa: E501 + + + :return: The task_definition of this WorkflowTask. # noqa: E501 + :rtype: TaskDef + """ + return self._task_definition + + @task_definition.setter + def task_definition(self, task_definition): + """Sets the task_definition of this WorkflowTask. + + + :param task_definition: The task_definition of this WorkflowTask. # noqa: E501 + :type: TaskDef + """ + + self._task_definition = task_definition + + @property + def task_reference_name(self): + """Gets the task_reference_name of this WorkflowTask. # noqa: E501 + + + :return: The task_reference_name of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._task_reference_name + + @task_reference_name.setter + def task_reference_name(self, task_reference_name): + """Sets the task_reference_name of this WorkflowTask. + + + :param task_reference_name: The task_reference_name of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._task_reference_name = task_reference_name + + @property + def type(self): + """Gets the type of this WorkflowTask. # noqa: E501 + + + :return: The type of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this WorkflowTask. + + + :param type: The type of this WorkflowTask. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def workflow_task_type(self): + """Gets the workflow_task_type of this WorkflowTask. # noqa: E501 + + + :return: The workflow_task_type of this WorkflowTask. # noqa: E501 + :rtype: str + """ + return self._workflow_task_type + + @workflow_task_type.setter + def workflow_task_type(self, workflow_task_type): + """Sets the workflow_task_type of this WorkflowTask. + + + :param workflow_task_type: The workflow_task_type of this WorkflowTask. # noqa: E501 + :type: str + """ + allowed_values = ["SIMPLE", "DYNAMIC", "FORK_JOIN", "FORK_JOIN_DYNAMIC", "DECISION", "SWITCH", "JOIN", "DO_WHILE", "SUB_WORKFLOW", "START_WORKFLOW", "EVENT", "WAIT", "HUMAN", "USER_DEFINED", "HTTP", "LAMBDA", "INLINE", "EXCLUSIVE_JOIN", "TERMINATE", "KAFKA_PUBLISH", "JSON_JQ_TRANSFORM", "SET_VARIABLE", "NOOP"] # noqa: E501 + if workflow_task_type not in allowed_values: + raise ValueError( + "Invalid value for `workflow_task_type` ({0}), must be one of {1}" # noqa: E501 + .format(workflow_task_type, allowed_values) + ) + + self._workflow_task_type = workflow_task_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowTask, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowTask): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/codegen/models/workflow_test_request.py b/src/conductor/client/codegen/models/workflow_test_request.py new file mode 100644 index 00000000..8fcf0db7 --- /dev/null +++ b/src/conductor/client/codegen/models/workflow_test_request.py @@ -0,0 +1,429 @@ +# coding: utf-8 + +""" + Orkes Conductor API Server + + Orkes Conductor API Server # noqa: E501 + + OpenAPI spec version: v2 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class WorkflowTestRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'correlation_id': 'str', + 'created_by': 'str', + 'external_input_payload_storage_path': 'str', + 'idempotency_key': 'str', + 'idempotency_strategy': 'str', + 'input': 'dict(str, object)', + 'name': 'str', + 'priority': 'int', + 'sub_workflow_test_request': 'dict(str, WorkflowTestRequest)', + 'task_ref_to_mock_output': 'dict(str, list[TaskMock])', + 'task_to_domain': 'dict(str, str)', + 'version': 'int', + 'workflow_def': 'WorkflowDef' + } + + attribute_map = { + 'correlation_id': 'correlationId', + 'created_by': 'createdBy', + 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', + 'idempotency_key': 'idempotencyKey', + 'idempotency_strategy': 'idempotencyStrategy', + 'input': 'input', + 'name': 'name', + 'priority': 'priority', + 'sub_workflow_test_request': 'subWorkflowTestRequest', + 'task_ref_to_mock_output': 'taskRefToMockOutput', + 'task_to_domain': 'taskToDomain', + 'version': 'version', + 'workflow_def': 'workflowDef' + } + + def __init__(self, correlation_id=None, created_by=None, external_input_payload_storage_path=None, idempotency_key=None, idempotency_strategy=None, input=None, name=None, priority=None, sub_workflow_test_request=None, task_ref_to_mock_output=None, task_to_domain=None, version=None, workflow_def=None): # noqa: E501 + """WorkflowTestRequest - a model defined in Swagger""" # noqa: E501 + self._correlation_id = None + self._created_by = None + self._external_input_payload_storage_path = None + self._idempotency_key = None + self._idempotency_strategy = None + self._input = None + self._name = None + self._priority = None + self._sub_workflow_test_request = None + self._task_ref_to_mock_output = None + self._task_to_domain = None + self._version = None + self._workflow_def = None + self.discriminator = None + if correlation_id is not None: + self.correlation_id = correlation_id + if created_by is not None: + self.created_by = created_by + if external_input_payload_storage_path is not None: + self.external_input_payload_storage_path = external_input_payload_storage_path + if idempotency_key is not None: + self.idempotency_key = idempotency_key + if idempotency_strategy is not None: + self.idempotency_strategy = idempotency_strategy + if input is not None: + self.input = input + self.name = name + if priority is not None: + self.priority = priority + if sub_workflow_test_request is not None: + self.sub_workflow_test_request = sub_workflow_test_request + if task_ref_to_mock_output is not None: + self.task_ref_to_mock_output = task_ref_to_mock_output + if task_to_domain is not None: + self.task_to_domain = task_to_domain + if version is not None: + self.version = version + if workflow_def is not None: + self.workflow_def = workflow_def + + @property + def correlation_id(self): + """Gets the correlation_id of this WorkflowTestRequest. # noqa: E501 + + + :return: The correlation_id of this WorkflowTestRequest. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this WorkflowTestRequest. + + + :param correlation_id: The correlation_id of this WorkflowTestRequest. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def created_by(self): + """Gets the created_by of this WorkflowTestRequest. # noqa: E501 + + + :return: The created_by of this WorkflowTestRequest. # noqa: E501 + :rtype: str + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this WorkflowTestRequest. + + + :param created_by: The created_by of this WorkflowTestRequest. # noqa: E501 + :type: str + """ + + self._created_by = created_by + + @property + def external_input_payload_storage_path(self): + """Gets the external_input_payload_storage_path of this WorkflowTestRequest. # noqa: E501 + + + :return: The external_input_payload_storage_path of this WorkflowTestRequest. # noqa: E501 + :rtype: str + """ + return self._external_input_payload_storage_path + + @external_input_payload_storage_path.setter + def external_input_payload_storage_path(self, external_input_payload_storage_path): + """Sets the external_input_payload_storage_path of this WorkflowTestRequest. + + + :param external_input_payload_storage_path: The external_input_payload_storage_path of this WorkflowTestRequest. # noqa: E501 + :type: str + """ + + self._external_input_payload_storage_path = external_input_payload_storage_path + + @property + def idempotency_key(self): + """Gets the idempotency_key of this WorkflowTestRequest. # noqa: E501 + + + :return: The idempotency_key of this WorkflowTestRequest. # noqa: E501 + :rtype: str + """ + return self._idempotency_key + + @idempotency_key.setter + def idempotency_key(self, idempotency_key): + """Sets the idempotency_key of this WorkflowTestRequest. + + + :param idempotency_key: The idempotency_key of this WorkflowTestRequest. # noqa: E501 + :type: str + """ + + self._idempotency_key = idempotency_key + + @property + def idempotency_strategy(self): + """Gets the idempotency_strategy of this WorkflowTestRequest. # noqa: E501 + + + :return: The idempotency_strategy of this WorkflowTestRequest. # noqa: E501 + :rtype: str + """ + return self._idempotency_strategy + + @idempotency_strategy.setter + def idempotency_strategy(self, idempotency_strategy): + """Sets the idempotency_strategy of this WorkflowTestRequest. + + + :param idempotency_strategy: The idempotency_strategy of this WorkflowTestRequest. # noqa: E501 + :type: str + """ + allowed_values = ["FAIL", "RETURN_EXISTING", "FAIL_ON_RUNNING"] # noqa: E501 + if idempotency_strategy not in allowed_values: + raise ValueError( + "Invalid value for `idempotency_strategy` ({0}), must be one of {1}" # noqa: E501 + .format(idempotency_strategy, allowed_values) + ) + + self._idempotency_strategy = idempotency_strategy + + @property + def input(self): + """Gets the input of this WorkflowTestRequest. # noqa: E501 + + + :return: The input of this WorkflowTestRequest. # noqa: E501 + :rtype: dict(str, object) + """ + return self._input + + @input.setter + def input(self, input): + """Sets the input of this WorkflowTestRequest. + + + :param input: The input of this WorkflowTestRequest. # noqa: E501 + :type: dict(str, object) + """ + + self._input = input + + @property + def name(self): + """Gets the name of this WorkflowTestRequest. # noqa: E501 + + + :return: The name of this WorkflowTestRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this WorkflowTestRequest. + + + :param name: The name of this WorkflowTestRequest. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def priority(self): + """Gets the priority of this WorkflowTestRequest. # noqa: E501 + + + :return: The priority of this WorkflowTestRequest. # noqa: E501 + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this WorkflowTestRequest. + + + :param priority: The priority of this WorkflowTestRequest. # noqa: E501 + :type: int + """ + + self._priority = priority + + @property + def sub_workflow_test_request(self): + """Gets the sub_workflow_test_request of this WorkflowTestRequest. # noqa: E501 + + + :return: The sub_workflow_test_request of this WorkflowTestRequest. # noqa: E501 + :rtype: dict(str, WorkflowTestRequest) + """ + return self._sub_workflow_test_request + + @sub_workflow_test_request.setter + def sub_workflow_test_request(self, sub_workflow_test_request): + """Sets the sub_workflow_test_request of this WorkflowTestRequest. + + + :param sub_workflow_test_request: The sub_workflow_test_request of this WorkflowTestRequest. # noqa: E501 + :type: dict(str, WorkflowTestRequest) + """ + + self._sub_workflow_test_request = sub_workflow_test_request + + @property + def task_ref_to_mock_output(self): + """Gets the task_ref_to_mock_output of this WorkflowTestRequest. # noqa: E501 + + + :return: The task_ref_to_mock_output of this WorkflowTestRequest. # noqa: E501 + :rtype: dict(str, list[TaskMock]) + """ + return self._task_ref_to_mock_output + + @task_ref_to_mock_output.setter + def task_ref_to_mock_output(self, task_ref_to_mock_output): + """Sets the task_ref_to_mock_output of this WorkflowTestRequest. + + + :param task_ref_to_mock_output: The task_ref_to_mock_output of this WorkflowTestRequest. # noqa: E501 + :type: dict(str, list[TaskMock]) + """ + + self._task_ref_to_mock_output = task_ref_to_mock_output + + @property + def task_to_domain(self): + """Gets the task_to_domain of this WorkflowTestRequest. # noqa: E501 + + + :return: The task_to_domain of this WorkflowTestRequest. # noqa: E501 + :rtype: dict(str, str) + """ + return self._task_to_domain + + @task_to_domain.setter + def task_to_domain(self, task_to_domain): + """Sets the task_to_domain of this WorkflowTestRequest. + + + :param task_to_domain: The task_to_domain of this WorkflowTestRequest. # noqa: E501 + :type: dict(str, str) + """ + + self._task_to_domain = task_to_domain + + @property + def version(self): + """Gets the version of this WorkflowTestRequest. # noqa: E501 + + + :return: The version of this WorkflowTestRequest. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this WorkflowTestRequest. + + + :param version: The version of this WorkflowTestRequest. # noqa: E501 + :type: int + """ + + self._version = version + + @property + def workflow_def(self): + """Gets the workflow_def of this WorkflowTestRequest. # noqa: E501 + + + :return: The workflow_def of this WorkflowTestRequest. # noqa: E501 + :rtype: WorkflowDef + """ + return self._workflow_def + + @workflow_def.setter + def workflow_def(self, workflow_def): + """Sets the workflow_def of this WorkflowTestRequest. + + + :param workflow_def: The workflow_def of this WorkflowTestRequest. # noqa: E501 + :type: WorkflowDef + """ + + self._workflow_def = workflow_def + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WorkflowTestRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WorkflowTestRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/src/conductor/client/http/rest.py b/src/conductor/client/codegen/rest.py similarity index 100% rename from src/conductor/client/http/rest.py rename to src/conductor/client/codegen/rest.py diff --git a/src/conductor/client/http/thread.py b/src/conductor/client/codegen/thread.py similarity index 100% rename from src/conductor/client/http/thread.py rename to src/conductor/client/codegen/thread.py diff --git a/src/conductor/client/configuration/configuration.py b/src/conductor/client/configuration/configuration.py index d28098b6..7c873c91 100644 --- a/src/conductor/client/configuration/configuration.py +++ b/src/conductor/client/configuration/configuration.py @@ -1,22 +1,28 @@ from __future__ import annotations + import logging import os import time from typing import Optional -from conductor.shared.configuration.settings.authentication_settings import AuthenticationSettings +from conductor.shared.configuration.settings.authentication_settings import ( + AuthenticationSettings, +) class Configuration: AUTH_TOKEN = None def __init__( - self, - base_url: Optional[str] = None, - debug: bool = False, - authentication_settings: AuthenticationSettings = None, - server_api_url: Optional[str] = None, - auth_token_ttl_min: int = 45 + self, + base_url: Optional[str] = None, + debug: bool = False, + authentication_settings: AuthenticationSettings = None, + server_api_url: Optional[str] = None, + auth_token_ttl_min: int = 45, + polling_interval: Optional[float] = None, + domain: Optional[str] = None, + polling_interval_seconds: Optional[float] = None, ): if server_api_url is not None: self.host = server_api_url @@ -39,15 +45,17 @@ def __init__( key = os.getenv("CONDUCTOR_AUTH_KEY") secret = os.getenv("CONDUCTOR_AUTH_SECRET") if key is not None and secret is not None: - self.authentication_settings = AuthenticationSettings(key_id=key, key_secret=secret) + self.authentication_settings = AuthenticationSettings( + key_id=key, key_secret=secret + ) else: self.authentication_settings = None - # Debug switch self.debug = debug # Log format self.logger_format = "%(asctime)s %(name)-12s %(levelname)-8s %(message)s" + self.is_logger_config_applied = False # SSL/TLS verification # Set this to false to skip verifying SSL certificate when calling API @@ -74,6 +82,15 @@ def __init__( self.token_update_time = 0 self.auth_token_ttl_msec = auth_token_ttl_min * 60 * 1000 + # Worker properties + self.polling_interval = polling_interval or self._get_env_float( + "CONDUCTOR_WORKER_POLL_INTERVAL", 100 + ) + self.domain = domain or os.getenv("CONDUCTOR_WORKER_DOMAIN", "default_domain") + self.polling_interval_seconds = polling_interval_seconds or self._get_env_float( + "CONDUCTOR_WORKER_POLL_INTERVAL_SECONDS", 0 + ) + @property def debug(self): """Debug status @@ -140,20 +157,39 @@ def ui_host(self): """ return self.__ui_host - def apply_logging_config(self, log_format : Optional[str] = None, level = None): + def apply_logging_config(self, log_format: Optional[str] = None, level=None): + if self.is_logger_config_applied: + return if log_format is None: log_format = self.logger_format if level is None: level = self.__log_level - logging.basicConfig( - format=log_format, - level=level - ) + logging.basicConfig(format=log_format, level=level) + self.is_logger_config_applied = True @staticmethod def get_logging_formatted_name(name): - return f"[{os.getpid()}] {name}" + return f"[pid:{os.getpid()}] {name}" def update_token(self, token: str) -> None: self.AUTH_TOKEN = token self.token_update_time = round(time.time() * 1000) + + def _get_env_float(self, env_var: str, default: float) -> float: + """Get float value from environment variable with default fallback.""" + try: + value = os.getenv(env_var) + if value is not None: + return float(value) + except (ValueError, TypeError): + pass + return default + + def get_poll_interval_seconds(self): + return self.polling_interval_seconds + + def get_poll_interval(self): + return self.polling_interval + + def get_domain(self): + return self.domain diff --git a/src/conductor/client/event/event_client.py b/src/conductor/client/event/event_client.py index 72da34e2..cf13e3f5 100644 --- a/src/conductor/client/event/event_client.py +++ b/src/conductor/client/event/event_client.py @@ -1,5 +1,5 @@ from conductor.client.event.queue.queue_configuration import QueueConfiguration -from conductor.client.http.api.event_resource_api import EventResourceApi +from conductor.client.http.api import EventResourceApi from conductor.client.http.api_client import ApiClient diff --git a/src/conductor/client/exceptions/api_exception_handler.py b/src/conductor/client/exceptions/api_exception_handler.py index d669c708..d0cb640f 100644 --- a/src/conductor/client/exceptions/api_exception_handler.py +++ b/src/conductor/client/exceptions/api_exception_handler.py @@ -1,7 +1,7 @@ import json from conductor.client.exceptions.api_error import APIError, APIErrorCode -from conductor.client.http.rest import ApiException +from conductor.client.codegen.rest import ApiException BAD_REQUEST_STATUS = 400 FORBIDDEN_STATUS = 403 diff --git a/src/conductor/client/helpers/helper.py b/src/conductor/client/helpers/helper.py index dd82f39a..b64586f2 100644 --- a/src/conductor/client/helpers/helper.py +++ b/src/conductor/client/helpers/helper.py @@ -9,7 +9,7 @@ import conductor.client.http.models as http_models from conductor.client.configuration.configuration import Configuration -from conductor.client.http import rest +from conductor.client.codegen import rest logger = logging.getLogger( Configuration.get_logging_formatted_name( diff --git a/src/conductor/client/http/api/__init__.py b/src/conductor/client/http/api/__init__.py index e69de29b..b39d431f 100644 --- a/src/conductor/client/http/api/__init__.py +++ b/src/conductor/client/http/api/__init__.py @@ -0,0 +1,75 @@ +from conductor.client.http.api.admin_resource_api import AdminResourceApi +from conductor.client.http.api.application_resource_api import \ + ApplicationResourceApi +from conductor.client.http.api.authorization_resource_api import \ + AuthorizationResourceApi +from conductor.client.http.api.environment_resource_api import \ + EnvironmentResourceApi +from conductor.client.http.api.event_execution_resource_api import \ + EventExecutionResourceApi +from conductor.client.http.api.event_message_resource_api import \ + EventMessageResourceApi +from conductor.client.http.api.event_resource_api import EventResourceApi +from conductor.client.http.api.group_resource_api import GroupResourceApi +from conductor.client.http.api.incoming_webhook_resource_api import \ + IncomingWebhookResourceApi +from conductor.client.http.api.integration_resource_api import \ + IntegrationResourceApi +from conductor.client.http.api.limits_resource_api import LimitsResourceApi +from conductor.client.http.api.metadata_resource_api import MetadataResourceApi +from conductor.client.http.api.metrics_resource_api import MetricsResourceApi +from conductor.client.http.api.metrics_token_resource_api import \ + MetricsTokenResourceApi +from conductor.client.http.api.prompt_resource_api import PromptResourceApi +from conductor.client.http.api.queue_admin_resource_api import \ + QueueAdminResourceApi +from conductor.client.http.api.scheduler_bulk_resource_api import \ + SchedulerBulkResourceApi +from conductor.client.http.api.scheduler_resource_api import \ + SchedulerResourceApi +from conductor.client.http.api.schema_resource_api import SchemaResourceApi +from conductor.client.http.api.secret_resource_api import SecretResourceApi +from conductor.client.http.api.service_registry_resource_api import \ + ServiceRegistryResourceApi +from conductor.client.http.api.tags_api import TagsApi +from conductor.client.http.api.task_resource_api import TaskResourceApi +from conductor.client.http.api.token_resource_api import TokenResourceApi +from conductor.client.http.api.user_resource_api import UserResourceApi +from conductor.client.http.api.version_resource_api import VersionResourceApi +from conductor.client.http.api.webhooks_config_resource_api import \ + WebhooksConfigResourceApi +from conductor.client.http.api.workflow_bulk_resource_api import \ + WorkflowBulkResourceApi +from conductor.client.http.api.workflow_resource_api import WorkflowResourceApi + +__all__ = [ + "AdminResourceApi", + "ApplicationResourceApi", + "AuthorizationResourceApi", + "EnvironmentResourceApi", + "EventExecutionResourceApi", + "EventMessageResourceApi", + "EventResourceApi", + "GroupResourceApi", + "IncomingWebhookResourceApi", + "IntegrationResourceApi", + "LimitsResourceApi", + "MetadataResourceApi", + "MetricsResourceApi", + "MetricsTokenResourceApi", + "PromptResourceApi", + "QueueAdminResourceApi", + "SchedulerBulkResourceApi", + "SchedulerResourceApi", + "SchemaResourceApi", + "SecretResourceApi", + "ServiceRegistryResourceApi", + "TagsApi", + "TaskResourceApi", + "TokenResourceApi", + "UserResourceApi", + "VersionResourceApi", + "WebhooksConfigResourceApi", + "WorkflowBulkResourceApi", + "WorkflowResourceApi", +] diff --git a/src/conductor/client/http/api/admin_resource_api.py b/src/conductor/client/http/api/admin_resource_api.py new file mode 100644 index 00000000..52f314bb --- /dev/null +++ b/src/conductor/client/http/api/admin_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.admin_resource_api_adapter import \ + AdminResourceApiAdapter + +AdminResourceApi = AdminResourceApiAdapter + +__all__ = ["AdminResourceApi"] diff --git a/src/conductor/client/http/api/application_resource_api.py b/src/conductor/client/http/api/application_resource_api.py index fc92fcee..df7c7217 100644 --- a/src/conductor/client/http/api/application_resource_api.py +++ b/src/conductor/client/http/api/application_resource_api.py @@ -1,1390 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.application_resource_api_adapter import \ + ApplicationResourceApiAdapter -import re # noqa: F401 +ApplicationResourceApi = ApplicationResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class ApplicationResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_role_to_application_user(self, application_id, role, **kwargs): # noqa: E501 - """add_role_to_application_user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_role_to_application_user(application_id, role, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str application_id: (required) - :param str role: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_role_to_application_user_with_http_info(application_id, role, **kwargs) # noqa: E501 - else: - (data) = self.add_role_to_application_user_with_http_info(application_id, role, **kwargs) # noqa: E501 - return data - - def add_role_to_application_user_with_http_info(self, application_id, role, **kwargs): # noqa: E501 - """add_role_to_application_user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_role_to_application_user_with_http_info(application_id, role, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str application_id: (required) - :param str role: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['application_id', 'role'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_role_to_application_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'application_id' is set - if ('application_id' not in params or - params['application_id'] is None): - raise ValueError( - "Missing the required parameter `application_id` when calling `add_role_to_application_user`") # noqa: E501 - # verify the required parameter 'role' is set - if ('role' not in params or - params['role'] is None): - raise ValueError( - "Missing the required parameter `role` when calling `add_role_to_application_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'application_id' in params: - path_params['applicationId'] = params['application_id'] # noqa: E501 - if 'role' in params: - path_params['role'] = params['role'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications/{applicationId}/roles/{role}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_access_key(self, id, **kwargs): # noqa: E501 - """Create an access key for an application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_access_key(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_access_key_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.create_access_key_with_http_info(id, **kwargs) # noqa: E501 - return data - - def create_access_key_with_http_info(self, id, **kwargs): # noqa: E501 - """Create an access key for an application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_access_key_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_access_key" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `create_access_key`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications/{id}/accessKeys', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_application(self, body, **kwargs): # noqa: E501 - """Create an application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_application(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateOrUpdateApplicationRequest body: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_application_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_application_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_application_with_http_info(self, body, **kwargs): # noqa: E501 - """Create an application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_application_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateOrUpdateApplicationRequest body: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_application" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_application`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_access_key(self, application_id, key_id, **kwargs): # noqa: E501 - """Delete an access key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_access_key(application_id, key_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str application_id: (required) - :param str key_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_access_key_with_http_info(application_id, key_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_access_key_with_http_info(application_id, key_id, **kwargs) # noqa: E501 - return data - - def delete_access_key_with_http_info(self, application_id, key_id, **kwargs): # noqa: E501 - """Delete an access key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_access_key_with_http_info(application_id, key_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str application_id: (required) - :param str key_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['application_id', 'key_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_access_key" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'application_id' is set - if ('application_id' not in params or - params['application_id'] is None): - raise ValueError( - "Missing the required parameter `application_id` when calling `delete_access_key`") # noqa: E501 - # verify the required parameter 'key_id' is set - if ('key_id' not in params or - params['key_id'] is None): - raise ValueError("Missing the required parameter `key_id` when calling `delete_access_key`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'application_id' in params: - path_params['applicationId'] = params['application_id'] # noqa: E501 - if 'key_id' in params: - path_params['keyId'] = params['key_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications/{applicationId}/accessKeys/{keyId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_application(self, id, **kwargs): # noqa: E501 - """Delete an application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_application(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_application_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.delete_application_with_http_info(id, **kwargs) # noqa: E501 - return data - - def delete_application_with_http_info(self, id, **kwargs): # noqa: E501 - """Delete an application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_application_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_application" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `delete_application`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications/{id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_access_keys(self, id, **kwargs): # noqa: E501 - """Get application's access keys # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_access_keys(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_access_keys_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.get_access_keys_with_http_info(id, **kwargs) # noqa: E501 - return data - - def get_access_keys_with_http_info(self, id, **kwargs): # noqa: E501 - """Get application's access keys # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_access_keys_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_access_keys" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_access_keys`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications/{id}/accessKeys', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_application(self, id, **kwargs): # noqa: E501 - """Get an application by id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_application(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_application_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.get_application_with_http_info(id, **kwargs) # noqa: E501 - return data - - def get_application_with_http_info(self, id, **kwargs): # noqa: E501 - """Get an application by id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_application_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_application" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_application`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications/{id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def list_applications(self, **kwargs): # noqa: E501 - """Get all applications # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_applications(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[ConductorApplication] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_applications_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_applications_with_http_info(**kwargs) # noqa: E501 - return data - - def list_applications_with_http_info(self, **kwargs): # noqa: E501 - """Get all applications # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_applications_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[ConductorApplication] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method list_applications" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[ConductorApplication]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_role_from_application_user(self, application_id, role, **kwargs): # noqa: E501 - """remove_role_from_application_user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_role_from_application_user(application_id, role, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str application_id: (required) - :param str role: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_role_from_application_user_with_http_info(application_id, role, **kwargs) # noqa: E501 - else: - (data) = self.remove_role_from_application_user_with_http_info(application_id, role, **kwargs) # noqa: E501 - return data - - def remove_role_from_application_user_with_http_info(self, application_id, role, **kwargs): # noqa: E501 - """remove_role_from_application_user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_role_from_application_user_with_http_info(application_id, role, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str application_id: (required) - :param str role: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['application_id', 'role'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_role_from_application_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'application_id' is set - if ('application_id' not in params or - params['application_id'] is None): - raise ValueError( - "Missing the required parameter `application_id` when calling `remove_role_from_application_user`") # noqa: E501 - # verify the required parameter 'role' is set - if ('role' not in params or - params['role'] is None): - raise ValueError( - "Missing the required parameter `role` when calling `remove_role_from_application_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'application_id' in params: - path_params['applicationId'] = params['application_id'] # noqa: E501 - if 'role' in params: - path_params['role'] = params['role'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications/{applicationId}/roles/{role}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def toggle_access_key_status(self, application_id, key_id, **kwargs): # noqa: E501 - """Toggle the status of an access key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.toggle_access_key_status(application_id, key_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str application_id: (required) - :param str key_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.toggle_access_key_status_with_http_info(application_id, key_id, **kwargs) # noqa: E501 - else: - (data) = self.toggle_access_key_status_with_http_info(application_id, key_id, **kwargs) # noqa: E501 - return data - - def toggle_access_key_status_with_http_info(self, application_id, key_id, **kwargs): # noqa: E501 - """Toggle the status of an access key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.toggle_access_key_status_with_http_info(application_id, key_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str application_id: (required) - :param str key_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['application_id', 'key_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method toggle_access_key_status" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'application_id' is set - if ('application_id' not in params or - params['application_id'] is None): - raise ValueError( - "Missing the required parameter `application_id` when calling `toggle_access_key_status`") # noqa: E501 - # verify the required parameter 'key_id' is set - if ('key_id' not in params or - params['key_id'] is None): - raise ValueError( - "Missing the required parameter `key_id` when calling `toggle_access_key_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'application_id' in params: - path_params['applicationId'] = params['application_id'] # noqa: E501 - if 'key_id' in params: - path_params['keyId'] = params['key_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications/{applicationId}/accessKeys/{keyId}/status', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_application(self, body, id, **kwargs): # noqa: E501 - """Update an application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_application(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateOrUpdateApplicationRequest body: (required) - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_application_with_http_info(body, id, **kwargs) # noqa: E501 - else: - (data) = self.update_application_with_http_info(body, id, **kwargs) # noqa: E501 - return data - - def update_application_with_http_info(self, body, id, **kwargs): # noqa: E501 - """Update an application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_application_with_http_info(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateOrUpdateApplicationRequest body: (required) - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_application" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_application`") # noqa: E501 - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `update_application`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/applications/{id}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def put_tags_for_application(self, body, id, **kwargs): # noqa: E501 - """Put a tag to application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_application(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_tags_for_application_with_http_info(body, id, **kwargs) # noqa: E501 - else: - (data) = self.put_tags_for_application_with_http_info(body, id, **kwargs) # noqa: E501 - return data - - def put_tags_for_application_with_http_info(self, body, id, **kwargs): # noqa: E501 - """Put a tag to application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_application_with_http_info(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method put_tag_for_application" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `put_tag_for_application`") # noqa: E501 - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `put_tag_for_application`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/applications/{id}/tags', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tags_for_application(self, id, **kwargs): # noqa: E501 - """Get tags by application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_application(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tags_for_application_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.get_tags_for_application_with_http_info(id, **kwargs) # noqa: E501 - return data - - def get_tags_for_application_with_http_info(self, id, **kwargs): # noqa: E501 - """Get tags by application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_application_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tags_for_application" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError( - "Missing the required parameter `id` when calling `get_tags_for_application`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/applications/{id}/tags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[TagObject]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_tags_for_application(self, body, id, **kwargs): # noqa: E501 - """Delete a tag for application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_application(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tags_for_application_with_http_info(body, id, **kwargs) # noqa: E501 - else: - (data) = self.delete_tags_for_application_with_http_info(body, id, **kwargs) # noqa: E501 - return data - - def delete_tags_for_application_with_http_info(self, body, id, **kwargs): # noqa: E501 - """Delete a tag for application # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_application_with_http_info(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_tag_for_application" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `delete_tag_for_application`") # noqa: E501 - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError( - "Missing the required parameter `id` when calling `delete_tag_for_application`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/applications/{id}/tags', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["ApplicationResourceApi"] diff --git a/src/conductor/client/http/api/authorization_resource_api.py b/src/conductor/client/http/api/authorization_resource_api.py index 6f11e938..d677d570 100644 --- a/src/conductor/client/http/api/authorization_resource_api.py +++ b/src/conductor/client/http/api/authorization_resource_api.py @@ -1,316 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.authorization_resource_api_adapter import \ + AuthorizationResourceApiAdapter -import re # noqa: F401 +AuthorizationResourceApi = AuthorizationResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class AuthorizationResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_permissions(self, type, id, **kwargs): # noqa: E501 - """Get the access that have been granted over the given object # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_permissions(type, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str type: (required) - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_permissions_with_http_info(type, id, **kwargs) # noqa: E501 - else: - (data) = self.get_permissions_with_http_info(type, id, **kwargs) # noqa: E501 - return data - - def get_permissions_with_http_info(self, type, id, **kwargs): # noqa: E501 - """Get the access that have been granted over the given object # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_permissions_with_http_info(type, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str type: (required) - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['type', 'id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_permissions" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'type' is set - if ('type' not in params or - params['type'] is None): - raise ValueError("Missing the required parameter `type` when calling `get_permissions`") # noqa: E501 - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_permissions`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'type' in params: - path_params['type'] = params['type'] # noqa: E501 - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/auth/authorization/{type}/{id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def grant_permissions(self, body, **kwargs): # noqa: E501 - """Grant access to a user over the target # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.grant_permissions(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param AuthorizationRequest body: (required) - :return: Response - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.grant_permissions_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.grant_permissions_with_http_info(body, **kwargs) # noqa: E501 - return data - - def grant_permissions_with_http_info(self, body, **kwargs): # noqa: E501 - """Grant access to a user over the target # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.grant_permissions_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param AuthorizationRequest body: (required) - :return: Response - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method grant_permissions" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `grant_permissions`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/auth/authorization', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Response', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_permissions(self, body, **kwargs): # noqa: E501 - """Remove user's access over the target # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_permissions(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param AuthorizationRequest body: (required) - :return: Response - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_permissions_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.remove_permissions_with_http_info(body, **kwargs) # noqa: E501 - return data - - def remove_permissions_with_http_info(self, body, **kwargs): # noqa: E501 - """Remove user's access over the target # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_permissions_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param AuthorizationRequest body: (required) - :return: Response - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_permissions" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_permissions`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/auth/authorization', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Response', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["AuthorizationResourceApi"] diff --git a/src/conductor/client/http/api/environment_resource_api.py b/src/conductor/client/http/api/environment_resource_api.py new file mode 100644 index 00000000..0d88f1c7 --- /dev/null +++ b/src/conductor/client/http/api/environment_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.environment_resource_api_adapter import \ + EnvironmentResourceApiAdapter + +EnvironmentResourceApi = EnvironmentResourceApiAdapter + +__all__ = ["EnvironmentResourceApi"] diff --git a/src/conductor/client/http/api/event_execution_resource_api.py b/src/conductor/client/http/api/event_execution_resource_api.py new file mode 100644 index 00000000..1f0de18c --- /dev/null +++ b/src/conductor/client/http/api/event_execution_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.event_execution_resource_api_adapter import \ + EventExecutionResourceApiAdapter + +EventExecutionResourceApi = EventExecutionResourceApiAdapter + +__all__ = ["EventExecutionResourceApi"] diff --git a/src/conductor/client/http/api/event_message_resource_api.py b/src/conductor/client/http/api/event_message_resource_api.py new file mode 100644 index 00000000..34e27035 --- /dev/null +++ b/src/conductor/client/http/api/event_message_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.event_message_resource_api_adapter import \ + EventMessageResourceApiAdapter + +EventMessageResourceApi = EventMessageResourceApiAdapter + +__all__ = ["EventMessageResourceApi"] diff --git a/src/conductor/client/http/api/event_resource_api.py b/src/conductor/client/http/api/event_resource_api.py index aa0f487f..41139b3d 100644 --- a/src/conductor/client/http/api/event_resource_api.py +++ b/src/conductor/client/http/api/event_resource_api.py @@ -1,878 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.event_resource_api_adapter import \ + EventResourceApiAdapter -import re # noqa: F401 +EventResourceApi = EventResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class EventResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_event_handler(self, body, **kwargs): # noqa: E501 - """Add a new event handler. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_event_handler(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param EventHandler body: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_event_handler_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.add_event_handler_with_http_info(body, **kwargs) # noqa: E501 - return data - - def add_event_handler_with_http_info(self, body, **kwargs): # noqa: E501 - """Add a new event handler. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_event_handler_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param EventHandler body: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_event_handler" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_event_handler`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/event', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_queue_config(self, queue_type, queue_name, **kwargs): # noqa: E501 - """Delete queue config by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_queue_config(queue_type, queue_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str queue_type: (required) - :param str queue_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_queue_config_with_http_info(queue_type, queue_name, **kwargs) # noqa: E501 - else: - (data) = self.delete_queue_config_with_http_info(queue_type, queue_name, **kwargs) # noqa: E501 - return data - - def delete_queue_config_with_http_info(self, queue_type, queue_name, **kwargs): # noqa: E501 - """Delete queue config by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_queue_config_with_http_info(queue_type, queue_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str queue_type: (required) - :param str queue_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['queue_type', 'queue_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_queue_config" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'queue_type' is set - if ('queue_type' not in params or - params['queue_type'] is None): - raise ValueError( - "Missing the required parameter `queue_type` when calling `delete_queue_config`") # noqa: E501 - # verify the required parameter 'queue_name' is set - if ('queue_name' not in params or - params['queue_name'] is None): - raise ValueError( - "Missing the required parameter `queue_name` when calling `delete_queue_config`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'queue_type' in params: - path_params['queueType'] = params['queue_type'] # noqa: E501 - if 'queue_name' in params: - path_params['queueName'] = params['queue_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/event/queue/config/{queueType}/{queueName}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_event_handlers(self, **kwargs): # noqa: E501 - """Get all the event handlers # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_event_handlers(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[EventHandler] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_event_handlers_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_event_handlers_with_http_info(**kwargs) # noqa: E501 - return data - - def get_event_handlers_with_http_info(self, **kwargs): # noqa: E501 - """Get all the event handlers # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_event_handlers_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[EventHandler] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_event_handlers" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/event', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[EventHandler]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_event_handlers_for_event(self, event, **kwargs): # noqa: E501 - """Get event handlers for a given event # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_event_handlers_for_event(event, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str event: (required) - :param bool active_only: - :return: list[EventHandler] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_event_handlers_for_event_with_http_info(event, **kwargs) # noqa: E501 - else: - (data) = self.get_event_handlers_for_event_with_http_info(event, **kwargs) # noqa: E501 - return data - - def get_event_handlers_for_event_with_http_info(self, event, **kwargs): # noqa: E501 - """Get event handlers for a given event # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_event_handlers_for_event_with_http_info(event, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str event: (required) - :param bool active_only: - :return: list[EventHandler] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['event', 'active_only'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_event_handlers_for_event" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'event' is set - if ('event' not in params or - params['event'] is None): - raise ValueError( - "Missing the required parameter `event` when calling `get_event_handlers_for_event`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'event' in params: - path_params['event'] = params['event'] # noqa: E501 - - query_params = [] - if 'active_only' in params: - query_params.append(('activeOnly', params['active_only'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/event/{event}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[EventHandler]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_queue_config(self, queue_type, queue_name, **kwargs): # noqa: E501 - """Get queue config by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_queue_config(queue_type, queue_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str queue_type: (required) - :param str queue_name: (required) - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_queue_config_with_http_info(queue_type, queue_name, **kwargs) # noqa: E501 - else: - (data) = self.get_queue_config_with_http_info(queue_type, queue_name, **kwargs) # noqa: E501 - return data - - def get_queue_config_with_http_info(self, queue_type, queue_name, **kwargs): # noqa: E501 - """Get queue config by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_queue_config_with_http_info(queue_type, queue_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str queue_type: (required) - :param str queue_name: (required) - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['queue_type', 'queue_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_queue_config" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'queue_type' is set - if ('queue_type' not in params or - params['queue_type'] is None): - raise ValueError( - "Missing the required parameter `queue_type` when calling `get_queue_config`") # noqa: E501 - # verify the required parameter 'queue_name' is set - if ('queue_name' not in params or - params['queue_name'] is None): - raise ValueError( - "Missing the required parameter `queue_name` when calling `get_queue_config`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'queue_type' in params: - path_params['queueType'] = params['queue_type'] # noqa: E501 - if 'queue_name' in params: - path_params['queueName'] = params['queue_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/event/queue/config/{queueType}/{queueName}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, object)', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_queue_names(self, **kwargs): # noqa: E501 - """Get all queue configs # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_queue_names(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, str) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_queue_names_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_queue_names_with_http_info(**kwargs) # noqa: E501 - return data - - def get_queue_names_with_http_info(self, **kwargs): # noqa: E501 - """Get all queue configs # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_queue_names_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, str) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_queue_names" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/event/queue/config', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, str)', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def put_queue_config(self, body, queue_type, queue_name, **kwargs): # noqa: E501 - """Create or update queue config by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_queue_config(body, queue_type, queue_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str body: (required) - :param str queue_type: (required) - :param str queue_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_queue_config_with_http_info(body, queue_type, queue_name, **kwargs) # noqa: E501 - else: - (data) = self.put_queue_config_with_http_info(body, queue_type, queue_name, **kwargs) # noqa: E501 - return data - - def put_queue_config_with_http_info(self, body, queue_type, queue_name, **kwargs): # noqa: E501 - """Create or update queue config by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_queue_config_with_http_info(body, queue_type, queue_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str body: (required) - :param str queue_type: (required) - :param str queue_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'queue_type', 'queue_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method put_queue_config" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `put_queue_config`") # noqa: E501 - # verify the required parameter 'queue_type' is set - if ('queue_type' not in params or - params['queue_type'] is None): - raise ValueError( - "Missing the required parameter `queue_type` when calling `put_queue_config`") # noqa: E501 - # verify the required parameter 'queue_name' is set - if ('queue_name' not in params or - params['queue_name'] is None): - raise ValueError( - "Missing the required parameter `queue_name` when calling `put_queue_config`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'queue_type' in params: - path_params['queueType'] = params['queue_type'] # noqa: E501 - if 'queue_name' in params: - path_params['queueName'] = params['queue_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/event/queue/config/{queueType}/{queueName}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_event_handler_status(self, name, **kwargs): # noqa: E501 - """Remove an event handler # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_event_handler_status(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_event_handler_status_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.remove_event_handler_status_with_http_info(name, **kwargs) # noqa: E501 - return data - - def remove_event_handler_status_with_http_info(self, name, **kwargs): # noqa: E501 - """Remove an event handler # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_event_handler_status_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_event_handler_status" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `remove_event_handler_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/event/{name}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_event_handler(self, body, **kwargs): # noqa: E501 - """Update an existing event handler. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_event_handler(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param EventHandler body: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_event_handler_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.update_event_handler_with_http_info(body, **kwargs) # noqa: E501 - return data - - def update_event_handler_with_http_info(self, body, **kwargs): # noqa: E501 - """Update an existing event handler. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_event_handler_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param EventHandler body: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_event_handler" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_event_handler`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/event', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["EventResourceApi"] diff --git a/src/conductor/client/http/api/group_resource_api.py b/src/conductor/client/http/api/group_resource_api.py index 313d3393..8e152089 100644 --- a/src/conductor/client/http/api/group_resource_api.py +++ b/src/conductor/client/http/api/group_resource_api.py @@ -1,788 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.group_resource_api_adapter import \ + GroupResourceApiAdapter -import re # noqa: F401 +GroupResourceApi = GroupResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class GroupResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_user_to_group(self, group_id, user_id, **kwargs): # noqa: E501 - """Add user to group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_user_to_group(group_id, user_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: (required) - :param str user_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_user_to_group_with_http_info(group_id, user_id, **kwargs) # noqa: E501 - else: - (data) = self.add_user_to_group_with_http_info(group_id, user_id, **kwargs) # noqa: E501 - return data - - def add_user_to_group_with_http_info(self, group_id, user_id, **kwargs): # noqa: E501 - """Add user to group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_user_to_group_with_http_info(group_id, user_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: (required) - :param str user_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['group_id', 'user_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_user_to_group" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'group_id' is set - if ('group_id' not in params or - params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `add_user_to_group`") # noqa: E501 - # verify the required parameter 'user_id' is set - if ('user_id' not in params or - params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `add_user_to_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'group_id' in params: - path_params['groupId'] = params['group_id'] # noqa: E501 - if 'user_id' in params: - path_params['userId'] = params['user_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/groups/{groupId}/users/{userId}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_group(self, id, **kwargs): # noqa: E501 - """Delete a group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_group(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: Response - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_group_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.delete_group_with_http_info(id, **kwargs) # noqa: E501 - return data - - def delete_group_with_http_info(self, id, **kwargs): # noqa: E501 - """Delete a group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_group_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: Response - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_group" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `delete_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/groups/{id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Response', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_granted_permissions1(self, group_id, **kwargs): # noqa: E501 - """Get the permissions this group has over workflows and tasks # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_granted_permissions1(group_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_granted_permissions1_with_http_info(group_id, **kwargs) # noqa: E501 - else: - (data) = self.get_granted_permissions1_with_http_info(group_id, **kwargs) # noqa: E501 - return data - - def get_granted_permissions1_with_http_info(self, group_id, **kwargs): # noqa: E501 - """Get the permissions this group has over workflows and tasks # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_granted_permissions1_with_http_info(group_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['group_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_granted_permissions1" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'group_id' is set - if ('group_id' not in params or - params['group_id'] is None): - raise ValueError( - "Missing the required parameter `group_id` when calling `get_granted_permissions1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'group_id' in params: - path_params['groupId'] = params['group_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/groups/{groupId}/permissions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_group(self, id, **kwargs): # noqa: E501 - """Get a group by id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_group(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_group_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.get_group_with_http_info(id, **kwargs) # noqa: E501 - return data - - def get_group_with_http_info(self, id, **kwargs): # noqa: E501 - """Get a group by id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_group_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_group" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/groups/{id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_users_in_group(self, id, **kwargs): # noqa: E501 - """Get all users in group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users_in_group(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_users_in_group_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.get_users_in_group_with_http_info(id, **kwargs) # noqa: E501 - return data - - def get_users_in_group_with_http_info(self, id, **kwargs): # noqa: E501 - """Get all users in group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users_in_group_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_users_in_group" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_users_in_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/groups/{id}/users', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def list_groups(self, **kwargs): # noqa: E501 - """Get all groups # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_groups(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[Group] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_groups_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_groups_with_http_info(**kwargs) # noqa: E501 - return data - - def list_groups_with_http_info(self, **kwargs): # noqa: E501 - """Get all groups # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_groups_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[Group] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method list_groups" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/groups', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Group]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_user_from_group(self, group_id, user_id, **kwargs): # noqa: E501 - """Remove user from group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_user_from_group(group_id, user_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: (required) - :param str user_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_user_from_group_with_http_info(group_id, user_id, **kwargs) # noqa: E501 - else: - (data) = self.remove_user_from_group_with_http_info(group_id, user_id, **kwargs) # noqa: E501 - return data - - def remove_user_from_group_with_http_info(self, group_id, user_id, **kwargs): # noqa: E501 - """Remove user from group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_user_from_group_with_http_info(group_id, user_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: (required) - :param str user_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['group_id', 'user_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_user_from_group" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'group_id' is set - if ('group_id' not in params or - params['group_id'] is None): - raise ValueError( - "Missing the required parameter `group_id` when calling `remove_user_from_group`") # noqa: E501 - # verify the required parameter 'user_id' is set - if ('user_id' not in params or - params['user_id'] is None): - raise ValueError( - "Missing the required parameter `user_id` when calling `remove_user_from_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'group_id' in params: - path_params['groupId'] = params['group_id'] # noqa: E501 - if 'user_id' in params: - path_params['userId'] = params['user_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/groups/{groupId}/users/{userId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def upsert_group(self, body, id, **kwargs): # noqa: E501 - """Create or update a group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upsert_group(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param UpsertGroupRequest body: (required) - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.upsert_group_with_http_info(body, id, **kwargs) # noqa: E501 - else: - (data) = self.upsert_group_with_http_info(body, id, **kwargs) # noqa: E501 - return data - - def upsert_group_with_http_info(self, body, id, **kwargs): # noqa: E501 - """Create or update a group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upsert_group_with_http_info(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param UpsertGroupRequest body: (required) - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method upsert_group" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `upsert_group`") # noqa: E501 - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `upsert_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/groups/{id}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["GroupResourceApi"] diff --git a/src/conductor/client/http/api/incoming_webhook_resource_api.py b/src/conductor/client/http/api/incoming_webhook_resource_api.py new file mode 100644 index 00000000..045e1d07 --- /dev/null +++ b/src/conductor/client/http/api/incoming_webhook_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.incoming_webhook_resource_api_adapter import \ + IncomingWebhookResourceApiAdapter + +IncomingWebhookResourceApi = IncomingWebhookResourceApiAdapter + +__all__ = ["IncomingWebhookResourceApi"] diff --git a/src/conductor/client/http/api/integration_resource_api.py b/src/conductor/client/http/api/integration_resource_api.py index d1936354..5dad6238 100644 --- a/src/conductor/client/http/api/integration_resource_api.py +++ b/src/conductor/client/http/api/integration_resource_api.py @@ -1,2235 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.integration_resource_api_adapter import \ + IntegrationResourceApiAdapter -import re # noqa: F401 +IntegrationResourceApi = IntegrationResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class IntegrationResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def associate_prompt_with_integration(self, integration_provider, integration_name, prompt_name, - **kwargs): # noqa: E501 - """Associate a Prompt Template with an Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.associate_prompt_with_integration(integration_provider, integration_name, prompt_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str integration_provider: (required) - :param str integration_name: (required) - :param str prompt_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.associate_prompt_with_integration_with_http_info(integration_provider, integration_name, - prompt_name, **kwargs) # noqa: E501 - else: - (data) = self.associate_prompt_with_integration_with_http_info(integration_provider, integration_name, - prompt_name, **kwargs) # noqa: E501 - return data - - def associate_prompt_with_integration_with_http_info(self, integration_provider, integration_name, prompt_name, - **kwargs): # noqa: E501 - """Associate a Prompt Template with an Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.associate_prompt_with_integration_with_http_info(integration_provider, integration_name, prompt_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str integration_provider: (required) - :param str integration_name: (required) - :param str prompt_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['integration_provider', 'integration_name', 'prompt_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method associate_prompt_with_integration" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'integration_provider' is set - if ('integration_provider' not in params or - params['integration_provider'] is None): - raise ValueError( - "Missing the required parameter `integration_provider` when calling `associate_prompt_with_integration`") # noqa: E501 - # verify the required parameter 'integration_name' is set - if ('integration_name' not in params or - params['integration_name'] is None): - raise ValueError( - "Missing the required parameter `integration_name` when calling `associate_prompt_with_integration`") # noqa: E501 - # verify the required parameter 'prompt_name' is set - if ('prompt_name' not in params or - params['prompt_name'] is None): - raise ValueError( - "Missing the required parameter `prompt_name` when calling `associate_prompt_with_integration`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'integration_provider' in params: - path_params['integration_provider'] = params['integration_provider'] # noqa: E501 - if 'integration_name' in params: - path_params['integration_name'] = params['integration_name'] # noqa: E501 - if 'prompt_name' in params: - path_params['prompt_name'] = params['prompt_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{integration_provider}/integration/{integration_name}/prompt/{prompt_name}', - 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_integration_api(self, name, integration_name, **kwargs): # noqa: E501 - """Delete an Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_integration_api(name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str integration_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_integration_api_with_http_info(name, integration_name, **kwargs) # noqa: E501 - else: - (data) = self.delete_integration_api_with_http_info(name, integration_name, **kwargs) # noqa: E501 - return data - - def delete_integration_api_with_http_info(self, name, integration_name, **kwargs): # noqa: E501 - """Delete an Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_integration_api_with_http_info(name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str integration_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'integration_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_integration_api" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `delete_integration_api`") # noqa: E501 - # verify the required parameter 'integration_name' is set - if ('integration_name' not in params or - params['integration_name'] is None): - raise ValueError( - "Missing the required parameter `integration_name` when calling `delete_integration_api`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'integration_name' in params: - path_params['integration_name'] = params['integration_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/integration/{integration_name}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_integration_provider(self, name, **kwargs): # noqa: E501 - """Delete an Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_integration_provider(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_integration_provider_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.delete_integration_provider_with_http_info(name, **kwargs) # noqa: E501 - return data - - def delete_integration_provider_with_http_info(self, name, **kwargs): # noqa: E501 - """Delete an Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_integration_provider_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_integration_provider" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `delete_integration_provider`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_tag_for_integration(self, body, name, integration_name, **kwargs): # noqa: E501 - """Delete a tag for Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_integration(body, name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :param str integration_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tag_for_integration_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 - else: - (data) = self.delete_tag_for_integration_with_http_info(body, name, integration_name, - **kwargs) # noqa: E501 - return data - - def delete_tag_for_integration_with_http_info(self, body, name, integration_name, **kwargs): # noqa: E501 - """Delete a tag for Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_integration_with_http_info(body, name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :param str integration_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name', 'integration_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_tag_for_integration" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `delete_tag_for_integration`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `delete_tag_for_integration`") # noqa: E501 - # verify the required parameter 'integration_name' is set - if ('integration_name' not in params or - params['integration_name'] is None): - raise ValueError( - "Missing the required parameter `integration_name` when calling `delete_tag_for_integration`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'integration_name' in params: - path_params['integration_name'] = params['integration_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/integration/{integration_name}/tags', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_tag_for_integration_provider(self, body, name, **kwargs): # noqa: E501 - """Delete a tag for Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_integration_provider(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tag_for_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.delete_tag_for_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def delete_tag_for_integration_provider_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Delete a tag for Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_integration_provider_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_tag_for_integration_provider" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `delete_tag_for_integration_provider`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `delete_tag_for_integration_provider`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/tags', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_integration_api(self, name, integration_name, **kwargs): # noqa: E501 - """Get Integration details # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_api(name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str integration_name: (required) - :return: IntegrationApi - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_integration_api_with_http_info(name, integration_name, **kwargs) # noqa: E501 - else: - (data) = self.get_integration_api_with_http_info(name, integration_name, **kwargs) # noqa: E501 - return data - - def get_integration_api_with_http_info(self, name, integration_name, **kwargs): # noqa: E501 - """Get Integration details # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_api_with_http_info(name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str integration_name: (required) - :return: IntegrationApi - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'integration_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_integration_api" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_integration_api`") # noqa: E501 - # verify the required parameter 'integration_name' is set - if ('integration_name' not in params or - params['integration_name'] is None): - raise ValueError( - "Missing the required parameter `integration_name` when calling `get_integration_api`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'integration_name' in params: - path_params['integration_name'] = params['integration_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/integration/{integration_name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='IntegrationApi', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_integration_apis(self, name, **kwargs): # noqa: E501 - """Get Integrations of an Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_apis(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param bool active_only: - :return: list[IntegrationApi] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_integration_apis_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_integration_apis_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_integration_apis_with_http_info(self, name, **kwargs): # noqa: E501 - """Get Integrations of an Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_apis_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param bool active_only: - :return: list[IntegrationApi] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'active_only'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_integration_apis" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_integration_apis`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'active_only' in params: - query_params.append(('activeOnly', params['active_only'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/integration', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[IntegrationApi]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_integration_available_apis(self, name, **kwargs): # noqa: E501 - """Get Integrations Available for an Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_available_apis(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_integration_available_apis_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_integration_available_apis_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_integration_available_apis_with_http_info(self, name, **kwargs): # noqa: E501 - """Get Integrations Available for an Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_available_apis_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_integration_available_apis" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `get_integration_available_apis`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/integration/all', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[str]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_integration_provider(self, name, **kwargs): # noqa: E501 - """Get Integration provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_provider(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: Integration - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_integration_provider_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_integration_provider_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_integration_provider_with_http_info(self, name, **kwargs): # noqa: E501 - """Get Integration provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_provider_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: Integration - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_integration_provider" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `get_integration_provider`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Integration', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_integration_provider_defs(self, **kwargs): # noqa: E501 - """Get Integration provider definitions # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_provider_defs(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[IntegrationDef] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_integration_provider_defs_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_integration_provider_defs_with_http_info(**kwargs) # noqa: E501 - return data - - def get_integration_provider_defs_with_http_info(self, **kwargs): # noqa: E501 - """Get Integration provider definitions # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_provider_defs_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[IntegrationDef] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_integration_provider_defs" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/def', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[IntegrationDef]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_integration_providers(self, **kwargs): # noqa: E501 - """Get all Integrations Providers # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_providers(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str type: - :param bool active_only: - :return: list[Integration] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_integration_providers_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_integration_providers_with_http_info(**kwargs) # noqa: E501 - return data - - def get_integration_providers_with_http_info(self, **kwargs): # noqa: E501 - """Get all Integrations Providers # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_integration_providers_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str type: - :param bool active_only: - :return: list[Integration] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['type', 'active_only'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_integration_providers" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'type' in params: - query_params.append(('type', params['type'])) # noqa: E501 - if 'active_only' in params: - query_params.append(('activeOnly', params['active_only'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Integration]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_prompts_with_integration(self, integration_provider, integration_name, **kwargs): # noqa: E501 - """Get the list of prompt templates associated with an integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_prompts_with_integration(integration_provider, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str integration_provider: (required) - :param str integration_name: (required) - :return: list[PromptTemplate] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_prompts_with_integration_with_http_info(integration_provider, integration_name, - **kwargs) # noqa: E501 - else: - (data) = self.get_prompts_with_integration_with_http_info(integration_provider, integration_name, - **kwargs) # noqa: E501 - return data - - def get_prompts_with_integration_with_http_info(self, integration_provider, integration_name, - **kwargs): # noqa: E501 - """Get the list of prompt templates associated with an integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_prompts_with_integration_with_http_info(integration_provider, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str integration_provider: (required) - :param str integration_name: (required) - :return: list[PromptTemplate] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['integration_provider', 'integration_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_prompts_with_integration" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'integration_provider' is set - if ('integration_provider' not in params or - params['integration_provider'] is None): - raise ValueError( - "Missing the required parameter `integration_provider` when calling `get_prompts_with_integration`") # noqa: E501 - # verify the required parameter 'integration_name' is set - if ('integration_name' not in params or - params['integration_name'] is None): - raise ValueError( - "Missing the required parameter `integration_name` when calling `get_prompts_with_integration`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'integration_provider' in params: - path_params['integration_provider'] = params['integration_provider'] # noqa: E501 - if 'integration_name' in params: - path_params['integration_name'] = params['integration_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{integration_provider}/integration/{integration_name}/prompt', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[PromptTemplate]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_providers_and_integrations(self, **kwargs): # noqa: E501 - """Get Integrations Providers and Integrations combo # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_providers_and_integrations(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str type: - :param bool active_only: - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_providers_and_integrations_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_providers_and_integrations_with_http_info(**kwargs) # noqa: E501 - return data - - def get_providers_and_integrations_with_http_info(self, **kwargs): # noqa: E501 - """Get Integrations Providers and Integrations combo # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_providers_and_integrations_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str type: - :param bool active_only: - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['type', 'active_only'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_providers_and_integrations" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'type' in params: - query_params.append(('type', params['type'])) # noqa: E501 - if 'active_only' in params: - query_params.append(('activeOnly', params['active_only'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/all', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[str]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tags_for_integration(self, name, integration_name, **kwargs): # noqa: E501 - """Get tags by Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_integration(name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str integration_name: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tags_for_integration_with_http_info(name, integration_name, **kwargs) # noqa: E501 - else: - (data) = self.get_tags_for_integration_with_http_info(name, integration_name, **kwargs) # noqa: E501 - return data - - def get_tags_for_integration_with_http_info(self, name, integration_name, **kwargs): # noqa: E501 - """Get tags by Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_integration_with_http_info(name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str integration_name: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'integration_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tags_for_integration" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `get_tags_for_integration`") # noqa: E501 - # verify the required parameter 'integration_name' is set - if ('integration_name' not in params or - params['integration_name'] is None): - raise ValueError( - "Missing the required parameter `integration_name` when calling `get_tags_for_integration`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'integration_name' in params: - path_params['integration_name'] = params['integration_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/integration/{integration_name}/tags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[TagObject]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tags_for_integration_provider(self, name, **kwargs): # noqa: E501 - """Get tags by Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_integration_provider(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tags_for_integration_provider_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_tags_for_integration_provider_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_tags_for_integration_provider_with_http_info(self, name, **kwargs): # noqa: E501 - """Get tags by Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_integration_provider_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tags_for_integration_provider" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `get_tags_for_integration_provider`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/tags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[TagObject]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_token_usage_for_integration(self, name, integration_name, **kwargs): # noqa: E501 - """Get Token Usage by Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_token_usage_for_integration(name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str integration_name: (required) - :return: int - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_token_usage_for_integration_with_http_info(name, integration_name, **kwargs) # noqa: E501 - else: - (data) = self.get_token_usage_for_integration_with_http_info(name, integration_name, **kwargs) # noqa: E501 - return data - - def get_token_usage_for_integration_with_http_info(self, name, integration_name, **kwargs): # noqa: E501 - """Get Token Usage by Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_token_usage_for_integration_with_http_info(name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str integration_name: (required) - :return: int - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'integration_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_token_usage_for_integration" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `get_token_usage_for_integration`") # noqa: E501 - # verify the required parameter 'integration_name' is set - if ('integration_name' not in params or - params['integration_name'] is None): - raise ValueError( - "Missing the required parameter `integration_name` when calling `get_token_usage_for_integration`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'integration_name' in params: - path_params['integration_name'] = params['integration_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/integration/{integration_name}/metrics', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='int', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_token_usage_for_integration_provider(self, name, **kwargs): # noqa: E501 - """Get Token Usage by Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_token_usage_for_integration_provider(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: dict(str, str) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_token_usage_for_integration_provider_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_token_usage_for_integration_provider_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_token_usage_for_integration_provider_with_http_info(self, name, **kwargs): # noqa: E501 - """Get Token Usage by Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_token_usage_for_integration_provider_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: dict(str, str) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_token_usage_for_integration_provider" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `get_token_usage_for_integration_provider`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/metrics', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, str)', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def put_tag_for_integration(self, body, name, integration_name, **kwargs): # noqa: E501 - """Put a tag to Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_integration(body, name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :param str integration_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_tag_for_integration_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 - else: - (data) = self.put_tag_for_integration_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 - return data - - def put_tag_for_integration_with_http_info(self, body, name, integration_name, **kwargs): # noqa: E501 - """Put a tag to Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_integration_with_http_info(body, name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :param str integration_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name', 'integration_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method put_tag_for_integration" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `put_tag_for_integration`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `put_tag_for_integration`") # noqa: E501 - # verify the required parameter 'integration_name' is set - if ('integration_name' not in params or - params['integration_name'] is None): - raise ValueError( - "Missing the required parameter `integration_name` when calling `put_tag_for_integration`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'integration_name' in params: - path_params['integration_name'] = params['integration_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/integration/{integration_name}/tags', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def put_tag_for_integration_provider(self, body, name, **kwargs): # noqa: E501 - """Put a tag to Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_integration_provider(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_tag_for_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.put_tag_for_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def put_tag_for_integration_provider_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Put a tag to Integration Provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_integration_provider_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method put_tag_for_integration_provider" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `put_tag_for_integration_provider`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `put_tag_for_integration_provider`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/tags', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def register_token_usage(self, body, name, integration_name, **kwargs): # noqa: E501 - """Register Token usage # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.register_token_usage(body, name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int body: (required) - :param str name: (required) - :param str integration_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.register_token_usage_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 - else: - (data) = self.register_token_usage_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 - return data - - def register_token_usage_with_http_info(self, body, name, integration_name, **kwargs): # noqa: E501 - """Register Token usage # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.register_token_usage_with_http_info(body, name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int body: (required) - :param str name: (required) - :param str integration_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name', 'integration_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method register_token_usage" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `register_token_usage`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `register_token_usage`") # noqa: E501 - # verify the required parameter 'integration_name' is set - if ('integration_name' not in params or - params['integration_name'] is None): - raise ValueError( - "Missing the required parameter `integration_name` when calling `register_token_usage`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'integration_name' in params: - path_params['integration_name'] = params['integration_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/integration/{integration_name}/metrics', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def save_integration_api(self, body, name, integration_name, **kwargs): # noqa: E501 - """Create or Update Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.save_integration_api(body, name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param IntegrationApiUpdate body: (required) - :param str name: (required) - :param str integration_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.save_integration_api_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 - else: - (data) = self.save_integration_api_with_http_info(body, name, integration_name, **kwargs) # noqa: E501 - return data - - def save_integration_api_with_http_info(self, body, name, integration_name, **kwargs): # noqa: E501 - """Create or Update Integration # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.save_integration_api_with_http_info(body, name, integration_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param IntegrationApiUpdate body: (required) - :param str name: (required) - :param str integration_name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name', 'integration_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method save_integration_api" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `save_integration_api`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `save_integration_api`") # noqa: E501 - # verify the required parameter 'integration_name' is set - if ('integration_name' not in params or - params['integration_name'] is None): - raise ValueError( - "Missing the required parameter `integration_name` when calling `save_integration_api`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'integration_name' in params: - path_params['integration_name'] = params['integration_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}/integration/{integration_name}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def save_integration_provider(self, body, name, **kwargs): # noqa: E501 - """Create or Update Integration provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.save_integration_provider(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param IntegrationUpdate body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.save_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.save_integration_provider_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def save_integration_provider_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Create or Update Integration provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.save_integration_provider_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param IntegrationUpdate body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method save_integration_provider" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `save_integration_provider`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `save_integration_provider`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/integrations/provider/{name}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["IntegrationResourceApi"] diff --git a/src/conductor/client/http/api/limits_resource_api.py b/src/conductor/client/http/api/limits_resource_api.py new file mode 100644 index 00000000..2fb23d7f --- /dev/null +++ b/src/conductor/client/http/api/limits_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.limits_resource_api_adapter import \ + LimitsResourceApiAdapter + +LimitsResourceApi = LimitsResourceApiAdapter + +__all__ = ["LimitsResourceApi"] diff --git a/src/conductor/client/http/api/metadata_resource_api.py b/src/conductor/client/http/api/metadata_resource_api.py index 229805d1..bff54c90 100644 --- a/src/conductor/client/http/api/metadata_resource_api.py +++ b/src/conductor/client/http/api/metadata_resource_api.py @@ -1,1277 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.metadata_resource_api_adapter import \ + MetadataResourceApiAdapter -import re # noqa: F401 +MetadataResourceApi = MetadataResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class MetadataResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create(self, body, **kwargs): # noqa: E501 - """Create a new workflow definition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkflowDef body: (required) - :param bool overwrite: - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_with_http_info(self, body, **kwargs): # noqa: E501 - """Create a new workflow definition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkflowDef body: (required) - :param bool overwrite: - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'overwrite'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'overwrite' in params: - query_params.append(('overwrite', params['overwrite'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/workflow', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_workflow_metadata(self, body, name, **kwargs): # noqa: E501 - """Store the metadata associated with workflow. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_workflow_metadata(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkflowTag body: (required) - :param str name: (required) - :param int version: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_workflow_metadata_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.create_workflow_metadata_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def create_workflow_metadata_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Store the metadata associated with workflow. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_workflow_metadata_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkflowTag body: (required) - :param str name: (required) - :param int version: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name', 'version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_workflow_metadata" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `create_workflow_metadata`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `create_workflow_metadata`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'version' in params: - query_params.append(('version', params['version'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/tags/workflow/{name}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_workflow_metadata(self, name, version, **kwargs): # noqa: E501 - """Store the metadata associated with workflow. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_workflow_metadata(name, version, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_workflow_metadata_with_http_info(name, version, **kwargs) # noqa: E501 - else: - (data) = self.delete_workflow_metadata_with_http_info(name, version, **kwargs) # noqa: E501 - return data - - def delete_workflow_metadata_with_http_info(self, name, version, **kwargs): # noqa: E501 - """Store the metadata associated with workflow. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_workflow_metadata_with_http_info(name, version, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_workflow_metadata" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `delete_workflow_metadata`") # noqa: E501 - # verify the required parameter 'version' is set - if ('version' not in params or - params['version'] is None): - raise ValueError( - "Missing the required parameter `version` when calling `delete_workflow_metadata`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'version' in params: - query_params.append(('version', params['version'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/tags/workflow/{name}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get(self, name, **kwargs): # noqa: E501 - """Retrieves workflow definition along with blueprint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: - :return: WorkflowDef - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_with_http_info(self, name, **kwargs): # noqa: E501 - """Retrieves workflow definition along with blueprint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: - :return: WorkflowDef - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'version' in params: - query_params.append(('version', params['version'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/workflow/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkflowDef', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_all_workflows(self, **kwargs): # noqa: E501 - """Retrieves all workflow definition along with blueprint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_workflows(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str access: - :return: list[WorkflowDef] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_all_workflows_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_all_workflows_with_http_info(**kwargs) # noqa: E501 - return data - - def get_all_workflows_with_http_info(self, **kwargs): # noqa: E501 - """Retrieves all workflow definition along with blueprint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_workflows_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str access: - :return: list[WorkflowDef] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['access'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_all_workflows" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'access' in params: - query_params.append(('access', params['access'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/workflow', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[WorkflowDef]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_task_def(self, tasktype, **kwargs): # noqa: E501 - """Gets the task definition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task_def(tasktype, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tasktype: (required) - :return: TaskDef - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_task_def_with_http_info(tasktype, **kwargs) # noqa: E501 - else: - (data) = self.get_task_def_with_http_info(tasktype, **kwargs) # noqa: E501 - return data - - def get_task_def_with_http_info(self, tasktype, **kwargs): # noqa: E501 - """Gets the task definition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task_def_with_http_info(tasktype, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tasktype: (required) - :return: TaskDef - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['tasktype'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_task_def" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'tasktype' is set - if ('tasktype' not in params or - params['tasktype'] is None): - raise ValueError("Missing the required parameter `tasktype` when calling `get_task_def`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'tasktype' in params: - path_params['tasktype'] = params['tasktype'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/taskdefs/{tasktype}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskDef', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_task_defs(self, **kwargs): # noqa: E501 - """Gets all task definition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task_defs(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str access: - :return: list[TaskDef] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_task_defs_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_task_defs_with_http_info(**kwargs) # noqa: E501 - return data - - def get_task_defs_with_http_info(self, **kwargs): # noqa: E501 - """Gets all task definition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task_defs_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str access: - :return: list[TaskDef] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['access'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_task_defs" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'access' in params: - query_params.append(('access', params['access'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/taskdefs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[TaskDef]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_workflow_metadata(self, name, **kwargs): # noqa: E501 - """Store the metadata associated with workflow. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflow_metadata(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: - :return: WorkflowTag - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workflow_metadata_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_workflow_metadata_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_workflow_metadata_with_http_info(self, name, **kwargs): # noqa: E501 - """Store the metadata associated with workflow. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflow_metadata_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: - :return: WorkflowTag - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workflow_metadata" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_workflow_metadata`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'version' in params: - query_params.append(('version', params['version'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/tags/workflow/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkflowTag', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def register_task_def(self, body, **kwargs): # noqa: E501 - """Create or update task definition(s) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.register_task_def(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TaskDef] body: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.register_task_def_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.register_task_def_with_http_info(body, **kwargs) # noqa: E501 - return data - - def register_task_def_with_http_info(self, body, **kwargs): # noqa: E501 - """Create or update task definition(s) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.register_task_def_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TaskDef] body: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method register_task_def" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `register_task_def`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/taskdefs', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def unregister_task_def(self, tasktype, **kwargs): # noqa: E501 - """Remove a task definition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.unregister_task_def(tasktype, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tasktype: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.unregister_task_def_with_http_info(tasktype, **kwargs) # noqa: E501 - else: - (data) = self.unregister_task_def_with_http_info(tasktype, **kwargs) # noqa: E501 - return data - - def unregister_task_def_with_http_info(self, tasktype, **kwargs): # noqa: E501 - """Remove a task definition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.unregister_task_def_with_http_info(tasktype, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tasktype: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['tasktype'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method unregister_task_def" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'tasktype' is set - if ('tasktype' not in params or - params['tasktype'] is None): - raise ValueError( - "Missing the required parameter `tasktype` when calling `unregister_task_def`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'tasktype' in params: - path_params['tasktype'] = params['tasktype'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/taskdefs/{tasktype}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def unregister_workflow_def(self, name, version, **kwargs): # noqa: E501 - """Removes workflow definition. It does not remove workflows associated with the definition. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.unregister_workflow_def(name, version, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.unregister_workflow_def_with_http_info(name, version, **kwargs) # noqa: E501 - else: - (data) = self.unregister_workflow_def_with_http_info(name, version, **kwargs) # noqa: E501 - return data - - def unregister_workflow_def_with_http_info(self, name, version, **kwargs): # noqa: E501 - """Removes workflow definition. It does not remove workflows associated with the definition. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.unregister_workflow_def_with_http_info(name, version, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method unregister_workflow_def" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `unregister_workflow_def`") # noqa: E501 - # verify the required parameter 'version' is set - if ('version' not in params or - params['version'] is None): - raise ValueError( - "Missing the required parameter `version` when calling `unregister_workflow_def`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'version' in params: - path_params['version'] = params['version'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/workflow/{name}/{version}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update1(self, body, **kwargs): # noqa: E501 - """Create or update workflow definition(s) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update1(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[WorkflowDef] body: (required) - :param bool overwrite: - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update1_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.update1_with_http_info(body, **kwargs) # noqa: E501 - return data - - def update1_with_http_info(self, body, **kwargs): # noqa: E501 - """Create or update workflow definition(s) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update1_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[WorkflowDef] body: (required) - :param bool overwrite: - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'overwrite'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update1" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'overwrite' in params: - query_params.append(('overwrite', params['overwrite'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/workflow', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_task_def(self, body, **kwargs): # noqa: E501 - """Update an existing task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_task_def(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskDef body: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_task_def_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.update_task_def_with_http_info(body, **kwargs) # noqa: E501 - return data - - def update_task_def_with_http_info(self, body, **kwargs): # noqa: E501 - """Update an existing task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_task_def_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskDef body: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_task_def" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_task_def`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/metadata/taskdefs', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["MetadataResourceApi"] diff --git a/src/conductor/client/http/api/metrics_resource_api.py b/src/conductor/client/http/api/metrics_resource_api.py new file mode 100644 index 00000000..5a10296f --- /dev/null +++ b/src/conductor/client/http/api/metrics_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.metrics_resource_api_adapter import \ + MetricsResourceApiAdapter + +MetricsResourceApi = MetricsResourceApiAdapter + +__all__ = ["MetricsResourceApi"] diff --git a/src/conductor/client/http/api/metrics_token_resource_api.py b/src/conductor/client/http/api/metrics_token_resource_api.py new file mode 100644 index 00000000..f605eea3 --- /dev/null +++ b/src/conductor/client/http/api/metrics_token_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.metrics_token_resource_api_adapter import \ + MetricsTokenResourceApiAdapter + +MetricsTokenResourceApi = MetricsTokenResourceApiAdapter + +__all__ = ["MetricsTokenResourceApi"] diff --git a/src/conductor/client/http/api/prompt_resource_api.py b/src/conductor/client/http/api/prompt_resource_api.py index 4413f3b9..f71f1791 100644 --- a/src/conductor/client/http/api/prompt_resource_api.py +++ b/src/conductor/client/http/api/prompt_resource_api.py @@ -1,813 +1,6 @@ -# coding: utf-8 +from conductor.client.adapters.api.prompt_resource_api_adapter import \ + PromptResourceApiAdapter -""" - Orkes Conductor API Server +PromptResourceApi = PromptResourceApiAdapter - Orkes Conductor API Server # noqa: E501 - - OpenAPI spec version: v2 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class PromptResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_message_template(self, name, **kwargs): # noqa: E501 - """Delete Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_message_template(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_message_template_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.delete_message_template_with_http_info(name, **kwargs) # noqa: E501 - return data - - def delete_message_template_with_http_info(self, name, **kwargs): # noqa: E501 - """Delete Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_message_template_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_message_template" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `delete_message_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/prompts/{name}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_tag_for_prompt_template(self, body, name, **kwargs): # noqa: E501 - """Delete a tag for Prompt Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_prompt_template(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tag_for_prompt_template_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.delete_tag_for_prompt_template_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def delete_tag_for_prompt_template_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Delete a tag for Prompt Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_prompt_template_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_tag_for_prompt_template" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `delete_tag_for_prompt_template`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `delete_tag_for_prompt_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/prompts/{name}/tags', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_message_template(self, name, **kwargs): # noqa: E501 - """Get Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_message_template(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: PromptTemplate - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_message_template_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_message_template_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_message_template_with_http_info(self, name, **kwargs): # noqa: E501 - """Get Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_message_template_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: PromptTemplate - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_message_template" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_message_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/prompts/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PromptTemplate', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_message_templates(self, **kwargs): # noqa: E501 - """Get Templates # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_message_templates(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[PromptTemplate] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_message_templates_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_message_templates_with_http_info(**kwargs) # noqa: E501 - return data - - def get_message_templates_with_http_info(self, **kwargs): # noqa: E501 - """Get Templates # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_message_templates_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[PromptTemplate] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_message_templates" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/prompts', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[PromptTemplate]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tags_for_prompt_template(self, name, **kwargs): # noqa: E501 - """Get tags by Prompt Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_prompt_template(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tags_for_prompt_template_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_tags_for_prompt_template_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_tags_for_prompt_template_with_http_info(self, name, **kwargs): # noqa: E501 - """Get tags by Prompt Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_prompt_template_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tags_for_prompt_template" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `get_tags_for_prompt_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/prompts/{name}/tags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[TagObject]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def put_tag_for_prompt_template(self, body, name, **kwargs): # noqa: E501 - """Put a tag to Prompt Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_prompt_template(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_tag_for_prompt_template_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.put_tag_for_prompt_template_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def put_tag_for_prompt_template_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Put a tag to Prompt Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_prompt_template_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method put_tag_for_prompt_template" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `put_tag_for_prompt_template`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `put_tag_for_prompt_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/prompts/{name}/tags', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def save_message_template(self, body, description, name, **kwargs): # noqa: E501 - """Create or Update Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.save_message_template(body, description, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str body: (required) - :param str description: (required) - :param str name: (required) - :param list[str] models: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.save_message_template_with_http_info(body, description, name, **kwargs) # noqa: E501 - else: - (data) = self.save_message_template_with_http_info(body, description, name, **kwargs) # noqa: E501 - return data - - def save_message_template_with_http_info(self, body, description, name, **kwargs): # noqa: E501 - """Create or Update Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.save_message_template_with_http_info(body, description, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str body: (required) - :param str description: (required) - :param str name: (required) - :param list[str] models: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'description', 'name', 'models'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method save_message_template" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `save_message_template`") # noqa: E501 - # verify the required parameter 'description' is set - if ('description' not in params or - params['description'] is None): - raise ValueError( - "Missing the required parameter `description` when calling `save_message_template`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `save_message_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'description' in params: - query_params.append(('description', params['description'])) # noqa: E501 - if 'models' in params: - query_params.append(('models', params['models'])) # noqa: E501 - collection_formats['models'] = 'multi' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/prompts/{name}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_message_template(self, body, **kwargs): # noqa: E501 - """Test Prompt Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_message_template(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PromptTemplateTestRequest body: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_message_template_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.test_message_template_with_http_info(body, **kwargs) # noqa: E501 - return data - - def test_message_template_with_http_info(self, body, **kwargs): # noqa: E501 - """Test Prompt Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_message_template_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PromptTemplateTestRequest body: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method test_message_template" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_message_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/prompts/test', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["PromptResourceApi"] diff --git a/src/conductor/client/http/api/queue_admin_resource_api.py b/src/conductor/client/http/api/queue_admin_resource_api.py new file mode 100644 index 00000000..005e0e54 --- /dev/null +++ b/src/conductor/client/http/api/queue_admin_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.queue_admin_resource_api_adapter import \ + QueueAdminResourceApiAdapter + +QueueAdminResourceApi = QueueAdminResourceApiAdapter + +__all__ = ["QueueAdminResourceApi"] diff --git a/src/conductor/client/http/api/scheduler_bulk_resource_api.py b/src/conductor/client/http/api/scheduler_bulk_resource_api.py new file mode 100644 index 00000000..ba3725b3 --- /dev/null +++ b/src/conductor/client/http/api/scheduler_bulk_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.scheduler_bulk_resource_api_adapter import \ + SchedulerBulkResourceApiAdapter + +SchedulerBulkResourceApi = SchedulerBulkResourceApiAdapter + +__all__ = ["SchedulerBulkResourceApi"] diff --git a/src/conductor/client/http/api/scheduler_resource_api.py b/src/conductor/client/http/api/scheduler_resource_api.py index 730d565d..07bdea26 100644 --- a/src/conductor/client/http/api/scheduler_resource_api.py +++ b/src/conductor/client/http/api/scheduler_resource_api.py @@ -1,1425 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.scheduler_resource_api_adapter import \ + SchedulerResourceApiAdapter -import re # noqa: F401 +SchedulerResourceApi = SchedulerResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class SchedulerResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_schedule(self, name, **kwargs): # noqa: E501 - """Deletes an existing workflow schedule by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_schedule(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_schedule_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.delete_schedule_with_http_info(name, **kwargs) # noqa: E501 - return data - - def delete_schedule_with_http_info(self, name, **kwargs): # noqa: E501 - """Deletes an existing workflow schedule by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_schedule_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_schedule" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `delete_schedule`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/schedules/{name}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_all_schedules(self, **kwargs): # noqa: E501 - """Get all existing workflow schedules and optionally filter by workflow name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_schedules(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_name: - :return: list[WorkflowSchedule] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_all_schedules_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_all_schedules_with_http_info(**kwargs) # noqa: E501 - return data - - def get_all_schedules_with_http_info(self, **kwargs): # noqa: E501 - """Get all existing workflow schedules and optionally filter by workflow name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_schedules_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_name: - :return: list[WorkflowSchedule] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_all_schedules" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'workflow_name' in params: - query_params.append(('workflowName', params['workflow_name'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/schedules', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[WorkflowSchedule]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_next_few_schedules(self, cron_expression, **kwargs): # noqa: E501 - """Get list of the next x (default 3, max 5) execution times for a scheduler # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_next_few_schedules(cron_expression, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str cron_expression: (required) - :param int schedule_start_time: - :param int schedule_end_time: - :param int limit: - :return: list[int] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_next_few_schedules_with_http_info(cron_expression, **kwargs) # noqa: E501 - else: - (data) = self.get_next_few_schedules_with_http_info(cron_expression, **kwargs) # noqa: E501 - return data - - def get_next_few_schedules_with_http_info(self, cron_expression, **kwargs): # noqa: E501 - """Get list of the next x (default 3, max 5) execution times for a scheduler # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_next_few_schedules_with_http_info(cron_expression, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str cron_expression: (required) - :param int schedule_start_time: - :param int schedule_end_time: - :param int limit: - :return: list[int] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['cron_expression', 'schedule_start_time', 'schedule_end_time', 'limit'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_next_few_schedules" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'cron_expression' is set - if ('cron_expression' not in params or - params['cron_expression'] is None): - raise ValueError( - "Missing the required parameter `cron_expression` when calling `get_next_few_schedules`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'cron_expression' in params: - query_params.append(('cronExpression', params['cron_expression'])) # noqa: E501 - if 'schedule_start_time' in params: - query_params.append(('scheduleStartTime', params['schedule_start_time'])) # noqa: E501 - if 'schedule_end_time' in params: - query_params.append(('scheduleEndTime', params['schedule_end_time'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/nextFewSchedules', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[int]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_schedule(self, name, **kwargs): # noqa: E501 - """Get an existing workflow schedule by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_schedule(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_schedule_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_schedule_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_schedule_with_http_info(self, name, **kwargs): # noqa: E501 - """Get an existing workflow schedule by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_schedule_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_schedule" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_schedule`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/schedules/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def pause_all_schedules(self, **kwargs): # noqa: E501 - """Pause all scheduling in a single conductor server instance (for debugging only) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.pause_all_schedules(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.pause_all_schedules_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.pause_all_schedules_with_http_info(**kwargs) # noqa: E501 - return data - - def pause_all_schedules_with_http_info(self, **kwargs): # noqa: E501 - """Pause all scheduling in a single conductor server instance (for debugging only) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.pause_all_schedules_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method pause_all_schedules" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/admin/pause', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, object)', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def pause_schedule(self, name, **kwargs): # noqa: E501 - """Pauses an existing schedule by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.pause_schedule(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.pause_schedule_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.pause_schedule_with_http_info(name, **kwargs) # noqa: E501 - return data - - def pause_schedule_with_http_info(self, name, **kwargs): # noqa: E501 - """Pauses an existing schedule by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.pause_schedule_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method pause_schedule" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `pause_schedule`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/schedules/{name}/pause', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def requeue_all_execution_records(self, **kwargs): # noqa: E501 - """Requeue all execution records # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.requeue_all_execution_records(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.requeue_all_execution_records_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.requeue_all_execution_records_with_http_info(**kwargs) # noqa: E501 - return data - - def requeue_all_execution_records_with_http_info(self, **kwargs): # noqa: E501 - """Requeue all execution records # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.requeue_all_execution_records_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method requeue_all_execution_records" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/admin/requeue', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, object)', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def resume_all_schedules(self, **kwargs): # noqa: E501 - """Resume all scheduling # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.resume_all_schedules(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.resume_all_schedules_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.resume_all_schedules_with_http_info(**kwargs) # noqa: E501 - return data - - def resume_all_schedules_with_http_info(self, **kwargs): # noqa: E501 - """Resume all scheduling # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.resume_all_schedules_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method resume_all_schedules" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/admin/resume', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, object)', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def resume_schedule(self, name, **kwargs): # noqa: E501 - """Resume a paused schedule by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.resume_schedule(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.resume_schedule_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.resume_schedule_with_http_info(name, **kwargs) # noqa: E501 - return data - - def resume_schedule_with_http_info(self, name, **kwargs): # noqa: E501 - """Resume a paused schedule by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.resume_schedule_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method resume_schedule" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `resume_schedule`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/schedules/{name}/resume', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def save_schedule(self, body, **kwargs): # noqa: E501 - """Create or update a schedule for a specified workflow with a corresponding start workflow request # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.save_schedule(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param SaveScheduleRequest body: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.save_schedule_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.save_schedule_with_http_info(body, **kwargs) # noqa: E501 - return data - - def save_schedule_with_http_info(self, body, **kwargs): # noqa: E501 - """Create or update a schedule for a specified workflow with a corresponding start workflow request # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.save_schedule_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param SaveScheduleRequest body: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method save_schedule" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `save_schedule`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/schedules', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def search_v21(self, **kwargs): # noqa: E501 - """Search for workflows based on payload and other parameters # noqa: E501 - - use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_v21(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int start: - :param int size: - :param str sort: - :param str free_text: - :param str query: - :return: SearchResultWorkflowScheduleExecutionModel - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.search_v21_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.search_v21_with_http_info(**kwargs) # noqa: E501 - return data - - def search_v21_with_http_info(self, **kwargs): # noqa: E501 - """Search for workflows based on payload and other parameters # noqa: E501 - - use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_v21_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int start: - :param int size: - :param str sort: - :param str free_text: - :param str query: - :return: SearchResultWorkflowScheduleExecutionModel - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['start', 'size', 'sort', 'free_text', 'query'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method search_v21" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'start' in params: - query_params.append(('start', params['start'])) # noqa: E501 - if 'size' in params: - query_params.append(('size', params['size'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - if 'free_text' in params: - query_params.append(('freeText', params['free_text'])) # noqa: E501 - if 'query' in params: - query_params.append(('query', params['query'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/search/executions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SearchResultWorkflowScheduleExecutionModel', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_timeout(self, **kwargs): # noqa: E501 - """Test timeout - do not use in production # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_timeout(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_timeout_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.test_timeout_with_http_info(**kwargs) # noqa: E501 - return data - - def test_timeout_with_http_info(self, **kwargs): # noqa: E501 - """Test timeout - do not use in production # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_timeout_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method test_timeout" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/test/timeout', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def put_tag_for_schedule(self, body, name, **kwargs): # noqa: E501 - """Put a tag to schedule # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_schedule(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_tag_for_schedule_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.put_tag_for_schedule_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def put_tag_for_schedule_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Put a tag to schedule # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_schedule_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method put_tag_for_schedule" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `put_tag_for_schedule`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `put_tag_for_schedule`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/schedules/{name}/tags', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tags_for_schedule(self, name, **kwargs): # noqa: E501 - """Get tags by schedule # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_schedule(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tags_for_schedule_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_tags_for_schedule_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_tags_for_schedule_with_http_info(self, name, **kwargs): # noqa: E501 - """Get tags by schedule # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_schedule_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tags_for_schedule" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_tags_for_schedule`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/schedules/{name}/tags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[TagObject]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_tag_for_schedule(self, body, name, **kwargs): # noqa: E501 - """Delete a tag for schedule # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_schedule(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tag_for_schedule_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.delete_tag_for_schedule_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def delete_tag_for_schedule_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Delete a tag for schedule # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_schedule_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_tag_for_schedule" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `delete_tag_for_schedule`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `delete_tag_for_schedule`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/scheduler/schedules/{name}/tags', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["SchedulerResourceApi"] diff --git a/src/conductor/client/http/api/schema_resource_api.py b/src/conductor/client/http/api/schema_resource_api.py index a094e333..2f933912 100644 --- a/src/conductor/client/http/api/schema_resource_api.py +++ b/src/conductor/client/http/api/schema_resource_api.py @@ -1,485 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.schema_resource_api_adapter import \ + SchemaResourceApiAdapter -import re # noqa: F401 +SchemaResourceApi = SchemaResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class SchemaResourceApi(object): - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_schema_by_name(self, name, **kwargs): # noqa: E501 - """Delete all versions of schema by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_schema_by_name(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_schema_by_name_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.delete_schema_by_name_with_http_info(name, **kwargs) # noqa: E501 - return data - - def delete_schema_by_name_with_http_info(self, name, **kwargs): # noqa: E501 - """Delete all versions of schema by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_schema_by_name_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_schema_by_name" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `delete_schema_by_name`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/schema/{name}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_schema_by_name_and_version(self, name, version, **kwargs): # noqa: E501 - """Delete a version of schema by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_schema_by_name_and_version(name, version, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_schema_by_name_and_version_with_http_info(name, version, **kwargs) # noqa: E501 - else: - (data) = self.delete_schema_by_name_and_version_with_http_info(name, version, **kwargs) # noqa: E501 - return data - - def delete_schema_by_name_and_version_with_http_info(self, name, version, **kwargs): # noqa: E501 - """Delete a version of schema by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_schema_by_name_and_version_with_http_info(name, version, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_schema_by_name_and_version" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `delete_schema_by_name_and_version`") # noqa: E501 - # verify the required parameter 'version' is set - if ('version' not in params or - params['version'] is None): - raise ValueError("Missing the required parameter `version` when calling `delete_schema_by_name_and_version`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'version' in params: - path_params['version'] = params['version'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/schema/{name}/{version}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_all_schemas(self, **kwargs): # noqa: E501 - """Get all schemas # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_schemas(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[SchemaDef] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_all_schemas_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_all_schemas_with_http_info(**kwargs) # noqa: E501 - return data - - def get_all_schemas_with_http_info(self, **kwargs): # noqa: E501 - """Get all schemas # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_schemas_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[SchemaDef] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_all_schemas" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/schema', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[SchemaDef]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_schema_by_name_and_version(self, name, version, **kwargs): # noqa: E501 - """Get schema by name and version # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_schema_by_name_and_version(name, version, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: (required) - :return: SchemaDef - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_schema_by_name_and_version_with_http_info(name, version, **kwargs) # noqa: E501 - else: - (data) = self.get_schema_by_name_and_version_with_http_info(name, version, **kwargs) # noqa: E501 - return data - - def get_schema_by_name_and_version_with_http_info(self, name, version, **kwargs): # noqa: E501 - """Get schema by name and version # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_schema_by_name_and_version_with_http_info(name, version, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: (required) - :return: SchemaDef - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_schema_by_name_and_version" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_schema_by_name_and_version`") # noqa: E501 - # verify the required parameter 'version' is set - if ('version' not in params or - params['version'] is None): - raise ValueError("Missing the required parameter `version` when calling `get_schema_by_name_and_version`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'version' in params: - path_params['version'] = params['version'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/schema/{name}/{version}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SchemaDef', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def save(self, body, **kwargs): # noqa: E501 - """Save schema # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.save(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[SchemaDef] body: (required) - :param bool new_version: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.save_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.save_with_http_info(body, **kwargs) # noqa: E501 - return data - - def save_with_http_info(self, body, **kwargs): # noqa: E501 - """Save schema # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.save_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[SchemaDef] body: (required) - :param bool new_version: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'new_version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method save" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `save`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'new_version' in params: - query_params.append(('newVersion', params['new_version'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/schema', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["SchemaResourceApi"] diff --git a/src/conductor/client/http/api/secret_resource_api.py b/src/conductor/client/http/api/secret_resource_api.py index 9b6707b4..6f12c711 100644 --- a/src/conductor/client/http/api/secret_resource_api.py +++ b/src/conductor/client/http/api/secret_resource_api.py @@ -1,957 +1,6 @@ -# coding: utf-8 +from conductor.client.adapters.api.secret_resource_api_adapter import \ + SecretResourceApiAdapter -from __future__ import absolute_import +SecretResourceApi = SecretResourceApiAdapter -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class SecretResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_secret(self, key, **kwargs): # noqa: E501 - """Delete a secret value by key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_secret(key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str key: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_secret_with_http_info(key, **kwargs) # noqa: E501 - else: - (data) = self.delete_secret_with_http_info(key, **kwargs) # noqa: E501 - return data - - def delete_secret_with_http_info(self, key, **kwargs): # noqa: E501 - """Delete a secret value by key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_secret_with_http_info(key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str key: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['key'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_secret" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'key' is set - if ('key' not in params or - params['key'] is None): - raise ValueError("Missing the required parameter `key` when calling `delete_secret`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'key' in params: - path_params['key'] = params['key'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/secrets/{key}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_tag_for_secret(self, body, key, **kwargs): # noqa: E501 - """Delete tags of the secret # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_secret(body, key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str key: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tag_for_secret_with_http_info(body, key, **kwargs) # noqa: E501 - else: - (data) = self.delete_tag_for_secret_with_http_info(body, key, **kwargs) # noqa: E501 - return data - - def delete_tag_for_secret_with_http_info(self, body, key, **kwargs): # noqa: E501 - """Delete tags of the secret # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_for_secret_with_http_info(body, key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str key: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'key'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_tag_for_secret" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `delete_tag_for_secret`") # noqa: E501 - # verify the required parameter 'key' is set - if ('key' not in params or - params['key'] is None): - raise ValueError("Missing the required parameter `key` when calling `delete_tag_for_secret`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'key' in params: - path_params['key'] = params['key'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/secrets/{key}/tags', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_secret(self, key, **kwargs): # noqa: E501 - """Get secret value by key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_secret(key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str key: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_secret_with_http_info(key, **kwargs) # noqa: E501 - else: - (data) = self.get_secret_with_http_info(key, **kwargs) # noqa: E501 - return data - - def get_secret_with_http_info(self, key, **kwargs): # noqa: E501 - """Get secret value by key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_secret_with_http_info(key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str key: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['key'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_secret" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'key' is set - if ('key' not in params or - params['key'] is None): - raise ValueError("Missing the required parameter `key` when calling `get_secret`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'key' in params: - path_params['key'] = params['key'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/secrets/{key}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tags(self, key, **kwargs): # noqa: E501 - """Get tags by secret # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags(key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str key: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tags_with_http_info(key, **kwargs) # noqa: E501 - else: - (data) = self.get_tags_with_http_info(key, **kwargs) # noqa: E501 - return data - - def get_tags_with_http_info(self, key, **kwargs): # noqa: E501 - """Get tags by secret # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_with_http_info(key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str key: (required) - :return: list[TagObject] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['key'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tags" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'key' is set - if ('key' not in params or - params['key'] is None): - raise ValueError("Missing the required parameter `key` when calling `get_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'key' in params: - path_params['key'] = params['key'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/secrets/{key}/tags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[TagObject]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def list_all_secret_names(self, **kwargs): # noqa: E501 - """List all secret names # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_all_secret_names(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_all_secret_names_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_all_secret_names_with_http_info(**kwargs) # noqa: E501 - return data - - def list_all_secret_names_with_http_info(self, **kwargs): # noqa: E501 - """List all secret names # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_all_secret_names_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method list_all_secret_names" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/secrets', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def list_secrets_that_user_can_grant_access_to(self, **kwargs): # noqa: E501 - """List all secret names user can grant access to # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_secrets_that_user_can_grant_access_to(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_secrets_that_user_can_grant_access_to_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_secrets_that_user_can_grant_access_to_with_http_info(**kwargs) # noqa: E501 - return data - - def list_secrets_that_user_can_grant_access_to_with_http_info(self, **kwargs): # noqa: E501 - """List all secret names user can grant access to # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_secrets_that_user_can_grant_access_to_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method list_secrets_that_user_can_grant_access_to" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/secrets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[str]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def list_secrets_with_tags_that_user_can_grant_access_to(self, **kwargs): # noqa: E501 - """List all secret names along with tags user can grant access to # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_secrets_with_tags_that_user_can_grant_access_to(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[ExtendedSecret] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_secrets_with_tags_that_user_can_grant_access_to_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_secrets_with_tags_that_user_can_grant_access_to_with_http_info(**kwargs) # noqa: E501 - return data - - def list_secrets_with_tags_that_user_can_grant_access_to_with_http_info(self, **kwargs): # noqa: E501 - """List all secret names along with tags user can grant access to # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_secrets_with_tags_that_user_can_grant_access_to_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[ExtendedSecret] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method list_secrets_with_tags_that_user_can_grant_access_to" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/secrets-v2', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[ExtendedSecret]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def put_secret(self, body, key, **kwargs): # noqa: E501 - """Put a secret value by key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_secret(body, key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str body: (required) - :param str key: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_secret_with_http_info(body, key, **kwargs) # noqa: E501 - else: - (data) = self.put_secret_with_http_info(body, key, **kwargs) # noqa: E501 - return data - - def put_secret_with_http_info(self, body, key, **kwargs): # noqa: E501 - """Put a secret value by key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_secret_with_http_info(body, key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str body: (required) - :param str key: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'key'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method put_secret" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `put_secret`") # noqa: E501 - # verify the required parameter 'key' is set - if ('key' not in params or - params['key'] is None): - raise ValueError("Missing the required parameter `key` when calling `put_secret`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'key' in params: - path_params['key'] = params['key'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/secrets/{key}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def put_tag_for_secret(self, body, key, **kwargs): # noqa: E501 - """Tag a secret # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_secret(body, key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str key: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_tag_for_secret_with_http_info(body, key, **kwargs) # noqa: E501 - else: - (data) = self.put_tag_for_secret_with_http_info(body, key, **kwargs) # noqa: E501 - return data - - def put_tag_for_secret_with_http_info(self, body, key, **kwargs): # noqa: E501 - """Tag a secret # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_tag_for_secret_with_http_info(body, key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[TagObject] body: (required) - :param str key: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'key'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method put_tag_for_secret" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `put_tag_for_secret`") # noqa: E501 - # verify the required parameter 'key' is set - if ('key' not in params or - params['key'] is None): - raise ValueError("Missing the required parameter `key` when calling `put_tag_for_secret`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'key' in params: - path_params['key'] = params['key'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/secrets/{key}/tags', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def secret_exists(self, key, **kwargs): # noqa: E501 - """Check if secret exists # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.secret_exists(key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str key: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.secret_exists_with_http_info(key, **kwargs) # noqa: E501 - else: - (data) = self.secret_exists_with_http_info(key, **kwargs) # noqa: E501 - return data - - def secret_exists_with_http_info(self, key, **kwargs): # noqa: E501 - """Check if secret exists # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.secret_exists_with_http_info(key, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str key: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['key'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method secret_exists" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'key' is set - if ('key' not in params or - params['key'] is None): - raise ValueError("Missing the required parameter `key` when calling `secret_exists`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'key' in params: - path_params['key'] = params['key'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/secrets/{key}/exists', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["SecretResourceApi"] diff --git a/src/conductor/client/http/api/service_registry_resource_api.py b/src/conductor/client/http/api/service_registry_resource_api.py index 105d22ae..c5f1d5ac 100644 --- a/src/conductor/client/http/api/service_registry_resource_api.py +++ b/src/conductor/client/http/api/service_registry_resource_api.py @@ -1,1384 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.service_registry_resource_api_adapter import \ + ServiceRegistryResourceApiAdapter -import re # noqa: F401 +ServiceRegistryResourceApi = ServiceRegistryResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class ServiceRegistryResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_registered_services(self, **kwargs): # noqa: E501 - """Get all registered services # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_registered_services(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[ServiceRegistry] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_registered_services_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_registered_services_with_http_info(**kwargs) # noqa: E501 - return data - - def get_registered_services_with_http_info(self, **kwargs): # noqa: E501 - """Get all registered services # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_registered_services_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[ServiceRegistry] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_registered_services" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[ServiceRegistry]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_service(self, name, **kwargs): # noqa: E501 - """Remove a service from the registry # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_service(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_service_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.remove_service_with_http_info(name, **kwargs) # noqa: E501 - return data - - def remove_service_with_http_info(self, name, **kwargs): # noqa: E501 - """Remove a service from the registry # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_service_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_service" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `remove_service`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/{name}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_service(self, name, **kwargs): # noqa: E501 - """Get a specific service by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_service(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: ServiceRegistry - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_service_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_service_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_service_with_http_info(self, name, **kwargs): # noqa: E501 - """Get a specific service by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_service_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: ServiceRegistry - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_service" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_service`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ServiceRegistry', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def open_circuit_breaker(self, name, **kwargs): # noqa: E501 - """Open the circuit breaker for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.open_circuit_breaker(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: CircuitBreakerTransitionResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.open_circuit_breaker_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.open_circuit_breaker_with_http_info(name, **kwargs) # noqa: E501 - return data - - def open_circuit_breaker_with_http_info(self, name, **kwargs): # noqa: E501 - """Open the circuit breaker for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.open_circuit_breaker_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: CircuitBreakerTransitionResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method open_circuit_breaker" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `open_circuit_breaker`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/{name}/circuit-breaker/open', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CircuitBreakerTransitionResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def close_circuit_breaker(self, name, **kwargs): # noqa: E501 - """Close the circuit breaker for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.close_circuit_breaker(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: CircuitBreakerTransitionResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.close_circuit_breaker_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.close_circuit_breaker_with_http_info(name, **kwargs) # noqa: E501 - return data - - def close_circuit_breaker_with_http_info(self, name, **kwargs): # noqa: E501 - """Close the circuit breaker for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.close_circuit_breaker_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: CircuitBreakerTransitionResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method close_circuit_breaker" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `close_circuit_breaker`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/{name}/circuit-breaker/close', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CircuitBreakerTransitionResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_circuit_breaker_status(self, name, **kwargs): # noqa: E501 - """Get the circuit breaker status for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_circuit_breaker_status(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: CircuitBreakerTransitionResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_circuit_breaker_status_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_circuit_breaker_status_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_circuit_breaker_status_with_http_info(self, name, **kwargs): # noqa: E501 - """Get the circuit breaker status for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_circuit_breaker_status_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :return: CircuitBreakerTransitionResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_circuit_breaker_status" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `get_circuit_breaker_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/{name}/circuit-breaker/status', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CircuitBreakerTransitionResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def add_or_update_service(self, body, **kwargs): # noqa: E501 - """Add or update a service registry entry # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_or_update_service(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ServiceRegistry body: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_or_update_service_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.add_or_update_service_with_http_info(body, **kwargs) # noqa: E501 - return data - - def add_or_update_service_with_http_info(self, body, **kwargs): # noqa: E501 - """Add or update a service registry entry # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_or_update_service_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ServiceRegistry body: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_or_update_service" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_or_update_service`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def add_or_update_method(self, registry_name, body, **kwargs): # noqa: E501 - """Add or update a service method # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_or_update_method(registry_name, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :param ServiceMethod body: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_or_update_method_with_http_info(registry_name, body, **kwargs) # noqa: E501 - else: - (data) = self.add_or_update_method_with_http_info(registry_name, body, **kwargs) # noqa: E501 - return data - - def add_or_update_method_with_http_info(self, registry_name, body, **kwargs): # noqa: E501 - """Add or update a service method # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_or_update_method_with_http_info(registry_name, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :param ServiceMethod body: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['registry_name', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_or_update_method" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'registry_name' is set - if ('registry_name' not in params or - params['registry_name'] is None): - raise ValueError( - "Missing the required parameter `registry_name` when calling `add_or_update_method`") # noqa: E501 - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `add_or_update_method`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'registry_name' in params: - path_params['registryName'] = params['registry_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/{registryName}/methods', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_method(self, registry_name, service_name, method, method_type, **kwargs): # noqa: E501 - """Remove a method from a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_method(registry_name, service_name, method, method_type, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :param str service_name: (required) - :param str method: (required) - :param str method_type: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_method_with_http_info(registry_name, service_name, method, method_type, - **kwargs) # noqa: E501 - else: - (data) = self.remove_method_with_http_info(registry_name, service_name, method, method_type, - **kwargs) # noqa: E501 - return data - - def remove_method_with_http_info(self, registry_name, service_name, method, method_type, **kwargs): # noqa: E501 - """Remove a method from a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_method_with_http_info(registry_name, service_name, method, method_type, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :param str service_name: (required) - :param str method: (required) - :param str method_type: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['registry_name', 'service_name', 'method', 'method_type'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_method" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'registry_name' is set - if ('registry_name' not in params or - params['registry_name'] is None): - raise ValueError( - "Missing the required parameter `registry_name` when calling `remove_method`") # noqa: E501 - # verify the required parameter 'service_name' is set - if ('service_name' not in params or - params['service_name'] is None): - raise ValueError("Missing the required parameter `service_name` when calling `remove_method`") # noqa: E501 - # verify the required parameter 'method' is set - if ('method' not in params or - params['method'] is None): - raise ValueError("Missing the required parameter `method` when calling `remove_method`") # noqa: E501 - # verify the required parameter 'method_type' is set - if ('method_type' not in params or - params['method_type'] is None): - raise ValueError("Missing the required parameter `method_type` when calling `remove_method`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'registry_name' in params: - path_params['registryName'] = params['registry_name'] # noqa: E501 - - query_params = [] - if 'service_name' in params: - query_params.append(('serviceName', params['service_name'])) # noqa: E501 - if 'method' in params: - query_params.append(('method', params['method'])) # noqa: E501 - if 'method_type' in params: - query_params.append(('methodType', params['method_type'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/{registryName}/methods', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_proto_data(self, registry_name, filename, **kwargs): # noqa: E501 - """Get proto data for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_proto_data(registry_name, filename, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :param str filename: (required) - :return: bytes - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_proto_data_with_http_info(registry_name, filename, **kwargs) # noqa: E501 - else: - (data) = self.get_proto_data_with_http_info(registry_name, filename, **kwargs) # noqa: E501 - return data - - def get_proto_data_with_http_info(self, registry_name, filename, **kwargs): # noqa: E501 - """Get proto data for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_proto_data_with_http_info(registry_name, filename, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :param str filename: (required) - :return: bytes - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['registry_name', 'filename'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_proto_data" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'registry_name' is set - if ('registry_name' not in params or - params['registry_name'] is None): - raise ValueError( - "Missing the required parameter `registry_name` when calling `get_proto_data`") # noqa: E501 - # verify the required parameter 'filename' is set - if ('filename' not in params or - params['filename'] is None): - raise ValueError("Missing the required parameter `filename` when calling `get_proto_data`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'registry_name' in params: - path_params['registryName'] = params['registry_name'] # noqa: E501 - if 'filename' in params: - path_params['filename'] = params['filename'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/octet-stream']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/protos/{registryName}/{filename}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='bytes', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def set_proto_data(self, registry_name, filename, data, **kwargs): # noqa: E501 - """Set proto data for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.set_proto_data(registry_name, filename, data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :param str filename: (required) - :param bytes data: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.set_proto_data_with_http_info(registry_name, filename, data, **kwargs) # noqa: E501 - else: - (data) = self.set_proto_data_with_http_info(registry_name, filename, data, **kwargs) # noqa: E501 - return data - - def set_proto_data_with_http_info(self, registry_name, filename, data, **kwargs): # noqa: E501 - """Set proto data for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.set_proto_data_with_http_info(registry_name, filename, data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :param str filename: (required) - :param bytes data: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['registry_name', 'filename', 'data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method set_proto_data" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'registry_name' is set - if ('registry_name' not in params or - params['registry_name'] is None): - raise ValueError( - "Missing the required parameter `registry_name` when calling `set_proto_data`") # noqa: E501 - # verify the required parameter 'filename' is set - if ('filename' not in params or - params['filename'] is None): - raise ValueError("Missing the required parameter `filename` when calling `set_proto_data`") # noqa: E501 - # verify the required parameter 'data' is set - if ('data' not in params or - params['data'] is None): - raise ValueError("Missing the required parameter `data` when calling `set_proto_data`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'registry_name' in params: - path_params['registryName'] = params['registry_name'] # noqa: E501 - if 'filename' in params: - path_params['filename'] = params['filename'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'data' in params: - body_params = params['data'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/octet-stream']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/protos/{registryName}/{filename}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_proto(self, registry_name, filename, **kwargs): # noqa: E501 - """Delete a proto file # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_proto(registry_name, filename, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :param str filename: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_proto_with_http_info(registry_name, filename, **kwargs) # noqa: E501 - else: - (data) = self.delete_proto_with_http_info(registry_name, filename, **kwargs) # noqa: E501 - return data - - def delete_proto_with_http_info(self, registry_name, filename, **kwargs): # noqa: E501 - """Delete a proto file # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_proto_with_http_info(registry_name, filename, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :param str filename: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['registry_name', 'filename'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_proto" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'registry_name' is set - if ('registry_name' not in params or - params['registry_name'] is None): - raise ValueError( - "Missing the required parameter `registry_name` when calling `delete_proto`") # noqa: E501 - # verify the required parameter 'filename' is set - if ('filename' not in params or - params['filename'] is None): - raise ValueError("Missing the required parameter `filename` when calling `delete_proto`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'registry_name' in params: - path_params['registryName'] = params['registry_name'] # noqa: E501 - if 'filename' in params: - path_params['filename'] = params['filename'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/protos/{registryName}/{filename}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_all_protos(self, registry_name, **kwargs): # noqa: E501 - """Get all protos for a registry # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_protos(registry_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :return: list[ProtoRegistryEntry] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_all_protos_with_http_info(registry_name, **kwargs) # noqa: E501 - else: - (data) = self.get_all_protos_with_http_info(registry_name, **kwargs) # noqa: E501 - return data - - def get_all_protos_with_http_info(self, registry_name, **kwargs): # noqa: E501 - """Get all protos for a registry # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_protos_with_http_info(registry_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str registry_name: (required) - :return: list[ProtoRegistryEntry] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['registry_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_all_protos" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'registry_name' is set - if ('registry_name' not in params or - params['registry_name'] is None): - raise ValueError( - "Missing the required parameter `registry_name` when calling `get_all_protos`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'registry_name' in params: - path_params['registryName'] = params['registry_name'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/protos/{registryName}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[ProtoRegistryEntry]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def discover(self, name, **kwargs): # noqa: E501 - """Discover methods for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.discover(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param bool create: - :return: list[ServiceMethod] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.discover_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.discover_with_http_info(name, **kwargs) # noqa: E501 - return data - - def discover_with_http_info(self, name, **kwargs): # noqa: E501 - """Discover methods for a service # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.discover_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param bool create: - :return: list[ServiceMethod] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'create'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method discover" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `discover`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'create' in params: - query_params.append(('create', params['create'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/registry/service/{name}/discover', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[ServiceMethod]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) \ No newline at end of file +__all__ = ["ServiceRegistryResourceApi"] diff --git a/src/conductor/client/http/api/tags_api.py b/src/conductor/client/http/api/tags_api.py new file mode 100644 index 00000000..e075db12 --- /dev/null +++ b/src/conductor/client/http/api/tags_api.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.api.tags_api_adapter import TagsApiAdapter + +TagsApi = TagsApiAdapter + +__all__ = ["TagsApi"] diff --git a/src/conductor/client/http/api/task_resource_api.py b/src/conductor/client/http/api/task_resource_api.py index 0515cc89..dedec50c 100644 --- a/src/conductor/client/http/api/task_resource_api.py +++ b/src/conductor/client/http/api/task_resource_api.py @@ -1,1965 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.task_resource_api_adapter import \ + TaskResourceApiAdapter -import re # noqa: F401 -import socket +TaskResourceApi = TaskResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient -from conductor.client.http.models.signal_response import SignalResponse - - -class TaskResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def all(self, **kwargs): # noqa: E501 - """Get the details about each queue # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.all(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, int) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.all_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.all_with_http_info(**kwargs) # noqa: E501 - return data - - def all_with_http_info(self, **kwargs): # noqa: E501 - """Get the details about each queue # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.all_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, int) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method all" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/queue/all', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, int)', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def all_verbose(self, **kwargs): # noqa: E501 - """Get the details about each queue # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.all_verbose(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, dict(str, dict(str, int))) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.all_verbose_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.all_verbose_with_http_info(**kwargs) # noqa: E501 - return data - - def all_verbose_with_http_info(self, **kwargs): # noqa: E501 - """Get the details about each queue # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.all_verbose_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, dict(str, dict(str, int))) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method all_verbose" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/queue/all/verbose', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, dict(str, dict(str, int)))', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def batch_poll(self, tasktype, **kwargs): # noqa: E501 - """Batch poll for a task of a certain type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.batch_poll(tasktype, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tasktype: (required) - :param str workerid: - :param str domain: - :param int count: - :param int timeout: - :return: list[Task] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.batch_poll_with_http_info(tasktype, **kwargs) # noqa: E501 - else: - (data) = self.batch_poll_with_http_info(tasktype, **kwargs) # noqa: E501 - return data - - def batch_poll_with_http_info(self, tasktype, **kwargs): # noqa: E501 - """Batch poll for a task of a certain type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.batch_poll_with_http_info(tasktype, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tasktype: (required) - :param str workerid: - :param str domain: - :param int count: - :param int timeout: - :return: list[Task] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['tasktype', 'workerid', 'domain', 'count', 'timeout'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method batch_poll" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'tasktype' is set - if ('tasktype' not in params or - params['tasktype'] is None): - raise ValueError("Missing the required parameter `tasktype` when calling `batch_poll`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'tasktype' in params: - path_params['tasktype'] = params['tasktype'] # noqa: E501 - - query_params = [] - if 'workerid' in params: - query_params.append(('workerid', params['workerid'])) # noqa: E501 - if 'domain' in params: - query_params.append(('domain', params['domain'])) # noqa: E501 - if 'count' in params: - query_params.append(('count', params['count'])) # noqa: E501 - if 'timeout' in params: - query_params.append(('timeout', params['timeout'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/poll/batch/{tasktype}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Task]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_all_poll_data(self, **kwargs): # noqa: E501 - """Get the last poll data for all task types # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_poll_data(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[PollData] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_all_poll_data_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_all_poll_data_with_http_info(**kwargs) # noqa: E501 - return data - - def get_all_poll_data_with_http_info(self, **kwargs): # noqa: E501 - """Get the last poll data for all task types # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_poll_data_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[PollData] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_all_poll_data" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/queue/polldata/all', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[PollData]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_external_storage_location1(self, path, operation, payload_type, **kwargs): # noqa: E501 - """Get the external uri where the task payload is to be stored # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_external_storage_location1(path, operation, payload_type, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str path: (required) - :param str operation: (required) - :param str payload_type: (required) - :return: ExternalStorageLocation - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_external_storage_location1_with_http_info(path, operation, payload_type, - **kwargs) # noqa: E501 - else: - (data) = self.get_external_storage_location1_with_http_info(path, operation, payload_type, - **kwargs) # noqa: E501 - return data - - def get_external_storage_location1_with_http_info(self, path, operation, payload_type, **kwargs): # noqa: E501 - """Get the external uri where the task payload is to be stored # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_external_storage_location1_with_http_info(path, operation, payload_type, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str path: (required) - :param str operation: (required) - :param str payload_type: (required) - :return: ExternalStorageLocation - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['path', 'operation', 'payload_type'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_external_storage_location1" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'path' is set - if ('path' not in params or - params['path'] is None): - raise ValueError( - "Missing the required parameter `path` when calling `get_external_storage_location1`") # noqa: E501 - # verify the required parameter 'operation' is set - if ('operation' not in params or - params['operation'] is None): - raise ValueError( - "Missing the required parameter `operation` when calling `get_external_storage_location1`") # noqa: E501 - # verify the required parameter 'payload_type' is set - if ('payload_type' not in params or - params['payload_type'] is None): - raise ValueError( - "Missing the required parameter `payload_type` when calling `get_external_storage_location1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'path' in params: - query_params.append(('path', params['path'])) # noqa: E501 - if 'operation' in params: - query_params.append(('operation', params['operation'])) # noqa: E501 - if 'payload_type' in params: - query_params.append(('payloadType', params['payload_type'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/externalstoragelocation', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ExternalStorageLocation', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_poll_data(self, task_type, **kwargs): # noqa: E501 - """Get the last poll data for a given task type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_poll_data(task_type, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_type: (required) - :return: list[PollData] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_poll_data_with_http_info(task_type, **kwargs) # noqa: E501 - else: - (data) = self.get_poll_data_with_http_info(task_type, **kwargs) # noqa: E501 - return data - - def get_poll_data_with_http_info(self, task_type, **kwargs): # noqa: E501 - """Get the last poll data for a given task type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_poll_data_with_http_info(task_type, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_type: (required) - :return: list[PollData] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_type'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_poll_data" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_type' is set - if ('task_type' not in params or - params['task_type'] is None): - raise ValueError("Missing the required parameter `task_type` when calling `get_poll_data`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'task_type' in params: - query_params.append(('taskType', params['task_type'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/queue/polldata', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[PollData]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_task(self, task_id, **kwargs): # noqa: E501 - """Get task by Id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: (required) - :return: Task - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_task_with_http_info(task_id, **kwargs) # noqa: E501 - else: - (data) = self.get_task_with_http_info(task_id, **kwargs) # noqa: E501 - return data - - def get_task_with_http_info(self, task_id, **kwargs): # noqa: E501 - """Get task by Id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task_with_http_info(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: (required) - :return: Task - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_id' is set - if ('task_id' not in params or - params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `get_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_id' in params: - path_params['taskId'] = params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{taskId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Task', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_task_logs(self, task_id, **kwargs): # noqa: E501 - """Get Task Execution Logs # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task_logs(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: (required) - :return: list[TaskExecLog] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_task_logs_with_http_info(task_id, **kwargs) # noqa: E501 - else: - (data) = self.get_task_logs_with_http_info(task_id, **kwargs) # noqa: E501 - return data - - def get_task_logs_with_http_info(self, task_id, **kwargs): # noqa: E501 - """Get Task Execution Logs # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task_logs_with_http_info(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: (required) - :return: list[TaskExecLog] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_task_logs" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_id' is set - if ('task_id' not in params or - params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `get_task_logs`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_id' in params: - path_params['taskId'] = params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{taskId}/log', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[TaskExecLog]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def log(self, body, task_id, **kwargs): # noqa: E501 - """Log Task Execution Details # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.log(body, task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str body: (required) - :param str task_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.log_with_http_info(body, task_id, **kwargs) # noqa: E501 - else: - (data) = self.log_with_http_info(body, task_id, **kwargs) # noqa: E501 - return data - - def log_with_http_info(self, body, task_id, **kwargs): # noqa: E501 - """Log Task Execution Details # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.log_with_http_info(body, task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str body: (required) - :param str task_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method log" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `log`") # noqa: E501 - # verify the required parameter 'task_id' is set - if ('task_id' not in params or - params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `log`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_id' in params: - path_params['taskId'] = params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{taskId}/log', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def poll(self, tasktype, **kwargs): # noqa: E501 - """Poll for a task of a certain type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.poll(tasktype, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tasktype: (required) - :param str workerid: - :param str domain: - :return: Task - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.poll_with_http_info(tasktype, **kwargs) # noqa: E501 - else: - (data) = self.poll_with_http_info(tasktype, **kwargs) # noqa: E501 - return data - - def poll_with_http_info(self, tasktype, **kwargs): # noqa: E501 - """Poll for a task of a certain type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.poll_with_http_info(tasktype, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tasktype: (required) - :param str workerid: - :param str domain: - :return: Task - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['tasktype', 'workerid', 'domain'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method poll" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'tasktype' is set - if ('tasktype' not in params or - params['tasktype'] is None): - raise ValueError("Missing the required parameter `tasktype` when calling `poll`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'tasktype' in params: - path_params['tasktype'] = params['tasktype'] # noqa: E501 - - query_params = [] - if 'workerid' in params: - query_params.append(('workerid', params['workerid'])) # noqa: E501 - if 'domain' in params: - query_params.append(('domain', params['domain'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/poll/{tasktype}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Task', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def requeue_pending_task(self, task_type, **kwargs): # noqa: E501 - """Requeue pending tasks # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.requeue_pending_task(task_type, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_type: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.requeue_pending_task_with_http_info(task_type, **kwargs) # noqa: E501 - else: - (data) = self.requeue_pending_task_with_http_info(task_type, **kwargs) # noqa: E501 - return data - - def requeue_pending_task_with_http_info(self, task_type, **kwargs): # noqa: E501 - """Requeue pending tasks # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.requeue_pending_task_with_http_info(task_type, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_type: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_type'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method requeue_pending_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_type' is set - if ('task_type' not in params or - params['task_type'] is None): - raise ValueError( - "Missing the required parameter `task_type` when calling `requeue_pending_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_type' in params: - path_params['taskType'] = params['task_type'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['text/plain']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/queue/requeue/{taskType}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def search1(self, **kwargs): # noqa: E501 - """Search for tasks based in payload and other parameters # noqa: E501 - - use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search1(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int start: - :param int size: - :param str sort: - :param str free_text: - :param str query: - :return: SearchResultTaskSummary - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.search1_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.search1_with_http_info(**kwargs) # noqa: E501 - return data - - def search1_with_http_info(self, **kwargs): # noqa: E501 - """Search for tasks based in payload and other parameters # noqa: E501 - - use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search1_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int start: - :param int size: - :param str sort: - :param str free_text: - :param str query: - :return: SearchResultTaskSummary - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['start', 'size', 'sort', 'free_text', 'query'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method search1" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'start' in params: - query_params.append(('start', params['start'])) # noqa: E501 - if 'size' in params: - query_params.append(('size', params['size'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - if 'free_text' in params: - query_params.append(('freeText', params['free_text'])) # noqa: E501 - if 'query' in params: - query_params.append(('query', params['query'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/search', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SearchResultTaskSummary', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def search_v21(self, **kwargs): # noqa: E501 - """Search for tasks based in payload and other parameters # noqa: E501 - - use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_v21(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int start: - :param int size: - :param str sort: - :param str free_text: - :param str query: - :return: SearchResultTask - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.search_v21_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.search_v21_with_http_info(**kwargs) # noqa: E501 - return data - - def search_v21_with_http_info(self, **kwargs): # noqa: E501 - """Search for tasks based in payload and other parameters # noqa: E501 - - use sort options as sort=:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_v21_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int start: - :param int size: - :param str sort: - :param str free_text: - :param str query: - :return: SearchResultTask - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['start', 'size', 'sort', 'free_text', 'query'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method search_v21" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'start' in params: - query_params.append(('start', params['start'])) # noqa: E501 - if 'size' in params: - query_params.append(('size', params['size'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - if 'free_text' in params: - query_params.append(('freeText', params['free_text'])) # noqa: E501 - if 'query' in params: - query_params.append(('query', params['query'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/search-v2', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SearchResultTask', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def size(self, **kwargs): # noqa: E501 - """Get Task type queue sizes # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.size(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] task_type: - :return: dict(str, int) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.size_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.size_with_http_info(**kwargs) # noqa: E501 - return data - - def size_with_http_info(self, **kwargs): # noqa: E501 - """Get Task type queue sizes # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.size_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] task_type: - :return: dict(str, int) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_type'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method size" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'task_type' in params: - query_params.append(('taskType', params['task_type'])) # noqa: E501 - collection_formats['taskType'] = 'multi' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/queue/sizes', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, int)', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_task(self, body, **kwargs): # noqa: E501 - """Update a task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_task(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskResult body: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_task_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.update_task_with_http_info(body, **kwargs) # noqa: E501 - return data - - def update_task_with_http_info(self, body, **kwargs): # noqa: E501 - """Update a task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_task_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskResult body: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['text/plain']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_task1(self, body, workflow_id, task_ref_name, status, **kwargs): # noqa: E501 - """Update a task By Ref Name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_task1(body, workflow_id, task_ref_name, status, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str workflow_id: (required) - :param str task_ref_name: (required) - :param str status: (required) - :param str workerid: - :return: str - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_task1_with_http_info(body, workflow_id, task_ref_name, status, **kwargs) # noqa: E501 - else: - (data) = self.update_task1_with_http_info(body, workflow_id, task_ref_name, status, **kwargs) # noqa: E501 - return data - - def update_task1_with_http_info(self, body, workflow_id, task_ref_name, status, **kwargs): # noqa: E501 - """Update a task By Ref Name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_task1_with_http_info(body, workflow_id, task_ref_name, status, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str workflow_id: (required) - :param str task_ref_name: (required) - :param str status: (required) - :param str workerid: - :return: str - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workflow_id', 'task_ref_name', 'status'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_task1" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_task1`") # noqa: E501 - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `update_task1`") # noqa: E501 - # verify the required parameter 'task_ref_name' is set - if ('task_ref_name' not in params or - params['task_ref_name'] is None): - raise ValueError("Missing the required parameter `task_ref_name` when calling `update_task1`") # noqa: E501 - # verify the required parameter 'status' is set - if ('status' not in params or - params['status'] is None): - raise ValueError("Missing the required parameter `status` when calling `update_task1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - if 'task_ref_name' in params: - path_params['taskRefName'] = params['task_ref_name'] # noqa: E501 - if 'status' in params: - path_params['status'] = params['status'] # noqa: E501 - - query_params = [] - - if 'workerid' not in params: - params['workerid'] = socket.gethostname() - query_params.append(('workerid', params['workerid'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['text/plain']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{workflowId}/{taskRefName}/{status}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_task_sync(self, body, workflow_id, task_ref_name, status, **kwargs): # noqa: E501 - """Update a task By Ref Name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_task_sync(body, workflow_id, task_ref_name, status, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str workflow_id: (required) - :param str task_ref_name: (required) - :param str status: (required) - :param str workerid: - :return: Workflow - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_task_sync_with_http_info(body, workflow_id, task_ref_name, status, - **kwargs) # noqa: E501 - else: - (data) = self.update_task_sync_with_http_info(body, workflow_id, task_ref_name, status, - **kwargs) # noqa: E501 - return data - - def update_task_sync_with_http_info(self, body, workflow_id, task_ref_name, status, **kwargs): # noqa: E501 - """Update a task By Ref Name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_task_sync_with_http_info(body, workflow_id, task_ref_name, status, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str workflow_id: (required) - :param str task_ref_name: (required) - :param str status: (required) - :param str workerid: - :return: Workflow - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workflow_id', 'task_ref_name', 'status'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_task1" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_task1`") # noqa: E501 - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `update_task1`") # noqa: E501 - # verify the required parameter 'task_ref_name' is set - if ('task_ref_name' not in params or - params['task_ref_name'] is None): - raise ValueError("Missing the required parameter `task_ref_name` when calling `update_task1`") # noqa: E501 - # verify the required parameter 'status' is set - if ('status' not in params or - params['status'] is None): - raise ValueError("Missing the required parameter `status` when calling `update_task1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - if 'task_ref_name' in params: - path_params['taskRefName'] = params['task_ref_name'] # noqa: E501 - if 'status' in params: - path_params['status'] = params['status'] # noqa: E501 - - query_params = [] - - if 'workerid' not in params: - params['workerid'] = socket.gethostname() - query_params.append(('workerid', params['workerid'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['text/plain']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{workflowId}/{taskRefName}/{status}/sync', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Workflow', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def signal_workflow_task_async(self, workflow_id, status, body, **kwargs): # noqa: E501 - """Update running task in the workflow with given status and output asynchronously # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.signal_workflow_task_async(workflow_id, status, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param str status: (required) - :param dict(str, object) body: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.signal_workflow_task_async_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501 - else: - (data) = self.signal_workflow_task_async_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501 - return data - - def signal_workflow_task_async_with_http_info(self, workflow_id, status, body, **kwargs): # noqa: E501 - """Update running task in the workflow with given status and output asynchronously # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.signal_workflow_task_async_with_http_info(workflow_id, status, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param str status: (required) - :param dict(str, object) body: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id', 'status', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method signal_workflow_task_async" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError( - "Missing the required parameter `workflow_id` when calling `signal_workflow_task_async`") # noqa: E501 - # verify the required parameter 'status' is set - if ('status' not in params or - params['status'] is None): - raise ValueError( - "Missing the required parameter `status` when calling `signal_workflow_task_async`") # noqa: E501 - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `signal_workflow_task_async`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - if 'status' in params: - path_params['status'] = params['status'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{workflowId}/{status}/signal', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def signal_workflow_task_sync(self, workflow_id, status, body, **kwargs): # noqa: E501 - """Update running task in the workflow with given status and output synchronously and return back updated workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.signal_workflow_task_sync(workflow_id, status, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param str status: (required) - :param dict(str, object) body: (required) - :param str return_strategy: - :return: SignalResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.signal_workflow_task_sync_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501 - else: - (data) = self.signal_workflow_task_sync_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501 - return data - - def signal_workflow_task_sync_with_http_info(self, workflow_id, status, body, **kwargs): # noqa: E501 - """Update running task in the workflow with given status and output synchronously and return back updated workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.signal_workflow_task_sync_with_http_info(workflow_id, status, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param str status: (required) - :param dict(str, object) body: (required) - :param str return_strategy: - :return: SignalResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id', 'status', 'body', 'return_strategy'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method signal_workflow_task_sync" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError( - "Missing the required parameter `workflow_id` when calling `signal_workflow_task_sync`") # noqa: E501 - # verify the required parameter 'status' is set - if ('status' not in params or - params['status'] is None): - raise ValueError( - "Missing the required parameter `status` when calling `signal_workflow_task_sync`") # noqa: E501 - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `signal_workflow_task_sync`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - if 'status' in params: - path_params['status'] = params['status'] # noqa: E501 - - query_params = [] - if 'return_strategy' in params and params['return_strategy'] is not None: - query_params.append(('returnStrategy', params['return_strategy'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{workflowId}/{status}/signal/sync', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SignalResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) \ No newline at end of file +__all__ = ["TaskResourceApi"] diff --git a/src/conductor/client/http/api/token_resource_api.py b/src/conductor/client/http/api/token_resource_api.py index 4df81a7b..dd061662 100644 --- a/src/conductor/client/http/api/token_resource_api.py +++ b/src/conductor/client/http/api/token_resource_api.py @@ -1,203 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.token_resource_api_adapter import \ + TokenResourceApiAdapter -import re # noqa: F401 +TokenResourceApi = TokenResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class TokenResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def generate_token(self, body, **kwargs): # noqa: E501 - """Generate JWT with the given access key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.generate_token(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GenerateTokenRequest body: (required) - :return: Response - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.generate_token_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.generate_token_with_http_info(body, **kwargs) # noqa: E501 - return data - - def generate_token_with_http_info(self, body, **kwargs): # noqa: E501 - """Generate JWT with the given access key # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.generate_token_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GenerateTokenRequest body: (required) - :return: Response - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method generate_token" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `generate_token`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/token', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Response', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_user_info(self, **kwargs): # noqa: E501 - """Get the user info from the token # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_user_info_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_user_info_with_http_info(**kwargs) # noqa: E501 - return data - - def get_user_info_with_http_info(self, **kwargs): # noqa: E501 - """Get the user info from the token # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_info_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_info" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/token/userInfo', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["TokenResourceApi"] diff --git a/src/conductor/client/http/api/user_resource_api.py b/src/conductor/client/http/api/user_resource_api.py index 34684e3f..0dada60b 100644 --- a/src/conductor/client/http/api/user_resource_api.py +++ b/src/conductor/client/http/api/user_resource_api.py @@ -1,495 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.user_resource_api_adapter import \ + UserResourceApiAdapter -import re # noqa: F401 +UserResourceApi = UserResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class UserResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_user(self, id, **kwargs): # noqa: E501 - """Delete a user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: Response - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_user_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.delete_user_with_http_info(id, **kwargs) # noqa: E501 - return data - - def delete_user_with_http_info(self, id, **kwargs): # noqa: E501 - """Delete a user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: Response - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `delete_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/users/{id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Response', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_granted_permissions(self, user_id, **kwargs): # noqa: E501 - """Get the permissions this user has over workflows and tasks # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_granted_permissions(user_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_granted_permissions_with_http_info(user_id, **kwargs) # noqa: E501 - else: - (data) = self.get_granted_permissions_with_http_info(user_id, **kwargs) # noqa: E501 - return data - - def get_granted_permissions_with_http_info(self, user_id, **kwargs): # noqa: E501 - """Get the permissions this user has over workflows and tasks # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_granted_permissions_with_http_info(user_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['user_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_granted_permissions" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'user_id' is set - if ('user_id' not in params or - params['user_id'] is None): - raise ValueError( - "Missing the required parameter `user_id` when calling `get_granted_permissions`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'user_id' in params: - path_params['userId'] = params['user_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/users/{userId}/permissions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_user(self, id, **kwargs): # noqa: E501 - """Get a user by id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_user_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.get_user_with_http_info(id, **kwargs) # noqa: E501 - return data - - def get_user_with_http_info(self, id, **kwargs): # noqa: E501 - """Get a user by id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/users/{id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def list_users(self, **kwargs): # noqa: E501 - """Get all users # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_users(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param bool apps: - :return: list[ConductorUser] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_users_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_users_with_http_info(**kwargs) # noqa: E501 - return data - - def list_users_with_http_info(self, **kwargs): # noqa: E501 - """Get all users # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_users_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param bool apps: - :return: list[ConductorUser] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['apps'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method list_users" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'apps' in params: - query_params.append(('apps', params['apps'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/users', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[ConductorUser]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def upsert_user(self, body, id, **kwargs): # noqa: E501 - """Create or update a user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upsert_user(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param UpsertUserRequest body: (required) - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.upsert_user_with_http_info(body, id, **kwargs) # noqa: E501 - else: - (data) = self.upsert_user_with_http_info(body, id, **kwargs) # noqa: E501 - return data - - def upsert_user_with_http_info(self, body, id, **kwargs): # noqa: E501 - """Create or update a user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upsert_user_with_http_info(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param UpsertUserRequest body: (required) - :param str id: (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method upsert_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `upsert_user`") # noqa: E501 - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `upsert_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/users/{id}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["UserResourceApi"] diff --git a/src/conductor/client/http/api/version_resource_api.py b/src/conductor/client/http/api/version_resource_api.py new file mode 100644 index 00000000..e3d2c199 --- /dev/null +++ b/src/conductor/client/http/api/version_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.version_resource_api_adapter import \ + VersionResourceApiAdapter + +VersionResourceApi = VersionResourceApiAdapter + +__all__ = ["VersionResourceApi"] diff --git a/src/conductor/client/http/api/webhooks_config_resource_api.py b/src/conductor/client/http/api/webhooks_config_resource_api.py new file mode 100644 index 00000000..a1646c30 --- /dev/null +++ b/src/conductor/client/http/api/webhooks_config_resource_api.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.api.webhooks_config_resource_api_adapter import \ + WebhooksConfigResourceApiAdapter + +WebhooksConfigResourceApi = WebhooksConfigResourceApiAdapter + +__all__ = ["WebhooksConfigResourceApi"] diff --git a/src/conductor/client/http/api/workflow_bulk_resource_api.py b/src/conductor/client/http/api/workflow_bulk_resource_api.py index fa6e9022..6f90d7f5 100644 --- a/src/conductor/client/http/api/workflow_bulk_resource_api.py +++ b/src/conductor/client/http/api/workflow_bulk_resource_api.py @@ -1,519 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.workflow_bulk_resource_api_adapter import \ + WorkflowBulkResourceApiAdapter -import re # noqa: F401 +WorkflowBulkResourceApi = WorkflowBulkResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class WorkflowBulkResourceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def pause_workflow(self, body, **kwargs): # noqa: E501 - """Pause the list of workflows # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.pause_workflow(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.pause_workflow_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.pause_workflow_with_http_info(body, **kwargs) # noqa: E501 - return data - - def pause_workflow_with_http_info(self, body, **kwargs): # noqa: E501 - """Pause the list of workflows # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.pause_workflow_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method pause_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `pause_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/workflow/bulk/pause', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='BulkResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def restart(self, body, **kwargs): # noqa: E501 - """Restart the list of completed workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.restart(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :param bool use_latest_definitions: - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.restart_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.restart_with_http_info(body, **kwargs) # noqa: E501 - return data - - def restart_with_http_info(self, body, **kwargs): # noqa: E501 - """Restart the list of completed workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.restart_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :param bool use_latest_definitions: - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'use_latest_definitions'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method restart" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `restart`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'use_latest_definitions' in params: - query_params.append(('useLatestDefinitions', params['use_latest_definitions'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/workflow/bulk/restart', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='BulkResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def resume_workflow(self, body, **kwargs): # noqa: E501 - """Resume the list of workflows # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.resume_workflow(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.resume_workflow_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.resume_workflow_with_http_info(body, **kwargs) # noqa: E501 - return data - - def resume_workflow_with_http_info(self, body, **kwargs): # noqa: E501 - """Resume the list of workflows # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.resume_workflow_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method resume_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `resume_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/workflow/bulk/resume', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='BulkResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def retry(self, body, **kwargs): # noqa: E501 - """Retry the last failed task for each workflow from the list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retry(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.retry_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.retry_with_http_info(body, **kwargs) # noqa: E501 - return data - - def retry_with_http_info(self, body, **kwargs): # noqa: E501 - """Retry the last failed task for each workflow from the list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retry_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method retry" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `retry`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/workflow/bulk/retry', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='BulkResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def terminate(self, body, **kwargs): # noqa: E501 - """Terminate workflows execution # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.terminate(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :param str reason: - :param bool trigger_failure_workflow: - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.terminate_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.terminate_with_http_info(body, **kwargs) # noqa: E501 - return data - - def terminate_with_http_info(self, body, **kwargs): # noqa: E501 - """Terminate workflows execution # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.terminate_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :param str reason: - :param bool trigger_failure_workflow: - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'reason', 'triggerFailureWorkflow'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method terminate" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `terminate`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'reason' in params: - query_params.append(('reason', params['reason'])) # noqa: E501 - - if 'triggerFailureWorkflow' in params: - query_params.append(('triggerFailureWorkflow', params['triggerFailureWorkflow'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/workflow/bulk/terminate', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='BulkResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) +__all__ = ["WorkflowBulkResourceApi"] diff --git a/src/conductor/client/http/api/workflow_resource_api.py b/src/conductor/client/http/api/workflow_resource_api.py index 063104b0..23336a7a 100644 --- a/src/conductor/client/http/api/workflow_resource_api.py +++ b/src/conductor/client/http/api/workflow_resource_api.py @@ -1,3181 +1,6 @@ -from __future__ import absolute_import +from conductor.client.adapters.api.workflow_resource_api_adapter import \ + WorkflowResourceApiAdapter -import re # noqa: F401 -import uuid +WorkflowResourceApi = WorkflowResourceApiAdapter -# python 2 and python 3 compatibility library -import six - -from conductor.client.http.api_client import ApiClient - - -class WorkflowResourceApi(object): - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def decide(self, workflow_id, **kwargs): # noqa: E501 - """Starts the decision task for a workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.decide(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.decide_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.decide_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def decide_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Starts the decision task for a workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.decide_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method decide" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `decide`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/decide/{workflowId}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete(self, workflow_id, **kwargs): # noqa: E501 - """Removes the workflow from the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param bool archive_workflow: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete1_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.delete1_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def delete1_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Removes the workflow from the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete1_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param bool archive_workflow: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id', 'archive_workflow'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete1" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `delete1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - if 'archive_workflow' in params: - query_params.append(('archiveWorkflow', params['archive_workflow'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/remove', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def execute_workflow(self, body, request_id, name, version, **kwargs): # noqa: E501 - if request_id is None: - request_id = str(uuid.uuid4()) - """Execute a workflow synchronously # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.execute_workflow(body, request_id, name, version, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param StartWorkflowRequest body: (required) - :param str request_id: (required) - :param str name: (required) - :param int version: (required) - :param str wait_until_task_ref: - :param int wait_for_seconds: - :return: WorkflowRun - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.execute_workflow_with_http_info(body, request_id, name, version, **kwargs) # noqa: E501 - else: - (data) = self.execute_workflow_with_http_info(body, request_id, name, version, **kwargs) # noqa: E501 - return data - - def execute_workflow_with_http_info(self, body, request_id, name, version, **kwargs): # noqa: E501 - """Execute a workflow synchronously # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.execute_workflow_with_http_info(body, request_id, name, version, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param StartWorkflowRequest body: (required) - :param str request_id: (required) - :param str name: (required) - :param int version: (required) - :param str wait_until_task_ref: - :param int wait_for_seconds: - :return: WorkflowRun - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'request_id', 'name', 'version', 'wait_until_task_ref', 'wait_for_seconds'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method execute_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `execute_workflow`") # noqa: E501 - # verify the required parameter 'request_id' is set - if ('request_id' not in params or - params['request_id'] is None): - raise ValueError( - "Missing the required parameter `request_id` when calling `execute_workflow`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `execute_workflow`") # noqa: E501 - # verify the required parameter 'version' is set - if ('version' not in params or - params['version'] is None): - raise ValueError("Missing the required parameter `version` when calling `execute_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'version' in params: - path_params['version'] = params['version'] # noqa: E501 - - query_params = [] - if 'request_id' in params: - query_params.append(('requestId', params['request_id'])) # noqa: E501 - if 'wait_until_task_ref' in params: - query_params.append(('waitUntilTaskRef', params['wait_until_task_ref'])) # noqa: E501 - if 'wait_for_seconds' in params: - query_params.append(('waitForSeconds', params['wait_for_seconds'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/execute/{name}/{version}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkflowRun', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def execute_workflow_as_api(self, body, name, **kwargs): # noqa: E501 - """Execute a workflow synchronously with input and outputs # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.execute_workflow_as_api(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str name: (required) - :param str request_id: - :param str wait_until_task_ref: - :param int wait_for_seconds: - :param str authorization: - :param int version: - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.execute_workflow_as_api_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.execute_workflow_as_api_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def execute_workflow_as_api_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Execute a workflow synchronously with input and outputs # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.execute_workflow_as_api_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str name: (required) - :param str request_id: - :param str wait_until_task_ref: - :param int wait_for_seconds: - :param str authorization: - :param int version: - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name', 'request_id', 'wait_until_task_ref', 'wait_for_seconds', 'authorization', - 'version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method execute_workflow_as_api" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `execute_workflow_as_api`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `execute_workflow_as_api`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'version' in params: - query_params.append(('version', params['version'])) # noqa: E501 - - header_params = {} - if 'request_id' in params: - header_params['requestId'] = params['request_id'] # noqa: E501 - if 'wait_until_task_ref' in params: - header_params['waitUntilTaskRef'] = params['wait_until_task_ref'] # noqa: E501 - if 'wait_for_seconds' in params: - header_params['waitForSeconds'] = params['wait_for_seconds'] # noqa: E501 - if 'authorization' in params: - header_params['authorization'] = params['authorization'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/execute/{name}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, object)', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def execute_workflow_as_get_api(self, name, **kwargs): # noqa: E501 - """Execute a workflow synchronously with input and outputs using get api # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.execute_workflow_as_get_api(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: - :param str request_id: - :param str wait_until_task_ref: - :param int wait_for_seconds: - :param str authorization: - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.execute_workflow_as_get_api_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.execute_workflow_as_get_api_with_http_info(name, **kwargs) # noqa: E501 - return data - - def execute_workflow_as_get_api_with_http_info(self, name, **kwargs): # noqa: E501 - """Execute a workflow synchronously with input and outputs using get api # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.execute_workflow_as_get_api_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: - :param str request_id: - :param str wait_until_task_ref: - :param int wait_for_seconds: - :param str authorization: - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'version', 'request_id', 'wait_until_task_ref', 'wait_for_seconds', - 'authorization'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method execute_workflow_as_get_api" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError( - "Missing the required parameter `name` when calling `execute_workflow_as_get_api`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'version' in params: - query_params.append(('version', params['version'])) # noqa: E501 - - header_params = {} - if 'request_id' in params: - header_params['requestId'] = params['request_id'] # noqa: E501 - if 'wait_until_task_ref' in params: - header_params['waitUntilTaskRef'] = params['wait_until_task_ref'] # noqa: E501 - if 'wait_for_seconds' in params: - header_params['waitForSeconds'] = params['wait_for_seconds'] # noqa: E501 - if 'authorization' in params: - header_params['authorization'] = params['authorization'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/execute/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, object)', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_execution_status(self, workflow_id, **kwargs): # noqa: E501 - """Gets the workflow by workflow id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_execution_status(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param bool include_tasks: - :param bool summarize: - :return: Workflow - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_execution_status_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.get_execution_status_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def get_execution_status_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Gets the workflow by workflow id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_execution_status_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param bool include_tasks: - :param bool summarize: - :return: Workflow - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id', 'include_tasks', 'summarize'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_execution_status" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError( - "Missing the required parameter `workflow_id` when calling `get_execution_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - if 'include_tasks' in params: - query_params.append(('includeTasks', params['include_tasks'])) # noqa: E501 - if 'summarize' in params: - query_params.append(('summarize', params['summarize'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Workflow', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_execution_status_task_list(self, workflow_id, **kwargs): # noqa: E501 - """Gets the workflow tasks by workflow id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_execution_status_task_list(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param int start: - :param int count: - :param list[str] status: - :return: TaskListSearchResultSummary - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_execution_status_task_list_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.get_execution_status_task_list_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def get_execution_status_task_list_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Gets the workflow tasks by workflow id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_execution_status_task_list_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param int start: - :param int count: - :param list[str] status: - :return: TaskListSearchResultSummary - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id', 'start', 'count', 'status'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_execution_status_task_list" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError( - "Missing the required parameter `workflow_id` when calling `get_execution_status_task_list`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - if 'start' in params: - query_params.append(('start', params['start'])) # noqa: E501 - if 'count' in params: - query_params.append(('count', params['count'])) # noqa: E501 - if 'status' in params: - query_params.append(('status', params['status'])) # noqa: E501 - collection_formats['status'] = 'multi' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/tasks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskListSearchResultSummary', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_running_workflow(self, name, **kwargs): # noqa: E501 - """Retrieve all the running workflows # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_running_workflow(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: - :param int start_time: - :param int end_time: - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_running_workflow_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_running_workflow_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_running_workflow_with_http_info(self, name, **kwargs): # noqa: E501 - """Retrieve all the running workflows # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_running_workflow_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param int version: - :param int start_time: - :param int end_time: - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'version', 'start_time', 'end_time'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_running_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_running_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'version' in params: - query_params.append(('version', params['version'])) # noqa: E501 - if 'start_time' in params: - query_params.append(('startTime', params['start_time'])) # noqa: E501 - if 'end_time' in params: - query_params.append(('endTime', params['end_time'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/running/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[str]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_workflow_status_summary(self, workflow_id, **kwargs): # noqa: E501 - """Gets the workflow by workflow id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflow_status_summary(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param bool include_output: - :param bool include_variables: - :return: WorkflowStatus - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workflow_status_summary_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.get_workflow_status_summary_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def get_workflow_status_summary_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Gets the workflow by workflow id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflow_status_summary_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param bool include_output: - :param bool include_variables: - :return: WorkflowStatus - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id', 'include_output', 'include_variables'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workflow_status_summary" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError( - "Missing the required parameter `workflow_id` when calling `get_workflow_status_summary`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - if 'include_output' in params: - query_params.append(('includeOutput', params['include_output'])) # noqa: E501 - if 'include_variables' in params: - query_params.append(('includeVariables', params['include_variables'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/status', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkflowStatus', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_workflows(self, body, name, **kwargs): # noqa: E501 - """Lists workflows for the given correlation id list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflows(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :param str name: (required) - :param bool include_closed: - :param bool include_tasks: - :return: dict(str, list[Workflow]) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workflows_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.get_workflows_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def get_workflows_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Lists workflows for the given correlation id list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflows_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] body: (required) - :param str name: (required) - :param bool include_closed: - :param bool include_tasks: - :return: dict(str, list[Workflow]) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name', 'include_closed', 'include_tasks'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workflows" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `get_workflows`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_workflows`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'include_closed' in params: - query_params.append(('includeClosed', params['include_closed'])) # noqa: E501 - if 'include_tasks' in params: - query_params.append(('includeTasks', params['include_tasks'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{name}/correlated', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, list[Workflow])', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_workflows_by_correlation_id_in_batch(self, body, **kwargs): # noqa: E501 - """Lists workflows for the given correlation id list and workflow name list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflows_by_correlation_id_in_batch(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CorrelationIdsSearchRequest body: (required) - :param bool include_closed: - :param bool include_tasks: - :return: dict(str, list[Workflow]) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workflows1_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.get_workflows1_with_http_info(body, **kwargs) # noqa: E501 - return data - - def get_workflows_batch(self, body, **kwargs): # noqa: E501 - """ - deprecated:: Please use get_workflows_by_correlation_id_in_batch - Lists workflows for the given correlation id list and workflow name list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflows_by_correlation_id_in_batch(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CorrelationIdsSearchRequest body: (required) - :param bool include_closed: - :param bool include_tasks: - :return: dict(str, list[Workflow]) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workflows1_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.get_workflows1_with_http_info(body, **kwargs) # noqa: E501 - return data - - def get_workflows1_with_http_info(self, body, **kwargs): # noqa: E501 - """Lists workflows for the given correlation id list and workflow name list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflows1_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CorrelationIdsSearchRequest body: (required) - :param bool include_closed: - :param bool include_tasks: - :return: dict(str, list[Workflow]) - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'include_closed', 'include_tasks'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workflows1" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `get_workflows1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'include_closed' in params: - query_params.append(('includeClosed', params['include_closed'])) # noqa: E501 - if 'include_tasks' in params: - query_params.append(('includeTasks', params['include_tasks'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/correlated/batch', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, list[Workflow])', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_workflows2(self, name, correlation_id, **kwargs): # noqa: E501 - """Lists workflows for the given correlation id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflows2(name, correlation_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str correlation_id: (required) - :param bool include_closed: - :param bool include_tasks: - :return: list[Workflow] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workflows2_with_http_info(name, correlation_id, **kwargs) # noqa: E501 - else: - (data) = self.get_workflows2_with_http_info(name, correlation_id, **kwargs) # noqa: E501 - return data - - def get_workflows2_with_http_info(self, name, correlation_id, **kwargs): # noqa: E501 - """Lists workflows for the given correlation id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflows2_with_http_info(name, correlation_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str correlation_id: (required) - :param bool include_closed: - :param bool include_tasks: - :return: list[Workflow] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'correlation_id', 'include_closed', 'include_tasks'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workflows2" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_workflows2`") # noqa: E501 - # verify the required parameter 'correlation_id' is set - if ('correlation_id' not in params or - params['correlation_id'] is None): - raise ValueError( - "Missing the required parameter `correlation_id` when calling `get_workflows2`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'correlation_id' in params: - path_params['correlationId'] = params['correlation_id'] # noqa: E501 - - query_params = [] - if 'include_closed' in params: - query_params.append(('includeClosed', params['include_closed'])) # noqa: E501 - if 'include_tasks' in params: - query_params.append(('includeTasks', params['include_tasks'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{name}/correlated/{correlationId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Workflow]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def jump_to_task(self, body, workflow_id, **kwargs): # noqa: E501 - """Jump workflow execution to given task # noqa: E501 - - Jump workflow execution to given task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jump_to_task(body, workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str workflow_id: (required) - :param str task_reference_name: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.jump_to_task_with_http_info(body, workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.jump_to_task_with_http_info(body, workflow_id, **kwargs) # noqa: E501 - return data - - def jump_to_task_with_http_info(self, body, workflow_id, **kwargs): # noqa: E501 - """Jump workflow execution to given task # noqa: E501 - - Jump workflow execution to given task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jump_to_task_with_http_info(body, workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str workflow_id: (required) - :param str task_reference_name: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workflow_id', 'task_reference_name'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method jump_to_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `jump_to_task`") # noqa: E501 - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `jump_to_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - if 'task_reference_name' in params: - query_params.append(('taskReferenceName', params['task_reference_name'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/jump/{taskReferenceName}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def pause_workflow1(self, workflow_id, **kwargs): # noqa: E501 - """ - deprecated:: Please use pause_workflow(workflow_id) method - Parameters - ---------- - workflow_id - kwargs - - Returns - ------- - - """ - self.pause_workflow(workflow_id) - - def pause_workflow(self, workflow_id, **kwargs): # noqa: E501 - """Pauses the workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.pause_workflow(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.pause_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.pause_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def pause_workflow_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Pauses the workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.pause_workflow_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method pause_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `pause_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/pause', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def rerun(self, body, workflow_id, **kwargs): # noqa: E501 - """Reruns the workflow from a specific task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.rerun(body, workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param RerunWorkflowRequest body: (required) - :param str workflow_id: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.rerun_with_http_info(body, workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.rerun_with_http_info(body, workflow_id, **kwargs) # noqa: E501 - return data - - def rerun_with_http_info(self, body, workflow_id, **kwargs): # noqa: E501 - """Reruns the workflow from a specific task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.rerun_with_http_info(body, workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param RerunWorkflowRequest body: (required) - :param str workflow_id: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workflow_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method rerun" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `rerun`") # noqa: E501 - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `rerun`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['text/plain']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/rerun', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def reset_workflow(self, workflow_id, **kwargs): # noqa: E501 - """Resets callback times of all non-terminal SIMPLE tasks to 0 # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.reset_workflow(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.reset_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.reset_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def reset_workflow_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Resets callback times of all non-terminal SIMPLE tasks to 0 # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.reset_workflow_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method reset_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `reset_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/resetcallbacks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def restart1(self, workflow_id, **kwargs): # noqa: E501 - """ - deprecated:: Please use restart(workflow_id) method - Parameters - ---------- - workflow_id - kwargs - - Returns - ------- - - """ - return self.restart(workflow_id) - - def restart(self, workflow_id, **kwargs): # noqa: E501 - """Restarts a completed workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.restart(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param bool use_latest_definitions: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.restart_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.restart_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def restart_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Restarts a completed workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.restart_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param bool use_latest_definitions: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id', 'use_latest_definitions'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method restart" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `restart`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - if 'use_latest_definitions' in params: - query_params.append(('useLatestDefinitions', params['use_latest_definitions'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/restart', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def resume_workflow1(self, workflow_id): # noqa: E501 - """ - deprecated:: Please use resume_workflow(workflow_id) method - Parameters - ---------- - workflow_id - - Returns - ------- - - """ - return self.resume_workflow(workflow_id) - - def resume_workflow(self, workflow_id, **kwargs): # noqa: E501 - """Resumes the workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.resume_workflow(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.resume_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.resume_workflow_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def resume_workflow_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Resumes the workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.resume_workflow_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method resume_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError( - "Missing the required parameter `workflow_id` when calling `resume_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/resume', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def retry1(self, workflow_id, **kwargs): # noqa: E501 - """ - deprecated:: Please use retry(workflow_id) method - Parameters - ---------- - workflow_id - kwargs - - Returns - ------- - - """ - return self.retry(workflow_id) - - def retry(self, workflow_id, **kwargs): # noqa: E501 - """Retries the last failed task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retry(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param bool resume_subworkflow_tasks: - :param bool retry_if_retried_by_parent: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.retry_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.retry_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def retry_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Retries the last failed task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retry_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param bool resume_subworkflow_tasks: - :param bool retry_if_retried_by_parent: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id', 'resume_subworkflow_tasks', 'retry_if_retried_by_parent'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method retry" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `retry`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - if 'resume_subworkflow_tasks' in params: - query_params.append(('resumeSubworkflowTasks', params['resume_subworkflow_tasks'])) # noqa: E501 - if 'retry_if_retried_by_parent' in params: - query_params.append(('retryIfRetriedByParent', params['retry_if_retried_by_parent'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/retry', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def search(self, **kwargs): # noqa: E501 - """Search for workflows based on payload and other parameters # noqa: E501 - - Search for workflows based on payload and other parameters. The query parameter accepts exact matches using `=` and `IN` on the following fields: `workflowId`, `correlationId`, `taskId`, `workflowType`, `taskType`, and `status`. Matches using `=` can be written as `taskType = HTTP`. Matches using `IN` are written as `status IN (SCHEDULED, IN_PROGRESS)`. The 'startTime' and 'modifiedTime' field uses unix timestamps and accepts queries using `<` and `>`, for example `startTime < 1696143600000`. Queries can be combined using `AND`, for example `taskType = HTTP AND status = SCHEDULED`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str query_id: - :param int start: - :param int size: - :param str free_text: - :param str query: - :param bool skip_cache: - :return: ScrollableSearchResultWorkflowSummary - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.search_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.search_with_http_info(**kwargs) # noqa: E501 - return data - - def search_with_http_info(self, **kwargs): # noqa: E501 - """Search for workflows based on payload and other parameters # noqa: E501 - - Search for workflows based on payload and other parameters. The query parameter accepts exact matches using `=` and `IN` on the following fields: `workflowId`, `correlationId`, `taskId`, `workflowType`, `taskType`, and `status`. Matches using `=` can be written as `taskType = HTTP`. Matches using `IN` are written as `status IN (SCHEDULED, IN_PROGRESS)`. The 'startTime' and 'modifiedTime' field uses unix timestamps and accepts queries using `<` and `>`, for example `startTime < 1696143600000`. Queries can be combined using `AND`, for example `taskType = HTTP AND status = SCHEDULED`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str query_id: - :param int start: - :param int size: - :param str free_text: - :param str query: - :param bool skip_cache: - :return: ScrollableSearchResultWorkflowSummary - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['query_id', 'start', 'size', 'free_text', 'query', 'skip_cache'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method search" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'query_id' in params: - query_params.append(('queryId', params['query_id'])) # noqa: E501 - if 'start' in params: - query_params.append(('start', params['start'])) # noqa: E501 - if 'size' in params: - query_params.append(('size', params['size'])) # noqa: E501 - if 'free_text' in params: - query_params.append(('freeText', params['free_text'])) # noqa: E501 - if 'query' in params: - query_params.append(('query', params['query'])) # noqa: E501 - if 'skip_cache' in params: - query_params.append(('skipCache', params['skip_cache'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/search', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ScrollableSearchResultWorkflowSummary', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def skip_task_from_workflow(self, workflow_id, task_reference_name, skip_task_request, **kwargs): # noqa: E501 - """Skips a given task from a current running workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.skip_task_from_workflow(workflow_id, task_reference_name, skip_task_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param str task_reference_name: (required) - :param SkipTaskRequest skip_task_request: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.skip_task_from_workflow_with_http_info(workflow_id, task_reference_name, skip_task_request, - **kwargs) # noqa: E501 - else: - (data) = self.skip_task_from_workflow_with_http_info(workflow_id, task_reference_name, skip_task_request, - **kwargs) # noqa: E501 - return data - - def skip_task_from_workflow_with_http_info(self, workflow_id, task_reference_name, skip_task_request, - **kwargs): # noqa: E501 - """Skips a given task from a current running workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.skip_task_from_workflow_with_http_info(workflow_id, task_reference_name, skip_task_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param str task_reference_name: (required) - :param SkipTaskRequest skip_task_request: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id', 'task_reference_name', 'skip_task_request'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method skip_task_from_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError( - "Missing the required parameter `workflow_id` when calling `skip_task_from_workflow`") # noqa: E501 - # verify the required parameter 'task_reference_name' is set - if ('task_reference_name' not in params or - params['task_reference_name'] is None): - raise ValueError( - "Missing the required parameter `task_reference_name` when calling `skip_task_from_workflow`") # noqa: E501 - # verify the required parameter 'skip_task_request' is set - if ('skip_task_request' not in params or - params['skip_task_request'] is None): - raise ValueError( - "Missing the required parameter `skip_task_request` when calling `skip_task_from_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - if 'task_reference_name' in params: - path_params['taskReferenceName'] = params['task_reference_name'] # noqa: E501 - - query_params = [] - if 'skip_task_request' in params: - query_params.append(('skipTaskRequest', params['skip_task_request'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/skiptask/{taskReferenceName}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def start_workflow(self, body, **kwargs): # noqa: E501 - """Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.start_workflow(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param StartWorkflowRequest body: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.start_workflow_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.start_workflow_with_http_info(body, **kwargs) # noqa: E501 - return data - - def start_workflow_with_http_info(self, body, **kwargs): # noqa: E501 - """Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.start_workflow_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param StartWorkflowRequest body: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method start_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `start_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['text/plain']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def start_workflow1(self, body, name, **kwargs): # noqa: E501 - """Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.start_workflow1(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str name: (required) - :param int version: - :param str correlation_id: - :param int priority: - :return: str - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.start_workflow1_with_http_info(body, name, **kwargs) # noqa: E501 - else: - (data) = self.start_workflow1_with_http_info(body, name, **kwargs) # noqa: E501 - return data - - def start_workflow1_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.start_workflow1_with_http_info(body, name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str name: (required) - :param int version: - :param str correlation_id: - :param int priority: - :return: str - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name', 'version', 'correlation_id', 'priority'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method start_workflow1" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `start_workflow1`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `start_workflow1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'version' in params: - query_params.append(('version', params['version'])) # noqa: E501 - if 'correlation_id' in params: - query_params.append(('correlationId', params['correlation_id'])) # noqa: E501 - if 'priority' in params: - query_params.append(('priority', params['priority'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['text/plain']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{name}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def terminate1(self, workflow_id, **kwargs): # noqa: E501 - """ - deprecated:: Please use terminate(workflow_id) method - Parameters - ---------- - workflow_id - kwargs - - Returns - ------- - - """ - options = {} - if 'triggerFailureWorkflow' in kwargs.keys(): - options['trigger_failure_workflow'] = kwargs['triggerFailureWorkflow'] - - return self.terminate(workflow_id, **options) - - def terminate(self, workflow_id, **kwargs): # noqa: E501 - """Terminate workflow execution # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.terminate1(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param str reason: - :param bool trigger_failure_workflow: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if workflow_id is None: - raise Exception('Missing workflow id') - if kwargs.get('async_req'): - return self.terminate1_with_http_info(workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.terminate1_with_http_info(workflow_id, **kwargs) # noqa: E501 - return data - - def terminate1_with_http_info(self, workflow_id, **kwargs): # noqa: E501 - """Terminate workflow execution # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.terminate1_with_http_info(workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workflow_id: (required) - :param str reason: - :param bool trigger_failure_workflow: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workflow_id', 'reason', 'trigger_failure_workflow'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method terminate1" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `terminate1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - if 'reason' in params: - query_params.append(('reason', params['reason'])) # noqa: E501 - if 'trigger_failure_workflow' in params: - query_params.append(('triggerFailureWorkflow', params['trigger_failure_workflow'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_workflow(self, body, **kwargs): # noqa: E501 - """Test workflow execution using mock data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_workflow(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkflowTestRequest body: (required) - :return: Workflow - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_workflow_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.test_workflow_with_http_info(body, **kwargs) # noqa: E501 - return data - - def test_workflow_with_http_info(self, body, **kwargs): # noqa: E501 - """Test workflow execution using mock data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_workflow_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkflowTestRequest body: (required) - :return: Workflow - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method test_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/test', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Workflow', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_workflow_state(self, body, workflow_id, **kwargs): # noqa: E501 - """Update workflow variables # noqa: E501 - - Updates the workflow variables and triggers evaluation. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_workflow_state(body, workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str workflow_id: (required) - :return: Workflow - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_workflow_state_with_http_info(body, workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.update_workflow_state_with_http_info(body, workflow_id, **kwargs) # noqa: E501 - return data - - def update_workflow_state_with_http_info(self, body, workflow_id, **kwargs): # noqa: E501 - """Update workflow variables # noqa: E501 - - Updates the workflow variables and triggers evaluation. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_workflow_state_with_http_info(body, workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param dict(str, object) body: (required) - :param str workflow_id: (required) - :return: Workflow - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workflow_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_workflow_state" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_workflow_state`") # noqa: E501 - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError( - "Missing the required parameter `workflow_id` when calling `update_workflow_state`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/variables', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Workflow', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def upgrade_running_workflow_to_version(self, body, workflow_id, **kwargs): # noqa: E501 - """Upgrade running workflow to newer version # noqa: E501 - - Upgrade running workflow to newer version # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upgrade_running_workflow_to_version(body, workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param UpgradeWorkflowRequest body: (required) - :param str workflow_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.upgrade_running_workflow_to_version_with_http_info(body, workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.upgrade_running_workflow_to_version_with_http_info(body, workflow_id, **kwargs) # noqa: E501 - return data - - def upgrade_running_workflow_to_version_with_http_info(self, body, workflow_id, **kwargs): # noqa: E501 - """Upgrade running workflow to newer version # noqa: E501 - - Upgrade running workflow to newer version # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upgrade_running_workflow_to_version_with_http_info(body, workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param UpgradeWorkflowRequest body: (required) - :param str workflow_id: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workflow_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method upgrade_running_workflow_to_version" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError( - "Missing the required parameter `body` when calling `upgrade_running_workflow_to_version`") # noqa: E501 - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError( - "Missing the required parameter `workflow_id` when calling `upgrade_running_workflow_to_version`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/upgrade', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_workflow_and_task_state(self, update_requesst, workflow_id, **kwargs): # noqa: E501 - request_id = str(uuid.uuid4()) - """Update a workflow state by updating variables or in progress task # noqa: E501 - - Updates the workflow variables, tasks and triggers evaluation. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_workflow_and_task_state(update_requesst, request_id, workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkflowStateUpdate body: (required) - :param str request_id: (required) - :param str workflow_id: (required) - :param str wait_until_task_ref: - :param int wait_for_seconds: - :return: WorkflowRun - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_workflow_and_task_state_with_http_info(update_requesst, request_id, workflow_id, **kwargs) # noqa: E501 - else: - (data) = self.update_workflow_and_task_state_with_http_info(update_requesst, request_id, workflow_id, **kwargs) # noqa: E501 - return data - - def update_workflow_and_task_state_with_http_info(self, body, request_id, workflow_id, **kwargs): # noqa: E501 - """Update a workflow state by updating variables or in progress task # noqa: E501 - - Updates the workflow variables, tasks and triggers evaluation. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_workflow_and_task_state_with_http_info(body, request_id, workflow_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkflowStateUpdate body: (required) - :param str request_id: (required) - :param str workflow_id: (required) - :param str wait_until_task_ref: - :param int wait_for_seconds: - :return: WorkflowRun - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'request_id', 'workflow_id', 'wait_until_task_ref', 'wait_for_seconds'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_workflow_and_task_state" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_workflow_and_task_state`") # noqa: E501 - # verify the required parameter 'request_id' is set - if ('request_id' not in params or - params['request_id'] is None): - raise ValueError("Missing the required parameter `request_id` when calling `update_workflow_and_task_state`") # noqa: E501 - # verify the required parameter 'workflow_id' is set - if ('workflow_id' not in params or - params['workflow_id'] is None): - raise ValueError("Missing the required parameter `workflow_id` when calling `update_workflow_and_task_state`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workflow_id' in params: - path_params['workflowId'] = params['workflow_id'] # noqa: E501 - - query_params = [] - if 'request_id' in params: - query_params.append(('requestId', params['request_id'])) # noqa: E501 - if 'wait_until_task_ref' in params: - query_params.append(('waitUntilTaskRef', params['wait_until_task_ref'])) # noqa: E501 - if 'wait_for_seconds' in params: - query_params.append(('waitForSeconds', params['wait_for_seconds'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/{workflowId}/state', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkflowRun', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def execute_workflow_with_return_strategy(self, body, name, version, **kwargs): # noqa: E501 - """Execute a workflow synchronously with reactive response # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.execute_workflow_with_return_strategy(body,name,version) - >>> result = thread.get() - :param async_req bool - :param StartWorkflowRequest body: (required) - :param str name: (required) - :param int version: (required) - :param str request_id: - :param str wait_until_task_ref: - :param int wait_for_seconds: - :param str consistency: DURABLE or EVENTUAL - :param str return_strategy: TARGET_WORKFLOW or WAIT_WORKFLOW - :return: WorkflowRun - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.execute_workflow_with_return_strategy_with_http_info(body, name, version, **kwargs) # noqa: E501 - else: - (data) = self.execute_workflow_with_return_strategy_with_http_info(body, name, version, **kwargs) # noqa: E501 - return data - - def execute_workflow_with_return_strategy_with_http_info(self, body, name, version, **kwargs): # noqa: E501 - """Execute a workflow synchronously with reactive response # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.execute_workflow_with_return_strategy_with_http_info(body, name, version, async_req=True) - >>> result = thread.get() - :param async_req bool - :param StartWorkflowRequest body: (required) - :param str name: (required) - :param int version: (required) - :param str request_id: - :param str wait_until_task_ref: - :param int wait_for_seconds: - :param str consistency: DURABLE or EVENTUAL - :param str return_strategy: TARGET_WORKFLOW or WAIT_WORKFLOW - :return: WorkflowRun - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'name', 'version', 'request_id', 'wait_until_task_ref', 'wait_for_seconds', 'consistency', - 'return_strategy', 'async_req', '_return_http_data_only', '_preload_content', - '_request_timeout'] # noqa: E501 - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method execute_workflow" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `execute_workflow`") # noqa: E501 - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `execute_workflow`") # noqa: E501 - # verify the required parameter 'version' is set - if ('version' not in params or - params['version'] is None): - raise ValueError("Missing the required parameter `version` when calling `execute_workflow`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - if 'version' in params: - path_params['version'] = params['version'] # noqa: E501 - - query_params = [] - if 'request_id' in params: - query_params.append(('requestId', params['request_id'])) # noqa: E501 - if 'wait_until_task_ref' in params: - query_params.append(('waitUntilTaskRef', params['wait_until_task_ref'])) # noqa: E501 - if 'wait_for_seconds' in params: - query_params.append(('waitForSeconds', params['wait_for_seconds'])) # noqa: E501 - if 'consistency' in params: - query_params.append(('consistency', params['consistency'])) # noqa: E501 - if 'return_strategy' in params: - query_params.append(('returnStrategy', params['return_strategy'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/workflow/execute/{name}/{version}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SignalResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) \ No newline at end of file +__all__ = ["WorkflowResourceApi"] diff --git a/src/conductor/client/http/api_client.py b/src/conductor/client/http/api_client.py index 5b641375..0577e581 100644 --- a/src/conductor/client/http/api_client.py +++ b/src/conductor/client/http/api_client.py @@ -1,737 +1,7 @@ -import datetime -import logging -import mimetypes -import os -import re -import tempfile -import time -from typing import Dict -import uuid +from conductor.client.adapters.api_client_adapter import ApiClientAdapter +from conductor.client.adapters.rest_adapter import RESTClientObjectAdapter -import six -import urllib3 -from requests.structures import CaseInsensitiveDict -from six.moves.urllib.parse import quote +ApiClient = ApiClientAdapter +RESTClientObject = RESTClientObjectAdapter -import conductor.client.http.models as http_models -from conductor.client.configuration.configuration import Configuration -from conductor.client.http import rest -from conductor.client.http.rest import AuthorizationException -from conductor.client.http.thread import AwaitableThread - -logger = logging.getLogger( - Configuration.get_logging_formatted_name( - __name__ - ) -) - - -class ApiClient(object): - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - - def __init__( - self, - configuration=None, - header_name=None, - header_value=None, - cookie=None - ): - if configuration is None: - configuration = Configuration() - self.configuration = configuration - - self.rest_client = rest.RESTClientObject(connection=configuration.http_connection) - - self.default_headers = self.__get_default_headers( - header_name, header_value - ) - - self.cookie = cookie - self.__refresh_auth_token() - - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None): - try: - return self.__call_api_no_retry( - resource_path=resource_path, method=method, path_params=path_params, - query_params=query_params, header_params=header_params, body=body, post_params=post_params, - files=files, response_type=response_type, auth_settings=auth_settings, - _return_http_data_only=_return_http_data_only, collection_formats=collection_formats, - _preload_content=_preload_content, _request_timeout=_request_timeout - ) - except AuthorizationException as ae: - if ae.token_expired or ae.invalid_token: - token_status = "expired" if ae.token_expired else "invalid" - logger.warning( - f'authentication token is {token_status}, refreshing the token. request= {method} {resource_path}') - # if the token has expired or is invalid, lets refresh the token - self.__force_refresh_auth_token() - # and now retry the same request - return self.__call_api_no_retry( - resource_path=resource_path, method=method, path_params=path_params, - query_params=query_params, header_params=header_params, body=body, post_params=post_params, - files=files, response_type=response_type, auth_settings=auth_settings, - _return_http_data_only=_return_http_data_only, collection_formats=collection_formats, - _preload_content=_preload_content, _request_timeout=_request_timeout - ) - raise ae - - def __call_api_no_retry( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = self.prepare_post_parameters(post_params, files) - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - - # auth setting - auth_headers = None - if self.configuration.authentication_settings is not None and resource_path != '/token': - auth_headers = self.__get_authentication_headers() - self.update_params_for_auth( - header_params, - query_params, - auth_headers - ) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - url = self.configuration.host + resource_path - - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - - self.last_response = response_data - - return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is swagger model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - elif isinstance(obj, uuid.UUID): # needed for compatibility with Python 3.7 - return str(obj) # Convert UUID to string - - if isinstance(obj, dict) or isinstance(obj, CaseInsensitiveDict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `swagger_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - if hasattr(obj, 'attribute_map') and hasattr(obj, 'swagger_types'): - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.swagger_types) - if getattr(obj, attr) is not None} - else: - try: - obj_dict = {name: getattr(obj, name) - for name in vars(obj) - if getattr(obj, name) is not None} - except TypeError: - # Fallback to string representation. - return str(obj) - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = response.resp.json() - except Exception: - data = response.resp.text - - try: - return self.__deserialize(data, response_type) - except ValueError as e: - logger.error(f'failed to deserialize data {data} into class {response_type}, reason: {e}') - return None - - def deserialize_class(self, data, klass): - return self.__deserialize(data, klass) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if isinstance(klass, str): - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('set['): - sub_kls = re.match(r'set\[(.*)\]', klass).group(1) - return set(self.__deserialize(sub_data, sub_kls) - for sub_data in data) - - if klass.startswith('dict('): - sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in six.iteritems(data)} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(http_models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass is object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datatime(data) - else: - return self.__deserialize_model(data, klass) - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout) - thread = AwaitableThread( - target=self.__call_api, - args=( - resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout - ) - ) - thread.start() - return thread - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def prepare_post_parameters(self, post_params=None, files=None): - """Builds form parameters. - - :param post_params: Normal form parameters. - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if post_params: - params = post_params - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, querys, auth_settings): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - """ - if not auth_settings: - return - - if 'header' in auth_settings: - for key, value in auth_settings['header'].items(): - headers[key] = value - if 'query' in auth_settings: - for key, value in auth_settings['query'].items(): - querys[key] = value - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - response_data = response.data - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - else: - f.write(response_data) - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - if klass is str and isinstance(data, bytes): - return self.__deserialize_bytes_to_str(data) - return klass(data) - except UnicodeEncodeError: - return six.text_type(data) - except TypeError: - return data - - def __deserialize_bytes_to_str(self, data): - return data.decode('utf-8') - - def __deserialize_object(self, value): - """Return a original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - from dateutil.parser import parse - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datatime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - from dateutil.parser import parse - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __hasattr(self, object, name): - return name in object.__class__.__dict__ - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): - return data - - kwargs = {} - if klass.swagger_types is not None: - for attr, attr_type in six.iteritems(klass.swagger_types): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - instance = klass(**kwargs) - - if (isinstance(instance, dict) and - klass.swagger_types is not None and - isinstance(data, dict)): - for key, value in data.items(): - if key not in klass.swagger_types: - instance[key] = value - if self.__hasattr(instance, 'get_real_child_model'): - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance - - def __get_authentication_headers(self): - if self.configuration.AUTH_TOKEN is None: - return None - - now = round(time.time() * 1000) - time_since_last_update = now - self.configuration.token_update_time - - if time_since_last_update > self.configuration.auth_token_ttl_msec: - # time to refresh the token - logger.debug('refreshing authentication token') - token = self.__get_new_token() - self.configuration.update_token(token) - - return { - 'header': { - 'X-Authorization': self.configuration.AUTH_TOKEN - } - } - - def __refresh_auth_token(self) -> None: - if self.configuration.AUTH_TOKEN is not None: - return - if self.configuration.authentication_settings is None: - return - token = self.__get_new_token() - self.configuration.update_token(token) - - def __force_refresh_auth_token(self) -> None: - """ - Forces the token refresh. Unlike the __refresh_auth_token method above - """ - if self.configuration.authentication_settings is None: - return - token = self.__get_new_token() - self.configuration.update_token(token) - - def __get_new_token(self) -> str: - try: - if self.configuration.authentication_settings.key_id is None or self.configuration.authentication_settings.key_secret is None: - logger.error('Authentication Key or Secret is not set. Failed to get the auth token') - return None - - logger.debug('Requesting new authentication token from server') - response = self.call_api( - '/token', 'POST', - header_params={ - 'Content-Type': self.select_header_content_type(['*/*']) - }, - body={ - 'keyId': self.configuration.authentication_settings.key_id, - 'keySecret': self.configuration.authentication_settings.key_secret - }, - _return_http_data_only=True, - response_type='Token' - ) - return response.token - except Exception as e: - logger.error(f'Failed to get new token, reason: {e.args}') - return None - - def __get_default_headers(self, header_name: str, header_value: object) -> Dict[str, object]: - headers = { - 'Accept-Encoding': 'gzip', - } - if header_name is not None: - headers[header_name] = header_value - parsed = urllib3.util.parse_url(self.configuration.host) - if parsed.auth is not None: - encrypted_headers = urllib3.util.make_headers( - basic_auth=parsed.auth - ) - for key, value in encrypted_headers.items(): - headers[key] = value - return headers +__all__ = ["ApiClient", "RESTClientObject"] diff --git a/src/conductor/client/http/models/__init__.py b/src/conductor/client/http/models/__init__.py index 621d03cb..6aeced86 100644 --- a/src/conductor/client/http/models/__init__.py +++ b/src/conductor/client/http/models/__init__.py @@ -1,64 +1,406 @@ -from conductor.client.http.models.action import Action -from conductor.client.http.models.authorization_request import AuthorizationRequest -from conductor.client.http.models.bulk_response import BulkResponse -from conductor.client.http.models.conductor_application import ConductorApplication -from conductor.client.http.models.conductor_user import ConductorUser -from conductor.client.http.models.create_or_update_application_request import CreateOrUpdateApplicationRequest -from conductor.client.http.models.event_handler import EventHandler -from conductor.client.http.models.external_storage_location import ExternalStorageLocation -from conductor.client.http.models.generate_token_request import GenerateTokenRequest -from conductor.client.http.models.group import Group -from conductor.client.http.models.permission import Permission -from conductor.client.http.models.poll_data import PollData -from conductor.client.http.models.prompt_template import PromptTemplate -from conductor.client.http.models.rate_limit import RateLimit -from conductor.client.http.models.rerun_workflow_request import RerunWorkflowRequest -from conductor.client.http.models.response import Response -from conductor.client.http.models.role import Role +from conductor.client.http.models.action import \ + Action +from conductor.client.http.models.any import Any +from conductor.client.http.models.authorization_request import \ + AuthorizationRequest +from conductor.client.http.models.bulk_response import \ + BulkResponse +from conductor.client.http.models.byte_string import \ + ByteString +from conductor.client.http.models.cache_config import \ + CacheConfig +from conductor.client.http.models.conductor_user import \ + ConductorUser +from conductor.client.http.models.connectivity_test_input import \ + ConnectivityTestInput +from conductor.client.http.models.connectivity_test_result import \ + ConnectivityTestResult +from conductor.client.http.models.correlation_ids_search_request import \ + CorrelationIdsSearchRequest +from conductor.client.http.models.create_or_update_application_request import \ + CreateOrUpdateApplicationRequest +from conductor.client.http.models.declaration import \ + Declaration +from conductor.client.http.models.declaration_or_builder import \ + DeclarationOrBuilder +from conductor.client.http.models.descriptor import \ + Descriptor +from conductor.client.http.models.descriptor_proto import \ + DescriptorProto +from conductor.client.http.models.descriptor_proto_or_builder import \ + DescriptorProtoOrBuilder +from conductor.client.http.models.edition_default import \ + EditionDefault +from conductor.client.http.models.edition_default_or_builder import \ + EditionDefaultOrBuilder +from conductor.client.http.models.enum_descriptor import \ + EnumDescriptor +from conductor.client.http.models.enum_descriptor_proto import \ + EnumDescriptorProto +from conductor.client.http.models.enum_descriptor_proto_or_builder import \ + EnumDescriptorProtoOrBuilder +from conductor.client.http.models.enum_options import \ + EnumOptions +from conductor.client.http.models.enum_options_or_builder import \ + EnumOptionsOrBuilder +from conductor.client.http.models.enum_reserved_range import \ + EnumReservedRange +from conductor.client.http.models.enum_reserved_range_or_builder import \ + EnumReservedRangeOrBuilder +from conductor.client.http.models.enum_value_descriptor import \ + EnumValueDescriptor +from conductor.client.http.models.enum_value_descriptor_proto import \ + EnumValueDescriptorProto +from conductor.client.http.models.enum_value_descriptor_proto_or_builder import \ + EnumValueDescriptorProtoOrBuilder +from conductor.client.http.models.enum_value_options import \ + EnumValueOptions +from conductor.client.http.models.enum_value_options_or_builder import \ + EnumValueOptionsOrBuilder +from conductor.client.http.models.environment_variable import \ + EnvironmentVariable +from conductor.client.http.models.event_handler import \ + EventHandler +from conductor.client.http.models.event_log import \ + EventLog +from conductor.client.http.models.extended_conductor_application import \ + ExtendedConductorApplication +from conductor.client.http.models.extended_conductor_application import \ + ExtendedConductorApplication as ConductorApplication +from conductor.client.http.models.extended_event_execution import \ + ExtendedEventExecution +from conductor.client.http.models.extended_secret import \ + ExtendedSecret +from conductor.client.http.models.extended_task_def import \ + ExtendedTaskDef +from conductor.client.http.models.extended_workflow_def import \ + ExtendedWorkflowDef +from conductor.client.http.models.extension_range import \ + ExtensionRange +from conductor.client.http.models.extension_range_options import \ + ExtensionRangeOptions +from conductor.client.http.models.extension_range_options_or_builder import \ + ExtensionRangeOptionsOrBuilder +from conductor.client.http.models.extension_range_or_builder import \ + ExtensionRangeOrBuilder +from conductor.client.http.models.feature_set import \ + FeatureSet +from conductor.client.http.models.feature_set_or_builder import \ + FeatureSetOrBuilder +from conductor.client.http.models.field_descriptor import \ + FieldDescriptor +from conductor.client.http.models.field_descriptor_proto import \ + FieldDescriptorProto +from conductor.client.http.models.field_descriptor_proto_or_builder import \ + FieldDescriptorProtoOrBuilder +from conductor.client.http.models.field_options import \ + FieldOptions +from conductor.client.http.models.field_options_or_builder import \ + FieldOptionsOrBuilder +from conductor.client.http.models.file_descriptor import \ + FileDescriptor +from conductor.client.http.models.file_descriptor_proto import \ + FileDescriptorProto +from conductor.client.http.models.file_options import \ + FileOptions +from conductor.client.http.models.file_options_or_builder import \ + FileOptionsOrBuilder +from conductor.client.http.models.generate_token_request import \ + GenerateTokenRequest +from conductor.client.http.models.granted_access import \ + GrantedAccess +from conductor.client.http.models.granted_access_response import \ + GrantedAccessResponse +from conductor.client.http.models.group import \ + Group +from conductor.client.http.models.handled_event_response import \ + HandledEventResponse +from conductor.client.http.models.integration import \ + Integration +from conductor.client.http.models.integration_api import \ + IntegrationApi +from conductor.client.http.models.integration_api_update import \ + IntegrationApiUpdate +from conductor.client.http.models.integration_def import \ + IntegrationDef +from conductor.client.http.models.integration_def_form_field import \ + IntegrationDefFormField +from conductor.client.http.models.integration_update import \ + IntegrationUpdate +from conductor.client.http.models.location import \ + Location +from conductor.client.http.models.location_or_builder import \ + LocationOrBuilder +from conductor.client.http.models.message import \ + Message +from conductor.client.http.models.message_lite import \ + MessageLite +from conductor.client.http.models.message_options import \ + MessageOptions +from conductor.client.http.models.message_options_or_builder import \ + MessageOptionsOrBuilder +from conductor.client.http.models.message_template import \ + MessageTemplate +from conductor.client.http.models.method_descriptor import \ + MethodDescriptor +from conductor.client.http.models.method_descriptor_proto import \ + MethodDescriptorProto +from conductor.client.http.models.method_descriptor_proto_or_builder import \ + MethodDescriptorProtoOrBuilder +from conductor.client.http.models.method_options import \ + MethodOptions +from conductor.client.http.models.method_options_or_builder import \ + MethodOptionsOrBuilder +from conductor.client.http.models.metrics_token import \ + MetricsToken +from conductor.client.http.models.name_part import \ + NamePart +from conductor.client.http.models.name_part_or_builder import \ + NamePartOrBuilder +from conductor.client.http.models.oneof_descriptor import \ + OneofDescriptor +from conductor.client.http.models.oneof_descriptor_proto import \ + OneofDescriptorProto +from conductor.client.http.models.oneof_descriptor_proto_or_builder import \ + OneofDescriptorProtoOrBuilder +from conductor.client.http.models.oneof_options import \ + OneofOptions +from conductor.client.http.models.oneof_options_or_builder import \ + OneofOptionsOrBuilder +from conductor.client.http.models.option import \ + Option +from conductor.client.http.models.permission import \ + Permission +from conductor.client.http.models.poll_data import \ + PollData +from conductor.client.http.models.prompt_template_test_request import \ + PromptTemplateTestRequest +from conductor.client.http.models.rate_limit import \ + RateLimit +from conductor.client.http.models.rerun_workflow_request import \ + RerunWorkflowRequest +from conductor.client.http.models.response import \ + Response +from conductor.client.http.models.service_method import ServiceMethod +from conductor.client.http.models.task import Task +from conductor.client.http.models.task_result import \ + TaskResult +from conductor.client.http.models.workflow_task import \ + WorkflowTask +from conductor.client.http.models.upsert_user_request import \ + UpsertUserRequest +from conductor.client.http.models.prompt_template import \ + PromptTemplate +from conductor.client.http.models.workflow_schedule import \ + WorkflowSchedule +from conductor.client.http.models.workflow_tag import \ + WorkflowTag +from conductor.client.http.models.role import \ + Role +from conductor.client.http.models.token import \ + Token +from conductor.client.http.models.tag import \ + Tag +from conductor.client.http.models.upsert_group_request import \ + UpsertGroupRequest +from conductor.client.http.models.target_ref import \ + TargetRef +from conductor.client.http.models.subject_ref import \ + SubjectRef +from conductor.client.http.models.task_def import \ + TaskDef +from conductor.client.http.models.workflow_def import \ + WorkflowDef +from conductor.client.http.models.sub_workflow_params import \ + SubWorkflowParams +from conductor.client.http.models.state_change_event import \ + StateChangeEvent, StateChangeEventType, StateChangeConfig +from conductor.client.http.models.task_exec_log import \ + TaskExecLog +from conductor.client.http.models.workflow import \ + Workflow +from conductor.client.http.models.schema_def import \ + SchemaDef, SchemaType +from conductor.client.http.models.rate_limit_config import \ + RateLimitConfig +from conductor.client.http.models.start_workflow_request import \ + StartWorkflowRequest +from conductor.client.http.models.workflow_schedule_model import \ + WorkflowScheduleModel +from conductor.client.http.models.search_result_workflow_schedule_execution_model import \ + SearchResultWorkflowScheduleExecutionModel +from conductor.client.http.models.workflow_schedule_execution_model import \ + WorkflowScheduleExecutionModel +from conductor.client.http.models.workflow_run import \ + WorkflowRun +from conductor.client.http.models.signal_response import \ + SignalResponse +from conductor.client.http.models.workflow_status import \ + WorkflowStatus +from conductor.client.http.models.scrollable_search_result_workflow_summary import \ + ScrollableSearchResultWorkflowSummary +from conductor.client.http.models.workflow_summary import \ + WorkflowSummary +from conductor.client.http.models.integration_def_api import \ + IntegrationDefApi +from conductor.client.http.models.service_registry import \ + ServiceRegistry, Config, OrkesCircuitBreakerConfig +from conductor.client.http.models.service_method import ServiceMethod +from conductor.client.http.models.request_param import RequestParam, Schema +from conductor.client.http.models.health_check_status import HealthCheckStatus +from conductor.client.http.models.health import Health +from conductor.client.http.models.skip_task_request import SkipTaskRequest from conductor.client.http.models.save_schedule_request import SaveScheduleRequest -from conductor.client.http.models.scrollable_search_result_workflow_summary import ScrollableSearchResultWorkflowSummary from conductor.client.http.models.search_result_task import SearchResultTask from conductor.client.http.models.search_result_task_summary import SearchResultTaskSummary -from conductor.client.http.models.search_result_workflow import SearchResultWorkflow -from conductor.client.http.models.search_result_workflow_schedule_execution_model import \ - SearchResultWorkflowScheduleExecutionModel from conductor.client.http.models.search_result_workflow_summary import SearchResultWorkflowSummary -from conductor.client.http.models.skip_task_request import SkipTaskRequest from conductor.client.http.models.start_workflow import StartWorkflow -from conductor.client.http.models.start_workflow_request import StartWorkflowRequest, IdempotencyStrategy -from conductor.client.http.models.sub_workflow_params import SubWorkflowParams -from conductor.client.http.models.subject_ref import SubjectRef -from conductor.client.http.models.tag_object import TagObject -from conductor.client.http.models.tag_string import TagString -from conductor.client.http.models.target_ref import TargetRef -from conductor.client.http.models.workflow_task import WorkflowTask -from conductor.client.http.models.task import Task -from conductor.client.http.models.task_def import TaskDef -from conductor.client.http.models.task_details import TaskDetails -from conductor.client.http.models.task_exec_log import TaskExecLog -from conductor.client.http.models.task_result import TaskResult -from conductor.client.http.models.task_summary import TaskSummary -from conductor.client.http.models.token import Token -from conductor.client.http.models.upsert_group_request import UpsertGroupRequest -from conductor.client.http.models.upsert_user_request import UpsertUserRequest -from conductor.client.http.models.workflow import Workflow -from conductor.client.http.models.workflow_def import WorkflowDef -from conductor.client.http.models.workflow_run import WorkflowRun -from conductor.client.http.models.workflow_schedule import WorkflowSchedule -from conductor.client.http.models.workflow_schedule_execution_model import WorkflowScheduleExecutionModel -from conductor.client.http.models.workflow_status import WorkflowStatus -from conductor.client.http.models.workflow_state_update import WorkflowStateUpdate -from conductor.client.http.models.workflow_summary import WorkflowSummary -from conductor.client.http.models.workflow_tag import WorkflowTag -from conductor.client.http.models.integration import Integration -from conductor.client.http.models.integration_api import IntegrationApi -from conductor.client.http.models.state_change_event import StateChangeEvent, StateChangeConfig, StateChangeEventType -from conductor.client.http.models.workflow_task import CacheConfig -from conductor.client.http.models.schema_def import SchemaDef -from conductor.client.http.models.schema_def import SchemaType -from conductor.client.http.models.service_registry import ServiceRegistry, OrkesCircuitBreakerConfig, Config, ServiceType -from conductor.client.http.models.request_param import RequestParam, Schema -from conductor.client.http.models.proto_registry_entry import ProtoRegistryEntry -from conductor.client.http.models.service_method import ServiceMethod -from conductor.client.http.models.circuit_breaker_transition_response import CircuitBreakerTransitionResponse -from conductor.client.http.models.signal_response import SignalResponse, TaskStatus +from conductor.shared.http.enums.idempotency_strategy import IdempotencyStrategy +from conductor.client.http.models.task_result_status import TaskResultStatus + +__all__ = [ # noqa: RUF022 + "Action", + "Any", + "AuthorizationRequest", + "BulkResponse", + "ByteString", + "CacheConfig", + "ConductorUser", + "ConnectivityTestInput", + "ConnectivityTestResult", + "CorrelationIdsSearchRequest", + "CreateOrUpdateApplicationRequest", + "Declaration", + "DeclarationOrBuilder", + "Descriptor", + "DescriptorProto", + "DescriptorProtoOrBuilder", + "EditionDefault", + "EditionDefaultOrBuilder", + "EnumDescriptor", + "EnumDescriptorProto", + "EnumDescriptorProtoOrBuilder", + "EnumOptions", + "EnumOptionsOrBuilder", + "EnumReservedRange", + "EnumReservedRangeOrBuilder", + "EnumValueDescriptor", + "EnumValueDescriptorProto", + "EnumValueDescriptorProtoOrBuilder", + "EnumValueOptions", + "EnumValueOptions", + "EnumValueOptionsOrBuilder", + "EnvironmentVariable", + "EventHandler", + "EventLog", + "ExtendedConductorApplication", + "ConductorApplication", + "ExtendedEventExecution", + "ExtendedSecret", + "ExtendedTaskDef", + "ExtendedWorkflowDef", + "ExtensionRange", + "ExtensionRangeOptions", + "ExtensionRangeOptionsOrBuilder", + "ExtensionRangeOrBuilder", + "FeatureSet", + "FeatureSet", + "FeatureSetOrBuilder", + "FieldDescriptor", + "FieldDescriptorProto", + "FieldDescriptorProtoOrBuilder", + "FieldOptions", + "FieldOptionsOrBuilder", + "FileDescriptor", + "FileDescriptorProto", + "FileOptions", + "FileOptionsOrBuilder", + "GenerateTokenRequest", + "GrantedAccess", + "GrantedAccessResponse", + "Group", + "HandledEventResponse", + "Integration", + "IntegrationApi", + "IntegrationApiUpdate", + "IntegrationDef", + "IntegrationDefFormField", + "IntegrationUpdate", + "Location", + "LocationOrBuilder", + "Message", + "MessageLite", + "MessageOptions", + "MessageOptionsOrBuilder", + "MessageTemplate", + "MethodDescriptor", + "MethodDescriptorProto", + "MethodDescriptorProtoOrBuilder", + "MethodOptions", + "MethodOptionsOrBuilder", + "MetricsToken", + "NamePart", + "NamePartOrBuilder", + "OneofDescriptor", + "OneofDescriptorProto", + "OneofDescriptorProtoOrBuilder", + "OneofOptions", + "OneofOptionsOrBuilder", + "Option", + "Permission", + "PollData", + "PromptTemplateTestRequest", + "RateLimit", + "RerunWorkflowRequest", + "Response", + "Task", + "TaskResult", + "WorkflowTask", + "UpsertUserRequest", + "PromptTemplate", + "WorkflowSchedule", + "WorkflowTag", + "Role", + "Token", + "Tag", + "UpsertGroupRequest", + "TargetRef", + "SubjectRef", + "TaskDef", + "WorkflowDef", + "SubWorkflowParams", + "StateChangeEvent", + "TaskExecLog", + "Workflow", + "SchemaDef", + "RateLimitConfig", + "StartWorkflowRequest", + "WorkflowScheduleModel", + "SearchResultWorkflowScheduleExecutionModel", + "WorkflowScheduleExecutionModel", + "WorkflowRun", + "SignalResponse", + "WorkflowStatus", + "ScrollableSearchResultWorkflowSummary", + "WorkflowSummary", + "IntegrationDefApi", + "ServiceRegistry", + "Config", + "OrkesCircuitBreakerConfig", + "ServiceMethod", + "RequestParam", + "Schema", + "SchemaType", + "HealthCheckStatus", + "Health", + "SkipTaskRequest", + "SaveScheduleRequest", + "SearchResultTask", + "SearchResultTaskSummary", + "SearchResultWorkflowSummary", + "StartWorkflow", + "IdempotencyStrategy", + "StateChangeEventType", + "StateChangeConfig", + "TaskResultStatus", +] diff --git a/src/conductor/client/http/models/action.py b/src/conductor/client/http/models/action.py index 7968ae9e..39fb4900 100644 --- a/src/conductor/client/http/models/action.py +++ b/src/conductor/client/http/models/action.py @@ -1,299 +1,5 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, List, Optional, Any -from deprecated import deprecated +from conductor.client.adapters.models.action_adapter import ActionAdapter -@dataclass -class Action: - """NOTE: This class is auto generated by the swagger code generator program. +Action = ActionAdapter - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'action': 'str', - 'start_workflow': 'StartWorkflow', - 'complete_task': 'TaskDetails', - 'fail_task': 'TaskDetails', - 'expand_inline_json': 'bool', - 'terminate_workflow': 'TerminateWorkflow', - 'update_workflow_variables': 'UpdateWorkflowVariables' - } - - attribute_map = { - 'action': 'action', - 'start_workflow': 'start_workflow', - 'complete_task': 'complete_task', - 'fail_task': 'fail_task', - 'expand_inline_json': 'expandInlineJSON', - 'terminate_workflow': 'terminate_workflow', - 'update_workflow_variables': 'update_workflow_variables' - } - - action: Optional[str] = field(default=None) - start_workflow: Optional['StartWorkflow'] = field(default=None) - complete_task: Optional['TaskDetails'] = field(default=None) - fail_task: Optional['TaskDetails'] = field(default=None) - expand_inline_json: Optional[bool] = field(default=None) - terminate_workflow: Optional['TerminateWorkflow'] = field(default=None) - update_workflow_variables: Optional['UpdateWorkflowVariables'] = field(default=None) - - # Private backing fields - _action: Optional[str] = field(default=None, init=False, repr=False) - _start_workflow: Optional['StartWorkflow'] = field(default=None, init=False, repr=False) - _complete_task: Optional['TaskDetails'] = field(default=None, init=False, repr=False) - _fail_task: Optional['TaskDetails'] = field(default=None, init=False, repr=False) - _expand_inline_json: Optional[bool] = field(default=None, init=False, repr=False) - _terminate_workflow: Optional['TerminateWorkflow'] = field(default=None, init=False, repr=False) - _update_workflow_variables: Optional['UpdateWorkflowVariables'] = field(default=None, init=False, repr=False) - - # Keep the original __init__ for backward compatibility - def __init__(self, action=None, start_workflow=None, complete_task=None, fail_task=None, - expand_inline_json=None, terminate_workflow=None, update_workflow_variables=None): # noqa: E501 - """Action - a model defined in Swagger""" # noqa: E501 - self._action = None - self._start_workflow = None - self._complete_task = None - self._fail_task = None - self._expand_inline_json = None - self._terminate_workflow = None - self._update_workflow_variables = None - self.discriminator = None - if action is not None: - self.action = action - if start_workflow is not None: - self.start_workflow = start_workflow - if complete_task is not None: - self.complete_task = complete_task - if fail_task is not None: - self.fail_task = fail_task - if expand_inline_json is not None: - self.expand_inline_json = expand_inline_json - if terminate_workflow is not None: - self.terminate_workflow = terminate_workflow - if update_workflow_variables is not None: - self.update_workflow_variables = update_workflow_variables - - def __post_init__(self): - """Initialize private fields from dataclass fields""" - if self.action is not None: - self._action = self.action - if self.start_workflow is not None: - self._start_workflow = self.start_workflow - if self.complete_task is not None: - self._complete_task = self.complete_task - if self.fail_task is not None: - self._fail_task = self.fail_task - if self.expand_inline_json is not None: - self._expand_inline_json = self.expand_inline_json - if self.terminate_workflow is not None: - self._terminate_workflow = self.terminate_workflow - if self.update_workflow_variables is not None: - self._update_workflow_variables = self.update_workflow_variables - - @property - def action(self): - """Gets the action of this Action. # noqa: E501 - - - :return: The action of this Action. # noqa: E501 - :rtype: str - """ - return self._action - - @action.setter - def action(self, action): - """Sets the action of this Action. - - - :param action: The action of this Action. # noqa: E501 - :type: str - """ - allowed_values = ["start_workflow", "complete_task", "fail_task", "terminate_workflow", "update_workflow_variables"] # noqa: E501 - if action not in allowed_values: - raise ValueError( - "Invalid value for `action` ({0}), must be one of {1}" # noqa: E501 - .format(action, allowed_values) - ) - - self._action = action - - @property - def start_workflow(self): - """Gets the start_workflow of this Action. # noqa: E501 - - - :return: The start_workflow of this Action. # noqa: E501 - :rtype: StartWorkflow - """ - return self._start_workflow - - @start_workflow.setter - def start_workflow(self, start_workflow): - """Sets the start_workflow of this Action. - - - :param start_workflow: The start_workflow of this Action. # noqa: E501 - :type: StartWorkflow - """ - - self._start_workflow = start_workflow - - @property - def complete_task(self): - """Gets the complete_task of this Action. # noqa: E501 - - - :return: The complete_task of this Action. # noqa: E501 - :rtype: TaskDetails - """ - return self._complete_task - - @complete_task.setter - def complete_task(self, complete_task): - """Sets the complete_task of this Action. - - - :param complete_task: The complete_task of this Action. # noqa: E501 - :type: TaskDetails - """ - - self._complete_task = complete_task - - @property - def fail_task(self): - """Gets the fail_task of this Action. # noqa: E501 - - - :return: The fail_task of this Action. # noqa: E501 - :rtype: TaskDetails - """ - return self._fail_task - - @fail_task.setter - def fail_task(self, fail_task): - """Sets the fail_task of this Action. - - - :param fail_task: The fail_task of this Action. # noqa: E501 - :type: TaskDetails - """ - - self._fail_task = fail_task - - @property - def expand_inline_json(self): - """Gets the expand_inline_json of this Action. # noqa: E501 - - - :return: The expand_inline_json of this Action. # noqa: E501 - :rtype: bool - """ - return self._expand_inline_json - - @expand_inline_json.setter - def expand_inline_json(self, expand_inline_json): - """Sets the expand_inline_json of this Action. - - - :param expand_inline_json: The expand_inline_json of this Action. # noqa: E501 - :type: bool - """ - - self._expand_inline_json = expand_inline_json - - @property - def terminate_workflow(self): - """Gets the terminate_workflow of this Action. # noqa: E501 - - - :return: The terminate_workflow of this Action. # noqa: E501 - :rtype: TerminateWorkflow - """ - return self._terminate_workflow - - @terminate_workflow.setter - def terminate_workflow(self, terminate_workflow): - """Sets the terminate_workflow of this Action. - - - :param terminate_workflow: The terminate_workflow of this Action. # noqa: E501 - :type: TerminateWorkflow - """ - - self._terminate_workflow = terminate_workflow - - @property - def update_workflow_variables(self): - """Gets the update_workflow_variables of this Action. # noqa: E501 - - - :return: The update_workflow_variables of this Action. # noqa: E501 - :rtype: UpdateWorkflowVariables - """ - return self._update_workflow_variables - - @update_workflow_variables.setter - def update_workflow_variables(self, update_workflow_variables): - """Sets the update_workflow_variables of this Action. - - - :param update_workflow_variables: The update_workflow_variables of this Action. # noqa: E501 - :type: UpdateWorkflowVariables - """ - - self._update_workflow_variables = update_workflow_variables - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Action, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Action): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["Action"] diff --git a/src/conductor/client/http/models/any.py b/src/conductor/client/http/models/any.py new file mode 100644 index 00000000..662c65f2 --- /dev/null +++ b/src/conductor/client/http/models/any.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.any_adapter import AnyAdapter + +Any = AnyAdapter + +__all__ = ["Any"] diff --git a/src/conductor/client/http/models/auditable.py b/src/conductor/client/http/models/auditable.py deleted file mode 100644 index f6f8feea..00000000 --- a/src/conductor/client/http/models/auditable.py +++ /dev/null @@ -1,90 +0,0 @@ -from dataclasses import dataclass, field -from typing import Optional -from abc import ABC -import six - - -@dataclass -class Auditable(ABC): - """ - Abstract base class for objects that need auditing information. - - Equivalent to the Java Auditable class from Conductor. - """ - swagger_types = { - 'owner_app': 'str', - 'create_time': 'int', - 'update_time': 'int', - 'created_by': 'str', - 'updated_by': 'str' - } - - attribute_map = { - 'owner_app': 'ownerApp', - 'create_time': 'createTime', - 'update_time': 'updateTime', - 'created_by': 'createdBy', - 'updated_by': 'updatedBy' - } - _owner_app: Optional[str] = field(default=None, repr=False) - _create_time: Optional[int] = field(default=None, repr=False) - _update_time: Optional[int] = field(default=None, repr=False) - _created_by: Optional[str] = field(default=None, repr=False) - _updated_by: Optional[str] = field(default=None, repr=False) - - @property - def owner_app(self) -> Optional[str]: - return self._owner_app - - @owner_app.setter - def owner_app(self, value: Optional[str]) -> None: - self._owner_app = value - - @property - def create_time(self) -> Optional[int]: - return self._create_time - - @create_time.setter - def create_time(self, value: Optional[int]) -> None: - self._create_time = value - - @property - def update_time(self) -> Optional[int]: - return self._update_time - - @update_time.setter - def update_time(self, value: Optional[int]) -> None: - self._update_time = value - - @property - def created_by(self) -> Optional[str]: - return self._created_by - - @created_by.setter - def created_by(self, value: Optional[str]) -> None: - self._created_by = value - - @property - def updated_by(self) -> Optional[str]: - return self._updated_by - - @updated_by.setter - def updated_by(self, value: Optional[str]) -> None: - self._updated_by = value - - def get_create_time(self) -> int: - """Returns create_time or 0 if None - maintains Java API compatibility""" - return 0 if self._create_time is None else self._create_time - - def get_update_time(self) -> int: - """Returns update_time or 0 if None - maintains Java API compatibility""" - return 0 if self._update_time is None else self._update_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if value is not None: - result[attr] = value - return result \ No newline at end of file diff --git a/src/conductor/client/http/models/authorization_request.py b/src/conductor/client/http/models/authorization_request.py index 9cb1faa1..e23b9783 100644 --- a/src/conductor/client/http/models/authorization_request.py +++ b/src/conductor/client/http/models/authorization_request.py @@ -1,183 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields, InitVar -from typing import List, Optional -from enum import Enum +from conductor.client.adapters.models.authorization_request_adapter import \ + AuthorizationRequestAdapter +AuthorizationRequest = AuthorizationRequestAdapter -class AccessEnum(str, Enum): - CREATE = "CREATE" - READ = "READ" - UPDATE = "UPDATE" - DELETE = "DELETE" - EXECUTE = "EXECUTE" - - -@dataclass -class AuthorizationRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'subject': 'SubjectRef', - 'target': 'TargetRef', - 'access': 'list[str]' - } - - attribute_map = { - 'subject': 'subject', - 'target': 'target', - 'access': 'access' - } - - subject: InitVar[Optional['SubjectRef']] = None - target: InitVar[Optional['TargetRef']] = None - access: InitVar[Optional[List[str]]] = None - - _subject: Optional['SubjectRef'] = field(default=None, init=False, repr=False) - _target: Optional['TargetRef'] = field(default=None, init=False, repr=False) - _access: Optional[List[str]] = field(default=None, init=False, repr=False) - - discriminator: str = field(default=None, init=False, repr=False) - - def __init__(self, subject=None, target=None, access=None): # noqa: E501 - """AuthorizationRequest - a model defined in Swagger""" # noqa: E501 - self._subject = None - self._target = None - self._access = None - self.discriminator = None - self.subject = subject - self.target = target - self.access = access - - def __post_init__(self, subject, target, access): - self.subject = subject - self.target = target - self.access = access - - @property - def subject(self): - """Gets the subject of this AuthorizationRequest. # noqa: E501 - - - :return: The subject of this AuthorizationRequest. # noqa: E501 - :rtype: SubjectRef - """ - return self._subject - - @subject.setter - def subject(self, subject): - """Sets the subject of this AuthorizationRequest. - - - :param subject: The subject of this AuthorizationRequest. # noqa: E501 - :type: SubjectRef - """ - self._subject = subject - - @property - def target(self): - """Gets the target of this AuthorizationRequest. # noqa: E501 - - - :return: The target of this AuthorizationRequest. # noqa: E501 - :rtype: TargetRef - """ - return self._target - - @target.setter - def target(self, target): - """Sets the target of this AuthorizationRequest. - - - :param target: The target of this AuthorizationRequest. # noqa: E501 - :type: TargetRef - """ - self._target = target - - @property - def access(self): - """Gets the access of this AuthorizationRequest. # noqa: E501 - - The set of access which is granted or removed # noqa: E501 - - :return: The access of this AuthorizationRequest. # noqa: E501 - :rtype: list[str] - """ - return self._access - - @access.setter - def access(self, access): - """Sets the access of this AuthorizationRequest. - - The set of access which is granted or removed # noqa: E501 - - :param access: The access of this AuthorizationRequest. # noqa: E501 - :type: list[str] - """ - allowed_values = [e.value for e in AccessEnum] # noqa: E501 - - # Preserve original behavior: call set(access) directly to maintain TypeError for None - if not set(access).issubset(set(allowed_values)): - raise ValueError( - "Invalid values for `access` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(access) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._access = access - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(AuthorizationRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AuthorizationRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["AuthorizationRequest"] diff --git a/src/conductor/client/http/models/bulk_response.py b/src/conductor/client/http/models/bulk_response.py index cbc43f47..6e921657 100644 --- a/src/conductor/client/http/models/bulk_response.py +++ b/src/conductor/client/http/models/bulk_response.py @@ -1,191 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, List, Generic, TypeVar, Optional, Any -from dataclasses import asdict +from conductor.client.adapters.models.bulk_response_adapter import \ + BulkResponseAdapter -T = TypeVar('T') +BulkResponse = BulkResponseAdapter -@dataclass -class BulkResponse(Generic[T]): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'bulk_error_results': 'dict(str, str)', - 'bulk_successful_results': 'list[str]', - 'message': 'str' - } - - attribute_map = { - 'bulk_error_results': 'bulkErrorResults', - 'bulk_successful_results': 'bulkSuccessfulResults', - 'message': 'message' - } - - _bulk_error_results: Dict[str, str] = field(default_factory=dict) - _bulk_successful_results: List[T] = field(default_factory=list) - _message: str = field(default="Bulk Request has been processed.") - - bulk_error_results: InitVar[Optional[Dict[str, str]]] = None - bulk_successful_results: InitVar[Optional[List[T]]] = None - message: InitVar[Optional[str]] = None - - def __init__(self, bulk_error_results=None, bulk_successful_results=None, message=None): # noqa: E501 - """BulkResponse - a model defined in Swagger""" # noqa: E501 - self._bulk_error_results = {} - self._bulk_successful_results = [] - self._message = "Bulk Request has been processed." - self.discriminator = None - if bulk_error_results is not None: - self.bulk_error_results = bulk_error_results - if bulk_successful_results is not None: - self.bulk_successful_results = bulk_successful_results - if message is not None: - self.message = message - - def __post_init__(self, bulk_error_results, bulk_successful_results, message): - if bulk_error_results is not None: - self.bulk_error_results = bulk_error_results - if bulk_successful_results is not None: - self.bulk_successful_results = bulk_successful_results - if message is not None: - self.message = message - - @property - def bulk_error_results(self): - """Gets the bulk_error_results of this BulkResponse. # noqa: E501 - - Key - entityId Value - error message processing this entity - - :return: The bulk_error_results of this BulkResponse. # noqa: E501 - :rtype: dict(str, str) - """ - return self._bulk_error_results - - @bulk_error_results.setter - def bulk_error_results(self, bulk_error_results): - """Sets the bulk_error_results of this BulkResponse. - - Key - entityId Value - error message processing this entity - - :param bulk_error_results: The bulk_error_results of this BulkResponse. # noqa: E501 - :type: dict(str, str) - """ - - self._bulk_error_results = bulk_error_results - - @property - def bulk_successful_results(self): - """Gets the bulk_successful_results of this BulkResponse. # noqa: E501 - - - :return: The bulk_successful_results of this BulkResponse. # noqa: E501 - :rtype: list[T] - """ - return self._bulk_successful_results - - @bulk_successful_results.setter - def bulk_successful_results(self, bulk_successful_results): - """Sets the bulk_successful_results of this BulkResponse. - - - :param bulk_successful_results: The bulk_successful_results of this BulkResponse. # noqa: E501 - :type: list[T] - """ - - self._bulk_successful_results = bulk_successful_results - - @property - def message(self): - """Gets the message of this BulkResponse. # noqa: E501 - - - :return: The message of this BulkResponse. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this BulkResponse. - - - :param message: The message of this BulkResponse. # noqa: E501 - :type: str - """ - - self._message = message - - def append_successful_response(self, result: T) -> None: - """Appends a successful result to the bulk_successful_results list. - - :param result: The successful result to append - :type result: T - """ - self._bulk_successful_results.append(result) - - def append_failed_response(self, id: str, error_message: str) -> None: - """Appends a failed response to the bulk_error_results map. - - :param id: The entity ID - :type id: str - :param error_message: The error message - :type error_message: str - """ - self._bulk_error_results[id] = error_message - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(BulkResponse, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, BulkResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["BulkResponse"] diff --git a/src/conductor/client/http/models/byte_string.py b/src/conductor/client/http/models/byte_string.py new file mode 100644 index 00000000..961749c1 --- /dev/null +++ b/src/conductor/client/http/models/byte_string.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.byte_string_adapter import \ + ByteStringAdapter + +ByteString = ByteStringAdapter + +__all__ = ["ByteString"] diff --git a/src/conductor/client/http/models/cache_config.py b/src/conductor/client/http/models/cache_config.py new file mode 100644 index 00000000..cde79c17 --- /dev/null +++ b/src/conductor/client/http/models/cache_config.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.cache_config_adapter import \ + CacheConfigAdapter + +CacheConfig = CacheConfigAdapter + +__all__ = ["CacheConfig"] diff --git a/src/conductor/client/http/models/circuit_breaker_transition_response.py b/src/conductor/client/http/models/circuit_breaker_transition_response.py index 4ccbe44a..98311b10 100644 --- a/src/conductor/client/http/models/circuit_breaker_transition_response.py +++ b/src/conductor/client/http/models/circuit_breaker_transition_response.py @@ -1,55 +1,6 @@ -from dataclasses import dataclass -from typing import Optional -import six +from conductor.client.adapters.models.circuit_breaker_transition_response_adapter import \ + CircuitBreakerTransitionResponseAdapter +CircuitBreakerTransitionResponse = CircuitBreakerTransitionResponseAdapter -@dataclass -class CircuitBreakerTransitionResponse: - """Circuit breaker transition response model.""" - - swagger_types = { - 'service': 'str', - 'previous_state': 'str', - 'current_state': 'str', - 'transition_timestamp': 'int', - 'message': 'str' - } - - attribute_map = { - 'service': 'service', - 'previous_state': 'previousState', - 'current_state': 'currentState', - 'transition_timestamp': 'transitionTimestamp', - 'message': 'message' - } - - service: Optional[str] = None - previous_state: Optional[str] = None - current_state: Optional[str] = None - transition_timestamp: Optional[int] = None - message: Optional[str] = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - return result - - def __str__(self): - return f"CircuitBreakerTransitionResponse(service='{self.service}', previous_state='{self.previous_state}', current_state='{self.current_state}', transition_timestamp={self.transition_timestamp}, message='{self.message}')" \ No newline at end of file +__all__ = ["CircuitBreakerTransitionResponse"] diff --git a/src/conductor/client/http/models/conductor_application.py b/src/conductor/client/http/models/conductor_application.py index 9975c8ae..e9060433 100644 --- a/src/conductor/client/http/models/conductor_application.py +++ b/src/conductor/client/http/models/conductor_application.py @@ -1,266 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Optional -from dataclasses import asdict -from deprecated import deprecated +from conductor.client.adapters.models.conductor_application_adapter import \ + ConductorApplicationAdapter +ConductorApplication = ConductorApplicationAdapter -@dataclass -class ConductorApplication: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'name': 'str', - 'created_by': 'str', - 'create_time': 'int', - 'update_time': 'int', - 'updated_by': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'created_by': 'createdBy', - 'create_time': 'createTime', - 'update_time': 'updateTime', - 'updated_by': 'updatedBy' - } - - id: Optional[str] = field(default=None) - name: Optional[str] = field(default=None) - created_by: Optional[str] = field(default=None) - create_time: Optional[int] = field(default=None) - update_time: Optional[int] = field(default=None) - updated_by: Optional[str] = field(default=None) - - # Private backing fields for properties - _id: Optional[str] = field(init=False, repr=False, default=None) - _name: Optional[str] = field(init=False, repr=False, default=None) - _created_by: Optional[str] = field(init=False, repr=False, default=None) - _create_time: Optional[int] = field(init=False, repr=False, default=None) - _update_time: Optional[int] = field(init=False, repr=False, default=None) - _updated_by: Optional[str] = field(init=False, repr=False, default=None) - - # Keep the original discriminator - discriminator: Optional[str] = field(init=False, repr=False, default=None) - - def __init__(self, id=None, name=None, created_by=None, create_time=None, update_time=None, updated_by=None): # noqa: E501 - """ConductorApplication - a model defined in Swagger""" # noqa: E501 - self._id = None - self._name = None - self._created_by = None - self._create_time = None - self._update_time = None - self._updated_by = None - self.discriminator = None - if id is not None: - self.id = id - if name is not None: - self.name = name - if created_by is not None: - self.created_by = created_by - if create_time is not None: - self.create_time = create_time - if update_time is not None: - self.update_time = update_time - if updated_by is not None: - self.updated_by = updated_by - - def __post_init__(self): - # Initialize properties from dataclass fields if not already set - if self._id is None and self.id is not None: - self._id = self.id - if self._name is None and self.name is not None: - self._name = self.name - if self._created_by is None and self.created_by is not None: - self._created_by = self.created_by - if self._create_time is None and self.create_time is not None: - self._create_time = self.create_time - if self._update_time is None and self.update_time is not None: - self._update_time = self.update_time - if self._updated_by is None and self.updated_by is not None: - self._updated_by = self.updated_by - - @property - def id(self): - """Gets the id of this ConductorApplication. # noqa: E501 - - - :return: The id of this ConductorApplication. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this ConductorApplication. - - - :param id: The id of this ConductorApplication. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def name(self): - """Gets the name of this ConductorApplication. # noqa: E501 - - - :return: The name of this ConductorApplication. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this ConductorApplication. - - - :param name: The name of this ConductorApplication. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def created_by(self): - """Gets the created_by of this ConductorApplication. # noqa: E501 - - - :return: The created_by of this ConductorApplication. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this ConductorApplication. - - - :param created_by: The created_by of this ConductorApplication. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - def create_time(self): - """Gets the create_time of this ConductorApplication. # noqa: E501 - - - :return: The create_time of this ConductorApplication. # noqa: E501 - :rtype: int - """ - return self._create_time - - @create_time.setter - def create_time(self, create_time): - """Sets the create_time of this ConductorApplication. - - - :param create_time: The create_time of this ConductorApplication. # noqa: E501 - :type: int - """ - - self._create_time = create_time - - @property - def update_time(self): - """Gets the update_time of this ConductorApplication. # noqa: E501 - - - :return: The update_time of this ConductorApplication. # noqa: E501 - :rtype: int - """ - return self._update_time - - @update_time.setter - def update_time(self, update_time): - """Sets the update_time of this ConductorApplication. - - - :param update_time: The update_time of this ConductorApplication. # noqa: E501 - :type: int - """ - - self._update_time = update_time - - @property - def updated_by(self): - """Gets the updated_by of this ConductorApplication. # noqa: E501 - - - :return: The updated_by of this ConductorApplication. # noqa: E501 - :rtype: str - """ - return self._updated_by - - @updated_by.setter - def updated_by(self, updated_by): - """Sets the updated_by of this ConductorApplication. - - - :param updated_by: The updated_by of this ConductorApplication. # noqa: E501 - :type: str - """ - - self._updated_by = updated_by - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ConductorApplication, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ConductorApplication): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["ConductorApplication"] diff --git a/src/conductor/client/http/models/conductor_user.py b/src/conductor/client/http/models/conductor_user.py index a9ea6af9..d09b4cba 100644 --- a/src/conductor/client/http/models/conductor_user.py +++ b/src/conductor/client/http/models/conductor_user.py @@ -1,300 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import List, Optional -from deprecated import deprecated +from conductor.client.adapters.models.conductor_user_adapter import \ + ConductorUserAdapter +ConductorUser = ConductorUserAdapter -@dataclass -class ConductorUser: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _id: Optional[str] = field(default=None, init=False, repr=False) - _name: Optional[str] = field(default=None, init=False, repr=False) - _roles: Optional[List['Role']] = field(default=None, init=False, repr=False) - _groups: Optional[List['Group']] = field(default=None, init=False, repr=False) - _uuid: Optional[str] = field(default=None, init=False, repr=False) - _application_user: Optional[bool] = field(default=None, init=False, repr=False) - _encrypted_id: Optional[bool] = field(default=None, init=False, repr=False) - _encrypted_id_display_value: Optional[str] = field(default=None, init=False, repr=False) - - swagger_types = { - 'id': 'str', - 'name': 'str', - 'roles': 'list[Role]', - 'groups': 'list[Group]', - 'uuid': 'str', - 'application_user': 'bool', - 'encrypted_id': 'bool', - 'encrypted_id_display_value': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'roles': 'roles', - 'groups': 'groups', - 'uuid': 'uuid', - 'application_user': 'applicationUser', - 'encrypted_id': 'encryptedId', - 'encrypted_id_display_value': 'encryptedIdDisplayValue' - } - - def __init__(self, id=None, name=None, roles=None, groups=None, uuid=None, application_user=None, encrypted_id=None, - encrypted_id_display_value=None): # noqa: E501 - """ConductorUser - a model defined in Swagger""" # noqa: E501 - self._id = None - self._name = None - self._roles = None - self._groups = None - self._uuid = None - self._application_user = None - self._encrypted_id = None - self._encrypted_id_display_value = None - self.discriminator = None - if id is not None: - self.id = id - if name is not None: - self.name = name - if roles is not None: - self.roles = roles - if groups is not None: - self.groups = groups - if uuid is not None: - self.uuid = uuid - if application_user is not None: - self.application_user = application_user - if encrypted_id is not None: - self.encrypted_id = encrypted_id - if encrypted_id_display_value is not None: - self.encrypted_id_display_value = encrypted_id_display_value - - def __post_init__(self): - """Initialize after dataclass initialization""" - self.discriminator = None - - @property - def id(self): - """Gets the id of this ConductorUser. # noqa: E501 - - - :return: The id of this ConductorUser. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this ConductorUser. - - - :param id: The id of this ConductorUser. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def name(self): - """Gets the name of this ConductorUser. # noqa: E501 - - - :return: The name of this ConductorUser. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this ConductorUser. - - - :param name: The name of this ConductorUser. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def roles(self): - """Gets the roles of this ConductorUser. # noqa: E501 - - - :return: The roles of this ConductorUser. # noqa: E501 - :rtype: list[Role] - """ - return self._roles - - @roles.setter - def roles(self, roles): - """Sets the roles of this ConductorUser. - - - :param roles: The roles of this ConductorUser. # noqa: E501 - :type: list[Role] - """ - - self._roles = roles - - @property - def groups(self): - """Gets the groups of this ConductorUser. # noqa: E501 - - - :return: The groups of this ConductorUser. # noqa: E501 - :rtype: list[Group] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this ConductorUser. - - - :param groups: The groups of this ConductorUser. # noqa: E501 - :type: list[Group] - """ - - self._groups = groups - - @property - def uuid(self): - """Gets the uuid of this ConductorUser. # noqa: E501 - - - :return: The uuid of this ConductorUser. # noqa: E501 - :rtype: str - """ - return self._uuid - - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this ConductorUser. - - - :param uuid: The uuid of this ConductorUser. # noqa: E501 - :type: str - """ - - self._uuid = uuid - - @property - @deprecated - def application_user(self): - """Gets the application_user of this ConductorUser. # noqa: E501 - - - :return: The application_user of this ConductorUser. # noqa: E501 - :rtype: bool - """ - return self._application_user - - @application_user.setter - @deprecated - def application_user(self, application_user): - """Sets the application_user of this ConductorUser. - - - :param application_user: The application_user of this ConductorUser. # noqa: E501 - :type: bool - """ - - self._application_user = application_user - - @property - def encrypted_id(self): - """Gets the encrypted_id of this ConductorUser. # noqa: E501 - - - :return: The encrypted_id of this ConductorUser. # noqa: E501 - :rtype: bool - """ - return self._encrypted_id - - @encrypted_id.setter - def encrypted_id(self, encrypted_id): - """Sets the encrypted_id of this ConductorUser. - - - :param encrypted_id: The encrypted_id of this ConductorUser. # noqa: E501 - :type: bool - """ - - self._encrypted_id = encrypted_id - - @property - def encrypted_id_display_value(self): - """Gets the encrypted_id_display_value of this ConductorUser. # noqa: E501 - - - :return: The encrypted_id_display_value of this ConductorUser. # noqa: E501 - :rtype: str - """ - return self._encrypted_id_display_value - - @encrypted_id_display_value.setter - def encrypted_id_display_value(self, encrypted_id_display_value): - """Sets the encrypted_id_display_value of this ConductorUser. - - - :param encrypted_id_display_value: The encrypted_id_display_value of this ConductorUser. # noqa: E501 - :type: str - """ - - self._encrypted_id_display_value = encrypted_id_display_value - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ConductorUser, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ConductorUser): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["ConductorUser"] diff --git a/src/conductor/client/http/models/connectivity_test_input.py b/src/conductor/client/http/models/connectivity_test_input.py new file mode 100644 index 00000000..30726fa5 --- /dev/null +++ b/src/conductor/client/http/models/connectivity_test_input.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.connectivity_test_input_adapter import \ + ConnectivityTestInputAdapter + +ConnectivityTestInput = ConnectivityTestInputAdapter + +__all__ = ["ConnectivityTestInput"] diff --git a/src/conductor/client/http/models/connectivity_test_result.py b/src/conductor/client/http/models/connectivity_test_result.py new file mode 100644 index 00000000..4808601a --- /dev/null +++ b/src/conductor/client/http/models/connectivity_test_result.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.connectivity_test_result_adapter import \ + ConnectivityTestResultAdapter + +ConnectivityTestResult = ConnectivityTestResultAdapter + +__all__ = ["ConnectivityTestResult"] diff --git a/src/conductor/client/http/models/correlation_ids_search_request.py b/src/conductor/client/http/models/correlation_ids_search_request.py index 65e10308..3f16e62b 100644 --- a/src/conductor/client/http/models/correlation_ids_search_request.py +++ b/src/conductor/client/http/models/correlation_ids_search_request.py @@ -1,136 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import List, Optional +from conductor.client.adapters.models.correlation_ids_search_request_adapter import \ + CorrelationIdsSearchRequestAdapter +CorrelationIdsSearchRequest = CorrelationIdsSearchRequestAdapter -@dataclass -class CorrelationIdsSearchRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - correlation_ids: InitVar[Optional[List[str]]] = None - workflow_names: InitVar[Optional[List[str]]] = None - - _correlation_ids: List[str] = field(default_factory=list, init=False, repr=False) - _workflow_names: List[str] = field(default_factory=list, init=False, repr=False) - - swagger_types = { - 'correlation_ids': 'list[str]', - 'workflow_names': 'list[str]' - } - - attribute_map = { - 'correlation_ids': 'correlationIds', - 'workflow_names': 'workflowNames' - } - - def __init__(self, correlation_ids=None, workflow_names=None): # noqa: E501 - """CorrelationIdsSearchRequest - a model defined in Swagger""" # noqa: E501 - self._correlation_ids = None - self._workflow_names = None - self.discriminator = None - self.correlation_ids = correlation_ids - self.workflow_names = workflow_names - - def __post_init__(self, correlation_ids, workflow_names): - """Initialize after dataclass initialization""" - if correlation_ids is not None: - self.correlation_ids = correlation_ids - if workflow_names is not None: - self.workflow_names = workflow_names - - @property - def correlation_ids(self): - """Gets the correlation_ids of this CorrelationIdsSearchRequest. # noqa: E501 - - - :return: The correlation_ids of this CorrelationIdsSearchRequest. # noqa: E501 - :rtype: list[str] - """ - return self._correlation_ids - - @correlation_ids.setter - def correlation_ids(self, correlation_ids): - """Sets the correlation_ids of this CorrelationIdsSearchRequest. - - - :param correlation_ids: The correlation_ids of this CorrelationIdsSearchRequest. # noqa: E501 - :type: list[str] - """ - self._correlation_ids = correlation_ids - - @property - def workflow_names(self): - """Gets the workflow_names of this CorrelationIdsSearchRequest. # noqa: E501 - - - :return: The workflow_names of this CorrelationIdsSearchRequest. # noqa: E501 - :rtype: list[str] - """ - return self._workflow_names - - @workflow_names.setter - def workflow_names(self, workflow_names): - """Sets the workflow_names of this CorrelationIdsSearchRequest. - - - :param workflow_names: The workflow_names of this CorrelationIdsSearchRequest. # noqa: E501 - :type: list[str] - """ - self._workflow_names = workflow_names - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(CorrelationIdsSearchRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CorrelationIdsSearchRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["CorrelationIdsSearchRequest"] diff --git a/src/conductor/client/http/models/create_or_update_application_request.py b/src/conductor/client/http/models/create_or_update_application_request.py index e38ae3f5..0fe6075b 100644 --- a/src/conductor/client/http/models/create_or_update_application_request.py +++ b/src/conductor/client/http/models/create_or_update_application_request.py @@ -1,108 +1,6 @@ -from dataclasses import dataclass, field, InitVar -import pprint -import re # noqa: F401 -from typing import Dict, List, Optional, Any +from conductor.client.adapters.models.create_or_update_application_request_adapter import \ + CreateOrUpdateApplicationRequestAdapter -import six +CreateOrUpdateApplicationRequest = CreateOrUpdateApplicationRequestAdapter - -@dataclass -class CreateOrUpdateApplicationRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - name: InitVar[Optional[str]] = None - _name: Optional[str] = field(default=None, init=False) - - def __init__(self, name=None): # noqa: E501 - """CreateOrUpdateApplicationRequest - a model defined in Swagger""" # noqa: E501 - self._name = None - self.name = name - - def __post_init__(self, name: Optional[str]): - """Post initialization for dataclass""" - self.name = name - - @property - def name(self): - """Gets the name of this CreateOrUpdateApplicationRequest. # noqa: E501 - - Application's name e.g.: Payment Processors # noqa: E501 - - :return: The name of this CreateOrUpdateApplicationRequest. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this CreateOrUpdateApplicationRequest. - - Application's name e.g.: Payment Processors # noqa: E501 - - :param name: The name of this CreateOrUpdateApplicationRequest. # noqa: E501 - :type: str - """ - self._name = name - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(CreateOrUpdateApplicationRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CreateOrUpdateApplicationRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["CreateOrUpdateApplicationRequest"] diff --git a/src/conductor/client/http/models/declaration.py b/src/conductor/client/http/models/declaration.py new file mode 100644 index 00000000..bc3fc9f4 --- /dev/null +++ b/src/conductor/client/http/models/declaration.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.declaration_adapter import \ + DeclarationAdapter + +Declaration = DeclarationAdapter + +__all__ = ["Declaration"] diff --git a/src/conductor/client/http/models/declaration_or_builder.py b/src/conductor/client/http/models/declaration_or_builder.py new file mode 100644 index 00000000..a60e2c26 --- /dev/null +++ b/src/conductor/client/http/models/declaration_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.declaration_or_builder_adapter import \ + DeclarationOrBuilderAdapter + +DeclarationOrBuilder = DeclarationOrBuilderAdapter + +__all__ = ["DeclarationOrBuilder"] diff --git a/src/conductor/client/http/models/descriptor.py b/src/conductor/client/http/models/descriptor.py new file mode 100644 index 00000000..a389118b --- /dev/null +++ b/src/conductor/client/http/models/descriptor.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.descriptor_adapter import \ + DescriptorAdapter + +Descriptor = DescriptorAdapter + +__all__ = ["Descriptor"] diff --git a/src/conductor/client/http/models/descriptor_proto.py b/src/conductor/client/http/models/descriptor_proto.py new file mode 100644 index 00000000..ad96c916 --- /dev/null +++ b/src/conductor/client/http/models/descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.descriptor_proto_adapter import \ + DescriptorProtoAdapter + +DescriptorProto = DescriptorProtoAdapter + +__all__ = ["DescriptorProto"] diff --git a/src/conductor/client/http/models/descriptor_proto_or_builder.py b/src/conductor/client/http/models/descriptor_proto_or_builder.py new file mode 100644 index 00000000..d4cbc37e --- /dev/null +++ b/src/conductor/client/http/models/descriptor_proto_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.descriptor_proto_or_builder_adapter import \ + DescriptorProtoOrBuilderAdapter + +DescriptorProtoOrBuilder = DescriptorProtoOrBuilderAdapter + +__all__ = ["DescriptorProtoOrBuilder"] diff --git a/src/conductor/client/http/models/edition_default.py b/src/conductor/client/http/models/edition_default.py new file mode 100644 index 00000000..9b5abf7c --- /dev/null +++ b/src/conductor/client/http/models/edition_default.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.edition_default_adapter import \ + EditionDefaultAdapter + +EditionDefault = EditionDefaultAdapter + +__all__ = ["EditionDefault"] diff --git a/src/conductor/client/http/models/edition_default_or_builder.py b/src/conductor/client/http/models/edition_default_or_builder.py new file mode 100644 index 00000000..907ccb3a --- /dev/null +++ b/src/conductor/client/http/models/edition_default_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.edition_default_or_builder_adapter import \ + EditionDefaultOrBuilderAdapter + +EditionDefaultOrBuilder = EditionDefaultOrBuilderAdapter + +__all__ = ["EditionDefaultOrBuilder"] diff --git a/src/conductor/client/http/models/enum_descriptor.py b/src/conductor/client/http/models/enum_descriptor.py new file mode 100644 index 00000000..a1c1c752 --- /dev/null +++ b/src/conductor/client/http/models/enum_descriptor.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_descriptor_adapter import \ + EnumDescriptorAdapter + +EnumDescriptor = EnumDescriptorAdapter + +__all__ = ["EnumDescriptor"] diff --git a/src/conductor/client/http/models/enum_descriptor_proto.py b/src/conductor/client/http/models/enum_descriptor_proto.py new file mode 100644 index 00000000..775f054b --- /dev/null +++ b/src/conductor/client/http/models/enum_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_descriptor_proto_adapter import \ + EnumDescriptorProtoAdapter + +EnumDescriptorProto = EnumDescriptorProtoAdapter + +__all__ = ["EnumDescriptorProto"] diff --git a/src/conductor/client/http/models/enum_descriptor_proto_or_builder.py b/src/conductor/client/http/models/enum_descriptor_proto_or_builder.py new file mode 100644 index 00000000..79652ac8 --- /dev/null +++ b/src/conductor/client/http/models/enum_descriptor_proto_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_descriptor_proto_or_builder_adapter import \ + EnumDescriptorProtoOrBuilderAdapter + +EnumDescriptorProtoOrBuilder = EnumDescriptorProtoOrBuilderAdapter + +__all__ = ["EnumDescriptorProtoOrBuilder"] diff --git a/src/conductor/client/http/models/enum_options.py b/src/conductor/client/http/models/enum_options.py new file mode 100644 index 00000000..58c0f2a0 --- /dev/null +++ b/src/conductor/client/http/models/enum_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_options_adapter import \ + EnumOptionsAdapter + +EnumOptions = EnumOptionsAdapter + +__all__ = ["EnumOptions"] diff --git a/src/conductor/client/http/models/enum_options_or_builder.py b/src/conductor/client/http/models/enum_options_or_builder.py new file mode 100644 index 00000000..0f4ab873 --- /dev/null +++ b/src/conductor/client/http/models/enum_options_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_options_or_builder_adapter import \ + EnumOptionsOrBuilderAdapter + +EnumOptionsOrBuilder = EnumOptionsOrBuilderAdapter + +__all__ = ["EnumOptionsOrBuilder"] diff --git a/src/conductor/client/http/models/enum_reserved_range.py b/src/conductor/client/http/models/enum_reserved_range.py new file mode 100644 index 00000000..4eea455b --- /dev/null +++ b/src/conductor/client/http/models/enum_reserved_range.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_reserved_range_adapter import \ + EnumReservedRangeAdapter + +EnumReservedRange = EnumReservedRangeAdapter + +__all__ = ["EnumReservedRange"] diff --git a/src/conductor/client/http/models/enum_reserved_range_or_builder.py b/src/conductor/client/http/models/enum_reserved_range_or_builder.py new file mode 100644 index 00000000..b4bc67db --- /dev/null +++ b/src/conductor/client/http/models/enum_reserved_range_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_reserved_range_or_builder_adapter import \ + EnumReservedRangeOrBuilderAdapter + +EnumReservedRangeOrBuilder = EnumReservedRangeOrBuilderAdapter + +__all__ = ["EnumReservedRangeOrBuilder"] diff --git a/src/conductor/client/http/models/enum_value_descriptor.py b/src/conductor/client/http/models/enum_value_descriptor.py new file mode 100644 index 00000000..5494c5e0 --- /dev/null +++ b/src/conductor/client/http/models/enum_value_descriptor.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_value_descriptor_adapter import \ + EnumValueDescriptorAdapter + +EnumValueDescriptor = EnumValueDescriptorAdapter + +__all__ = ["EnumValueDescriptor"] diff --git a/src/conductor/client/http/models/enum_value_descriptor_proto.py b/src/conductor/client/http/models/enum_value_descriptor_proto.py new file mode 100644 index 00000000..1c038ece --- /dev/null +++ b/src/conductor/client/http/models/enum_value_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_value_descriptor_proto_adapter import \ + EnumValueDescriptorProtoAdapter + +EnumValueDescriptorProto = EnumValueDescriptorProtoAdapter + +__all__ = ["EnumValueDescriptorProto"] diff --git a/src/conductor/client/http/models/enum_value_descriptor_proto_or_builder.py b/src/conductor/client/http/models/enum_value_descriptor_proto_or_builder.py new file mode 100644 index 00000000..dd93a83c --- /dev/null +++ b/src/conductor/client/http/models/enum_value_descriptor_proto_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_value_descriptor_proto_or_builder_adapter import \ + EnumValueDescriptorProtoOrBuilderAdapter + +EnumValueDescriptorProtoOrBuilder = EnumValueDescriptorProtoOrBuilderAdapter + +__all__ = ["EnumValueDescriptorProtoOrBuilder"] diff --git a/src/conductor/client/http/models/enum_value_options.py b/src/conductor/client/http/models/enum_value_options.py new file mode 100644 index 00000000..b8d00da4 --- /dev/null +++ b/src/conductor/client/http/models/enum_value_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_value_options_adapter import \ + EnumValueOptionsAdapter + +EnumValueOptions = EnumValueOptionsAdapter + +__all__ = ["EnumValueOptions"] diff --git a/src/conductor/client/http/models/enum_value_options_or_builder.py b/src/conductor/client/http/models/enum_value_options_or_builder.py new file mode 100644 index 00000000..bb66cf15 --- /dev/null +++ b/src/conductor/client/http/models/enum_value_options_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.enum_value_options_or_builder_adapter import \ + EnumValueOptionsOrBuilderAdapter + +EnumValueOptionsOrBuilder = EnumValueOptionsOrBuilderAdapter + +__all__ = ["EnumValueOptionsOrBuilder"] diff --git a/src/conductor/client/http/models/environment_variable.py b/src/conductor/client/http/models/environment_variable.py new file mode 100644 index 00000000..e6cfaf41 --- /dev/null +++ b/src/conductor/client/http/models/environment_variable.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.environment_variable_adapter import \ + EnvironmentVariableAdapter + +EnvironmentVariable = EnvironmentVariableAdapter + +__all__ = ["EnvironmentVariable"] diff --git a/src/conductor/client/http/models/event_handler.py b/src/conductor/client/http/models/event_handler.py index c3d32297..9c5e55e4 100644 --- a/src/conductor/client/http/models/event_handler.py +++ b/src/conductor/client/http/models/event_handler.py @@ -1,290 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import List, Dict, Any, Optional -from dataclasses import dataclass, field, InitVar +from conductor.client.adapters.models.event_handler_adapter import \ + EventHandlerAdapter +EventHandler = EventHandlerAdapter -@dataclass -class EventHandler: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str', - 'event': 'str', - 'condition': 'str', - 'actions': 'list[Action]', - 'active': 'bool', - 'evaluator_type': 'str', - 'description': 'str' - } - - attribute_map = { - 'name': 'name', - 'event': 'event', - 'condition': 'condition', - 'actions': 'actions', - 'active': 'active', - 'evaluator_type': 'evaluatorType', - 'description': 'description' - } - - name: str = field(default=None) - event: str = field(default=None) - condition: Optional[str] = field(default=None) - actions: List[Any] = field(default=None) - active: Optional[bool] = field(default=None) - evaluator_type: Optional[str] = field(default=None) - description: Optional[str] = field(default=None) - - # Private backing fields for properties - _name: str = field(init=False, repr=False, default=None) - _event: str = field(init=False, repr=False, default=None) - _condition: Optional[str] = field(init=False, repr=False, default=None) - _actions: List[Any] = field(init=False, repr=False, default=None) - _active: Optional[bool] = field(init=False, repr=False, default=None) - _evaluator_type: Optional[str] = field(init=False, repr=False, default=None) - _description: Optional[str] = field(init=False, repr=False, default=None) - - # For backward compatibility - discriminator: InitVar[Any] = None - - def __init__(self, name=None, event=None, condition=None, actions=None, active=None, - evaluator_type=None, description=None): # noqa: E501 - """EventHandler - a model defined in Swagger""" # noqa: E501 - self._name = None - self._event = None - self._condition = None - self._actions = None - self._active = None - self._evaluator_type = None - self.discriminator = None - self.name = name - self.event = event - self.description = None - if condition is not None: - self.condition = condition - self.actions = actions - if active is not None: - self.active = active - if evaluator_type is not None: - self.evaluator_type = evaluator_type - if description is not None: - self.description = description - - def __post_init__(self, discriminator): - # Initialize properties from dataclass fields if not already set by __init__ - if self._name is None and self.name is not None: - self._name = self.name - if self._event is None and self.event is not None: - self._event = self.event - if self._condition is None and self.condition is not None: - self._condition = self.condition - if self._actions is None and self.actions is not None: - self._actions = self.actions - if self._active is None and self.active is not None: - self._active = self.active - if self._evaluator_type is None and self.evaluator_type is not None: - self._evaluator_type = self.evaluator_type - if self._description is None and self.description is not None: - self._description = self.description - - @property - def name(self): - """Gets the name of this EventHandler. # noqa: E501 - - - :return: The name of this EventHandler. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this EventHandler. - - - :param name: The name of this EventHandler. # noqa: E501 - :type: str - """ - self._name = name - - @property - def event(self): - """Gets the event of this EventHandler. # noqa: E501 - - - :return: The event of this EventHandler. # noqa: E501 - :rtype: str - """ - return self._event - - @event.setter - def event(self, event): - """Sets the event of this EventHandler. - - - :param event: The event of this EventHandler. # noqa: E501 - :type: str - """ - self._event = event - - @property - def condition(self): - """Gets the condition of this EventHandler. # noqa: E501 - - - :return: The condition of this EventHandler. # noqa: E501 - :rtype: str - """ - return self._condition - - @condition.setter - def condition(self, condition): - """Sets the condition of this EventHandler. - - - :param condition: The condition of this EventHandler. # noqa: E501 - :type: str - """ - - self._condition = condition - - @property - def actions(self): - """Gets the actions of this EventHandler. # noqa: E501 - - - :return: The actions of this EventHandler. # noqa: E501 - :rtype: list[Action] - """ - return self._actions - - @actions.setter - def actions(self, actions): - """Sets the actions of this EventHandler. - - - :param actions: The actions of this EventHandler. # noqa: E501 - :type: list[Action] - """ - self._actions = actions - - @property - def active(self): - """Gets the active of this EventHandler. # noqa: E501 - - - :return: The active of this EventHandler. # noqa: E501 - :rtype: bool - """ - return self._active - - @active.setter - def active(self, active): - """Sets the active of this EventHandler. - - - :param active: The active of this EventHandler. # noqa: E501 - :type: bool - """ - - self._active = active - - @property - def evaluator_type(self): - """Gets the evaluator_type of this EventHandler. # noqa: E501 - - - :return: The evaluator_type of this EventHandler. # noqa: E501 - :rtype: str - """ - return self._evaluator_type - - @evaluator_type.setter - def evaluator_type(self, evaluator_type): - """Sets the evaluator_type of this EventHandler. - - - :param evaluator_type: The evaluator_type of this EventHandler. # noqa: E501 - :type: str - """ - - self._evaluator_type = evaluator_type - - @property - def description(self): - """Gets the description of this EventHandler. # noqa: E501 - - - :return: The description of this EventHandler. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this EventHandler. - - - :param description: The description of this EventHandler. # noqa: E501 - :type: str - """ - - self._description = description - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(EventHandler, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EventHandler): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["EventHandler"] diff --git a/src/conductor/client/http/models/event_log.py b/src/conductor/client/http/models/event_log.py new file mode 100644 index 00000000..765897e0 --- /dev/null +++ b/src/conductor/client/http/models/event_log.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.event_log_adapter import EventLogAdapter + +EventLog = EventLogAdapter + +__all__ = ["EventLog"] diff --git a/src/conductor/client/http/models/event_message.py b/src/conductor/client/http/models/event_message.py new file mode 100644 index 00000000..063e5e2b --- /dev/null +++ b/src/conductor/client/http/models/event_message.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.event_message_adapter import \ + EventMessageAdapter + +EventMessage = EventMessageAdapter + +__all__ = ["EventMessage"] diff --git a/src/conductor/client/http/models/extended_conductor_application.py b/src/conductor/client/http/models/extended_conductor_application.py new file mode 100644 index 00000000..5b4af624 --- /dev/null +++ b/src/conductor/client/http/models/extended_conductor_application.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.extended_conductor_application_adapter import \ + ExtendedConductorApplicationAdapter + +ExtendedConductorApplication = ExtendedConductorApplicationAdapter + +__all__ = ["ExtendedConductorApplication"] diff --git a/src/conductor/client/http/models/extended_event_execution.py b/src/conductor/client/http/models/extended_event_execution.py new file mode 100644 index 00000000..cfbc4bc5 --- /dev/null +++ b/src/conductor/client/http/models/extended_event_execution.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.extended_event_execution_adapter import \ + ExtendedEventExecutionAdapter + +ExtendedEventExecution = ExtendedEventExecutionAdapter + +__all__ = ["ExtendedEventExecution"] diff --git a/src/conductor/client/http/models/extended_secret.py b/src/conductor/client/http/models/extended_secret.py new file mode 100644 index 00000000..b011c999 --- /dev/null +++ b/src/conductor/client/http/models/extended_secret.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.extended_secret_adapter import \ + ExtendedSecretAdapter + +ExtendedSecret = ExtendedSecretAdapter + +__all__ = ["ExtendedSecret"] diff --git a/src/conductor/client/http/models/extended_task_def.py b/src/conductor/client/http/models/extended_task_def.py new file mode 100644 index 00000000..46d151b2 --- /dev/null +++ b/src/conductor/client/http/models/extended_task_def.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.extended_task_def_adapter import \ + ExtendedTaskDefAdapter + +ExtendedTaskDef = ExtendedTaskDefAdapter + +__all__ = ["ExtendedTaskDef"] diff --git a/src/conductor/client/http/models/extended_workflow_def.py b/src/conductor/client/http/models/extended_workflow_def.py new file mode 100644 index 00000000..8ca8354d --- /dev/null +++ b/src/conductor/client/http/models/extended_workflow_def.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.extended_workflow_def_adapter import \ + ExtendedWorkflowDefAdapter + +ExtendedWorkflowDef = ExtendedWorkflowDefAdapter + +__all__ = ["ExtendedWorkflowDef"] diff --git a/src/conductor/client/http/models/extension_range.py b/src/conductor/client/http/models/extension_range.py new file mode 100644 index 00000000..0b8fc1cd --- /dev/null +++ b/src/conductor/client/http/models/extension_range.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.extension_range_adapter import \ + ExtensionRangeAdapter + +ExtensionRange = ExtensionRangeAdapter + +__all__ = ["ExtensionRange"] diff --git a/src/conductor/client/http/models/extension_range_options.py b/src/conductor/client/http/models/extension_range_options.py new file mode 100644 index 00000000..8f1c2391 --- /dev/null +++ b/src/conductor/client/http/models/extension_range_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.extension_range_options_adapter import \ + ExtensionRangeOptionsAdapter + +ExtensionRangeOptions = ExtensionRangeOptionsAdapter + +__all__ = ["ExtensionRangeOptions"] diff --git a/src/conductor/client/http/models/extension_range_options_or_builder.py b/src/conductor/client/http/models/extension_range_options_or_builder.py new file mode 100644 index 00000000..8a8f6abf --- /dev/null +++ b/src/conductor/client/http/models/extension_range_options_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.extension_range_options_or_builder_adapter import \ + ExtensionRangeOptionsOrBuilderAdapter + +ExtensionRangeOptionsOrBuilder = ExtensionRangeOptionsOrBuilderAdapter + +__all__ = ["ExtensionRangeOptionsOrBuilder"] diff --git a/src/conductor/client/http/models/extension_range_or_builder.py b/src/conductor/client/http/models/extension_range_or_builder.py new file mode 100644 index 00000000..4abeb587 --- /dev/null +++ b/src/conductor/client/http/models/extension_range_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.extension_range_or_builder_adapter import \ + ExtensionRangeOrBuilderAdapter + +ExtensionRangeOrBuilder = ExtensionRangeOrBuilderAdapter + +__all__ = ["ExtensionRangeOrBuilder"] diff --git a/src/conductor/client/http/models/external_storage_location.py b/src/conductor/client/http/models/external_storage_location.py index 92912618..ecbae383 100644 --- a/src/conductor/client/http/models/external_storage_location.py +++ b/src/conductor/client/http/models/external_storage_location.py @@ -1,133 +1,6 @@ -import pprint -import six -from dataclasses import dataclass, field -from typing import Optional +from conductor.client.adapters.models.external_storage_location_adapter import \ + ExternalStorageLocationAdapter +ExternalStorageLocation = ExternalStorageLocationAdapter -@dataclass -class ExternalStorageLocation: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _uri: Optional[str] = field(default=None, repr=False) - _path: Optional[str] = field(default=None, repr=False) - - swagger_types = { - 'uri': 'str', - 'path': 'str' - } - - attribute_map = { - 'uri': 'uri', - 'path': 'path' - } - - def __init__(self, uri=None, path=None): # noqa: E501 - """ExternalStorageLocation - a model defined in Swagger""" # noqa: E501 - self._uri = None - self._path = None - self.discriminator = None - if uri is not None: - self.uri = uri - if path is not None: - self.path = path - - def __post_init__(self): - """Initialize after dataclass initialization""" - self.discriminator = None - - @property - def uri(self): - """Gets the uri of this ExternalStorageLocation. # noqa: E501 - - - :return: The uri of this ExternalStorageLocation. # noqa: E501 - :rtype: str - """ - return self._uri - - @uri.setter - def uri(self, uri): - """Sets the uri of this ExternalStorageLocation. - - - :param uri: The uri of this ExternalStorageLocation. # noqa: E501 - :type: str - """ - - self._uri = uri - - @property - def path(self): - """Gets the path of this ExternalStorageLocation. # noqa: E501 - - - :return: The path of this ExternalStorageLocation. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this ExternalStorageLocation. - - - :param path: The path of this ExternalStorageLocation. # noqa: E501 - :type: str - """ - - self._path = path - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ExternalStorageLocation, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ExternalStorageLocation): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["ExternalStorageLocation"] diff --git a/src/conductor/client/http/models/feature_set.py b/src/conductor/client/http/models/feature_set.py new file mode 100644 index 00000000..0354cf5e --- /dev/null +++ b/src/conductor/client/http/models/feature_set.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.feature_set_adapter import \ + FeatureSetAdapter + +FeatureSet = FeatureSetAdapter + +__all__ = ["FeatureSet"] diff --git a/src/conductor/client/http/models/feature_set_or_builder.py b/src/conductor/client/http/models/feature_set_or_builder.py new file mode 100644 index 00000000..1cb0168c --- /dev/null +++ b/src/conductor/client/http/models/feature_set_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.feature_set_or_builder_adapter import \ + FeatureSetOrBuilderAdapter + +FeatureSetOrBuilder = FeatureSetOrBuilderAdapter + +__all__ = ["FeatureSetOrBuilder"] diff --git a/src/conductor/client/http/models/field_descriptor.py b/src/conductor/client/http/models/field_descriptor.py new file mode 100644 index 00000000..85630c7b --- /dev/null +++ b/src/conductor/client/http/models/field_descriptor.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.field_descriptor_adapter import \ + FieldDescriptorAdapter + +FieldDescriptor = FieldDescriptorAdapter + +__all__ = ["FieldDescriptor"] diff --git a/src/conductor/client/http/models/field_descriptor_proto.py b/src/conductor/client/http/models/field_descriptor_proto.py new file mode 100644 index 00000000..2f443f56 --- /dev/null +++ b/src/conductor/client/http/models/field_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.field_descriptor_proto_adapter import \ + FieldDescriptorProtoAdapter + +FieldDescriptorProto = FieldDescriptorProtoAdapter + +__all__ = ["FieldDescriptorProto"] diff --git a/src/conductor/client/http/models/field_descriptor_proto_or_builder.py b/src/conductor/client/http/models/field_descriptor_proto_or_builder.py new file mode 100644 index 00000000..79edf6fd --- /dev/null +++ b/src/conductor/client/http/models/field_descriptor_proto_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.field_descriptor_proto_or_builder_adapter import \ + FieldDescriptorProtoOrBuilderAdapter + +FieldDescriptorProtoOrBuilder = FieldDescriptorProtoOrBuilderAdapter + +__all__ = ["FieldDescriptorProtoOrBuilder"] diff --git a/src/conductor/client/http/models/field_options.py b/src/conductor/client/http/models/field_options.py new file mode 100644 index 00000000..6f2d680f --- /dev/null +++ b/src/conductor/client/http/models/field_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.field_options_adapter import \ + FieldOptionsAdapter + +FieldOptions = FieldOptionsAdapter + +__all__ = ["FieldOptions"] diff --git a/src/conductor/client/http/models/field_options_or_builder.py b/src/conductor/client/http/models/field_options_or_builder.py new file mode 100644 index 00000000..3ed96655 --- /dev/null +++ b/src/conductor/client/http/models/field_options_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.field_options_or_builder_adapter import \ + FieldOptionsOrBuilderAdapter + +FieldOptionsOrBuilder = FieldOptionsOrBuilderAdapter + +__all__ = ["FieldOptionsOrBuilder"] diff --git a/src/conductor/client/http/models/file_descriptor.py b/src/conductor/client/http/models/file_descriptor.py new file mode 100644 index 00000000..f1f1daee --- /dev/null +++ b/src/conductor/client/http/models/file_descriptor.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.file_descriptor_adapter import \ + FileDescriptorAdapter + +FileDescriptor = FileDescriptorAdapter + +__all__ = ["FileDescriptor"] diff --git a/src/conductor/client/http/models/file_descriptor_proto.py b/src/conductor/client/http/models/file_descriptor_proto.py new file mode 100644 index 00000000..32eab661 --- /dev/null +++ b/src/conductor/client/http/models/file_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.file_descriptor_proto_adapter import \ + FileDescriptorProtoAdapter + +FileDescriptorProto = FileDescriptorProtoAdapter + +__all__ = ["FileDescriptorProto"] diff --git a/src/conductor/client/http/models/file_options.py b/src/conductor/client/http/models/file_options.py new file mode 100644 index 00000000..d0cc9950 --- /dev/null +++ b/src/conductor/client/http/models/file_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.file_options_adapter import \ + FileOptionsAdapter + +FileOptions = FileOptionsAdapter + +__all__ = ["FileOptions"] diff --git a/src/conductor/client/http/models/file_options_or_builder.py b/src/conductor/client/http/models/file_options_or_builder.py new file mode 100644 index 00000000..1d92225c --- /dev/null +++ b/src/conductor/client/http/models/file_options_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.file_options_or_builder_adapter import \ + FileOptionsOrBuilderAdapter + +FileOptionsOrBuilder = FileOptionsOrBuilderAdapter + +__all__ = ["FileOptionsOrBuilder"] diff --git a/src/conductor/client/http/models/generate_token_request.py b/src/conductor/client/http/models/generate_token_request.py index 54bd5dec..ae0271e0 100644 --- a/src/conductor/client/http/models/generate_token_request.py +++ b/src/conductor/client/http/models/generate_token_request.py @@ -1,132 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, asdict -from typing import Dict, List, Optional, Any +from conductor.client.adapters.models.generate_token_request_adapter import \ + GenerateTokenRequestAdapter +GenerateTokenRequest = GenerateTokenRequestAdapter -@dataclass -class GenerateTokenRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - key_id: Optional[str] = field(default=None) - key_secret: Optional[str] = field(default=None) - - # Class variables - swagger_types = { - 'key_id': 'str', - 'key_secret': 'str' - } - - attribute_map = { - 'key_id': 'keyId', - 'key_secret': 'keySecret' - } - - def __init__(self, key_id=None, key_secret=None): # noqa: E501 - """GenerateTokenRequest - a model defined in Swagger""" # noqa: E501 - self._key_id = None - self._key_secret = None - self.discriminator = None - self.key_id = key_id - self.key_secret = key_secret - - def __post_init__(self): - """Post initialization for dataclass""" - # This is intentionally left empty as the original __init__ handles initialization - pass - - @property - def key_id(self): - """Gets the key_id of this GenerateTokenRequest. # noqa: E501 - - - :return: The key_id of this GenerateTokenRequest. # noqa: E501 - :rtype: str - """ - return self._key_id - - @key_id.setter - def key_id(self, key_id): - """Sets the key_id of this GenerateTokenRequest. - - - :param key_id: The key_id of this GenerateTokenRequest. # noqa: E501 - :type: str - """ - self._key_id = key_id - - @property - def key_secret(self): - """Gets the key_secret of this GenerateTokenRequest. # noqa: E501 - - - :return: The key_secret of this GenerateTokenRequest. # noqa: E501 - :rtype: str - """ - return self._key_secret - - @key_secret.setter - def key_secret(self, key_secret): - """Sets the key_secret of this GenerateTokenRequest. - - - :param key_secret: The key_secret of this GenerateTokenRequest. # noqa: E501 - :type: str - """ - self._key_secret = key_secret - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(GenerateTokenRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, GenerateTokenRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["GenerateTokenRequest"] diff --git a/src/conductor/client/http/models/granted_access.py b/src/conductor/client/http/models/granted_access.py new file mode 100644 index 00000000..8ec4eea0 --- /dev/null +++ b/src/conductor/client/http/models/granted_access.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.granted_access_adapter import \ + GrantedAccessAdapter + +GrantedAccess = GrantedAccessAdapter + +__all__ = ["GrantedAccess"] diff --git a/src/conductor/client/http/models/granted_access_response.py b/src/conductor/client/http/models/granted_access_response.py new file mode 100644 index 00000000..4f067282 --- /dev/null +++ b/src/conductor/client/http/models/granted_access_response.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.granted_access_response_adapter import \ + GrantedAccessResponseAdapter + +GrantedAccessResponse = GrantedAccessResponseAdapter + +__all__ = ["GrantedAccessResponse"] diff --git a/src/conductor/client/http/models/group.py b/src/conductor/client/http/models/group.py index f36d3b79..46c4bfff 100644 --- a/src/conductor/client/http/models/group.py +++ b/src/conductor/client/http/models/group.py @@ -1,202 +1,5 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields, InitVar -from typing import Dict, List, Optional, Any -from deprecated import deprecated +from conductor.client.adapters.models.group_adapter import GroupAdapter +Group = GroupAdapter -@dataclass -class Group: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'description': 'str', - 'roles': 'list[Role]', - 'default_access': 'dict(str, list[str])' - } - - attribute_map = { - 'id': 'id', - 'description': 'description', - 'roles': 'roles', - 'default_access': 'defaultAccess' - } - - id: Optional[str] = field(default=None) - description: Optional[str] = field(default=None) - roles: Optional[List['Role']] = field(default=None) - default_access: Optional[Dict[str, List[str]]] = field(default=None) - - # Private backing fields for properties - _id: Optional[str] = field(default=None, init=False, repr=False) - _description: Optional[str] = field(default=None, init=False, repr=False) - _roles: Optional[List['Role']] = field(default=None, init=False, repr=False) - _default_access: Optional[Dict[str, List[str]]] = field(default=None, init=False, repr=False) - - def __init__(self, id=None, description=None, roles=None, default_access=None): # noqa: E501 - """Group - a model defined in Swagger""" # noqa: E501 - self._id = None - self._description = None - self._roles = None - self._default_access = None - self.discriminator = None - if id is not None: - self.id = id - if description is not None: - self.description = description - if roles is not None: - self.roles = roles - if default_access is not None: - self.default_access = default_access - - def __post_init__(self): - # Transfer values from dataclass fields to property backing fields - if self.id is not None: - self._id = self.id - if self.description is not None: - self._description = self.description - if self.roles is not None: - self._roles = self.roles - if self.default_access is not None: - self._default_access = self.default_access - - @property - def id(self): - """Gets the id of this Group. # noqa: E501 - - - :return: The id of this Group. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Group. - - - :param id: The id of this Group. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def description(self): - """Gets the description of this Group. # noqa: E501 - - - :return: The description of this Group. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this Group. - - - :param description: The description of this Group. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def roles(self): - """Gets the roles of this Group. # noqa: E501 - - - :return: The roles of this Group. # noqa: E501 - :rtype: list[Role] - """ - return self._roles - - @roles.setter - def roles(self, roles): - """Sets the roles of this Group. - - - :param roles: The roles of this Group. # noqa: E501 - :type: list[Role] - """ - - self._roles = roles - - @property - def default_access(self): - """Gets the default_access of this Group. # noqa: E501 - - - :return: The default_access of this Group. # noqa: E501 - :rtype: dict(str, list[str]) - """ - return self._default_access - - @default_access.setter - def default_access(self, default_access): - """Sets the default_access of this Group. - - - :param default_access: The default_access of this Group. # noqa: E501 - :type: dict(str, list[str]) - """ - - self._default_access = default_access - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Group, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Group): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["Group"] diff --git a/src/conductor/client/http/models/handled_event_response.py b/src/conductor/client/http/models/handled_event_response.py new file mode 100644 index 00000000..b1ffbbc2 --- /dev/null +++ b/src/conductor/client/http/models/handled_event_response.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.handled_event_response_adapter import \ + HandledEventResponseAdapter + +HandledEventResponse = HandledEventResponseAdapter + +__all__ = ["HandledEventResponse"] diff --git a/src/conductor/client/http/models/health.py b/src/conductor/client/http/models/health.py index a29a0776..9b7fe865 100644 --- a/src/conductor/client/http/models/health.py +++ b/src/conductor/client/http/models/health.py @@ -1,151 +1,3 @@ -import pprint -import re # noqa: F401 +from conductor.client.adapters.models.health import Health -import six - - -class Health(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'details': 'dict(str, object)', - 'error_message': 'str', - 'healthy': 'bool' - } - - attribute_map = { - 'details': 'details', - 'error_message': 'errorMessage', - 'healthy': 'healthy' - } - - def __init__(self, details=None, error_message=None, healthy=None): # noqa: E501 - """Health - a model defined in Swagger""" # noqa: E501 - self._details = None - self._error_message = None - self._healthy = None - self.discriminator = None - if details is not None: - self.details = details - if error_message is not None: - self.error_message = error_message - if healthy is not None: - self.healthy = healthy - - @property - def details(self): - """Gets the details of this Health. # noqa: E501 - - - :return: The details of this Health. # noqa: E501 - :rtype: dict(str, object) - """ - return self._details - - @details.setter - def details(self, details): - """Sets the details of this Health. - - - :param details: The details of this Health. # noqa: E501 - :type: dict(str, object) - """ - - self._details = details - - @property - def error_message(self): - """Gets the error_message of this Health. # noqa: E501 - - - :return: The error_message of this Health. # noqa: E501 - :rtype: str - """ - return self._error_message - - @error_message.setter - def error_message(self, error_message): - """Sets the error_message of this Health. - - - :param error_message: The error_message of this Health. # noqa: E501 - :type: str - """ - - self._error_message = error_message - - @property - def healthy(self): - """Gets the healthy of this Health. # noqa: E501 - - - :return: The healthy of this Health. # noqa: E501 - :rtype: bool - """ - return self._healthy - - @healthy.setter - def healthy(self, healthy): - """Sets the healthy of this Health. - - - :param healthy: The healthy of this Health. # noqa: E501 - :type: bool - """ - - self._healthy = healthy - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Health, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Health): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other +__all__ = ["Health"] diff --git a/src/conductor/client/http/models/health_check_status.py b/src/conductor/client/http/models/health_check_status.py index bc0b9115..ac0682fb 100644 --- a/src/conductor/client/http/models/health_check_status.py +++ b/src/conductor/client/http/models/health_check_status.py @@ -1,151 +1,4 @@ -import pprint -import re # noqa: F401 +from conductor.client.adapters.models.health_check_status import \ + HealthCheckStatus -import six - - -class HealthCheckStatus(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'health_results': 'list[Health]', - 'suppressed_health_results': 'list[Health]', - 'healthy': 'bool' - } - - attribute_map = { - 'health_results': 'healthResults', - 'suppressed_health_results': 'suppressedHealthResults', - 'healthy': 'healthy' - } - - def __init__(self, health_results=None, suppressed_health_results=None, healthy=None): # noqa: E501 - """HealthCheckStatus - a model defined in Swagger""" # noqa: E501 - self._health_results = None - self._suppressed_health_results = None - self._healthy = None - self.discriminator = None - if health_results is not None: - self.health_results = health_results - if suppressed_health_results is not None: - self.suppressed_health_results = suppressed_health_results - if healthy is not None: - self.healthy = healthy - - @property - def health_results(self): - """Gets the health_results of this HealthCheckStatus. # noqa: E501 - - - :return: The health_results of this HealthCheckStatus. # noqa: E501 - :rtype: list[Health] - """ - return self._health_results - - @health_results.setter - def health_results(self, health_results): - """Sets the health_results of this HealthCheckStatus. - - - :param health_results: The health_results of this HealthCheckStatus. # noqa: E501 - :type: list[Health] - """ - - self._health_results = health_results - - @property - def suppressed_health_results(self): - """Gets the suppressed_health_results of this HealthCheckStatus. # noqa: E501 - - - :return: The suppressed_health_results of this HealthCheckStatus. # noqa: E501 - :rtype: list[Health] - """ - return self._suppressed_health_results - - @suppressed_health_results.setter - def suppressed_health_results(self, suppressed_health_results): - """Sets the suppressed_health_results of this HealthCheckStatus. - - - :param suppressed_health_results: The suppressed_health_results of this HealthCheckStatus. # noqa: E501 - :type: list[Health] - """ - - self._suppressed_health_results = suppressed_health_results - - @property - def healthy(self): - """Gets the healthy of this HealthCheckStatus. # noqa: E501 - - - :return: The healthy of this HealthCheckStatus. # noqa: E501 - :rtype: bool - """ - return self._healthy - - @healthy.setter - def healthy(self, healthy): - """Sets the healthy of this HealthCheckStatus. - - - :param healthy: The healthy of this HealthCheckStatus. # noqa: E501 - :type: bool - """ - - self._healthy = healthy - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(HealthCheckStatus, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HealthCheckStatus): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other +__all__ = ["HealthCheckStatus"] diff --git a/src/conductor/client/http/models/incoming_bpmn_file.py b/src/conductor/client/http/models/incoming_bpmn_file.py new file mode 100644 index 00000000..3b9281e8 --- /dev/null +++ b/src/conductor/client/http/models/incoming_bpmn_file.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.incoming_bpmn_file_adapter import \ + IncomingBpmnFileAdapter + +IncomingBpmnFile = IncomingBpmnFileAdapter + +__all__ = ["IncomingBpmnFile"] diff --git a/src/conductor/client/http/models/integration.py b/src/conductor/client/http/models/integration.py index 5562581a..734ca851 100644 --- a/src/conductor/client/http/models/integration.py +++ b/src/conductor/client/http/models/integration.py @@ -1,431 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import Dict, List, Optional, Any -from deprecated import deprecated +from conductor.client.adapters.models.integration_adapter import \ + IntegrationAdapter +Integration = IntegrationAdapter -@dataclass -class Integration: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _category: Optional[str] = field(default=None, init=False) - _configuration: Optional[Dict[str, object]] = field(default=None, init=False) - _created_by: Optional[str] = field(default=None, init=False) - _created_on: Optional[int] = field(default=None, init=False) - _description: Optional[str] = field(default=None, init=False) - _enabled: Optional[bool] = field(default=None, init=False) - _models_count: Optional[int] = field(default=None, init=False) - _name: Optional[str] = field(default=None, init=False) - _tags: Optional[List['TagObject']] = field(default=None, init=False) - _type: Optional[str] = field(default=None, init=False) - _updated_by: Optional[str] = field(default=None, init=False) - _updated_on: Optional[int] = field(default=None, init=False) - _apis: Optional[List['IntegrationApi']] = field(default=None, init=False) - - swagger_types = { - 'category': 'str', - 'configuration': 'dict(str, object)', - 'created_by': 'str', - 'created_on': 'int', - 'description': 'str', - 'enabled': 'bool', - 'models_count': 'int', - 'name': 'str', - 'tags': 'list[TagObject]', - 'type': 'str', - 'updated_by': 'str', - 'updated_on': 'int', - 'apis': 'list[IntegrationApi]' - } - - attribute_map = { - 'category': 'category', - 'configuration': 'configuration', - 'created_by': 'createdBy', - 'created_on': 'createdOn', - 'description': 'description', - 'enabled': 'enabled', - 'models_count': 'modelsCount', - 'name': 'name', - 'tags': 'tags', - 'type': 'type', - 'updated_by': 'updatedBy', - 'updated_on': 'updatedOn', - 'apis': 'apis' - } - - def __init__(self, category=None, configuration=None, created_by=None, created_on=None, description=None, - enabled=None, models_count=None, name=None, tags=None, type=None, updated_by=None, - updated_on=None, apis=None): # noqa: E501 - """Integration - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - if category is not None: - self.category = category - if configuration is not None: - self.configuration = configuration - if created_by is not None: - self.created_by = created_by - if created_on is not None: - self.created_on = created_on - if description is not None: - self.description = description - if enabled is not None: - self.enabled = enabled - if models_count is not None: - self.models_count = models_count - if name is not None: - self.name = name - if tags is not None: - self.tags = tags - if type is not None: - self.type = type - if updated_by is not None: - self.updated_by = updated_by - if updated_on is not None: - self.updated_on = updated_on - if apis is not None: - self.apis = apis - - def __post_init__(self): - """Post initialization for dataclass""" - pass - - @property - def category(self): - """Gets the category of this Integration. # noqa: E501 - - - :return: The category of this Integration. # noqa: E501 - :rtype: str - """ - return self._category - - @category.setter - def category(self, category): - """Sets the category of this Integration. - - - :param category: The category of this Integration. # noqa: E501 - :type: str - """ - allowed_values = ["API", "AI_MODEL", "VECTOR_DB", "RELATIONAL_DB"] # noqa: E501 - if category not in allowed_values: - raise ValueError( - "Invalid value for `category` ({0}), must be one of {1}" # noqa: E501 - .format(category, allowed_values) - ) - - self._category = category - - @property - def configuration(self): - """Gets the configuration of this Integration. # noqa: E501 - - - :return: The configuration of this Integration. # noqa: E501 - :rtype: dict(str, object) - """ - return self._configuration - - @configuration.setter - def configuration(self, configuration): - """Sets the configuration of this Integration. - - - :param configuration: The configuration of this Integration. # noqa: E501 - :type: dict(str, object) - """ - - self._configuration = configuration - - @property - def created_by(self): - """Gets the created_by of this Integration. # noqa: E501 - - - :return: The created_by of this Integration. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this Integration. - - - :param created_by: The created_by of this Integration. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - def created_on(self): - """Gets the created_on of this Integration. # noqa: E501 - - - :return: The created_on of this Integration. # noqa: E501 - :rtype: int - """ - return self._created_on - - @created_on.setter - def created_on(self, created_on): - """Sets the created_on of this Integration. - - - :param created_on: The created_on of this Integration. # noqa: E501 - :type: int - """ - - self._created_on = created_on - - @property - def description(self): - """Gets the description of this Integration. # noqa: E501 - - - :return: The description of this Integration. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this Integration. - - - :param description: The description of this Integration. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def enabled(self): - """Gets the enabled of this Integration. # noqa: E501 - - - :return: The enabled of this Integration. # noqa: E501 - :rtype: bool - """ - return self._enabled - - @enabled.setter - def enabled(self, enabled): - """Sets the enabled of this Integration. - - - :param enabled: The enabled of this Integration. # noqa: E501 - :type: bool - """ - - self._enabled = enabled - - @property - def models_count(self): - """Gets the models_count of this Integration. # noqa: E501 - - - :return: The models_count of this Integration. # noqa: E501 - :rtype: int - """ - return self._models_count - - @models_count.setter - def models_count(self, models_count): - """Sets the models_count of this Integration. - - - :param models_count: The models_count of this Integration. # noqa: E501 - :type: int - """ - - self._models_count = models_count - - @property - def name(self): - """Gets the name of this Integration. # noqa: E501 - - - :return: The name of this Integration. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Integration. - - - :param name: The name of this Integration. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def tags(self): - """Gets the tags of this Integration. # noqa: E501 - - - :return: The tags of this Integration. # noqa: E501 - :rtype: list[TagObject] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Integration. - - - :param tags: The tags of this Integration. # noqa: E501 - :type: list[TagObject] - """ - - self._tags = tags - - @property - def type(self): - """Gets the type of this Integration. # noqa: E501 - - - :return: The type of this Integration. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this Integration. - - - :param type: The type of this Integration. # noqa: E501 - :type: str - """ - - self._type = type - - @property - @deprecated - def updated_by(self): - """Gets the updated_by of this Integration. # noqa: E501 - - - :return: The updated_by of this Integration. # noqa: E501 - :rtype: str - """ - return self._updated_by - - @updated_by.setter - @deprecated - def updated_by(self, updated_by): - """Sets the updated_by of this Integration. - - - :param updated_by: The updated_by of this Integration. # noqa: E501 - :type: str - """ - - self._updated_by = updated_by - - @property - @deprecated - def updated_on(self): - """Gets the updated_on of this Integration. # noqa: E501 - - - :return: The updated_on of this Integration. # noqa: E501 - :rtype: int - """ - return self._updated_on - - @updated_on.setter - @deprecated - def updated_on(self, updated_on): - """Sets the updated_on of this Integration. - - - :param updated_on: The updated_on of this Integration. # noqa: E501 - :type: int - """ - - self._updated_on = updated_on - - @property - def apis(self): - """Gets the apis of this Integration. # noqa: E501 - - - :return: The apis of this Integration. # noqa: E501 - :rtype: list[IntegrationApi] - """ - return self._apis - - @apis.setter - def apis(self, apis): - """Sets the apis of this Integration. - - - :param apis: The apis of this Integration. # noqa: E501 - :type: list[IntegrationApi] - """ - - self._apis = apis - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Integration, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Integration): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["Integration"] diff --git a/src/conductor/client/http/models/integration_api.py b/src/conductor/client/http/models/integration_api.py index 2fbaf806..cf8f1151 100644 --- a/src/conductor/client/http/models/integration_api.py +++ b/src/conductor/client/http/models/integration_api.py @@ -1,358 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import Dict, List, Optional, Any -from deprecated import deprecated +from conductor.client.adapters.models.integration_api_adapter import \ + IntegrationApiAdapter +IntegrationApi = IntegrationApiAdapter -@dataclass -class IntegrationApi: - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _api: Optional[str] = field(default=None, repr=False) - _configuration: Optional[Dict[str, Any]] = field(default=None, repr=False) - _created_by: Optional[str] = field(default=None, repr=False) - _created_on: Optional[int] = field(default=None, repr=False) - _description: Optional[str] = field(default=None, repr=False) - _enabled: Optional[bool] = field(default=None, repr=False) - _integration_name: Optional[str] = field(default=None, repr=False) - _tags: Optional[List['TagObject']] = field(default=None, repr=False) - _updated_by: Optional[str] = field(default=None, repr=False) - _updated_on: Optional[int] = field(default=None, repr=False) - - swagger_types = { - 'api': 'str', - 'configuration': 'dict(str, object)', - 'created_by': 'str', - 'created_on': 'int', - 'description': 'str', - 'enabled': 'bool', - 'integration_name': 'str', - 'tags': 'list[TagObject]', - 'updated_by': 'str', - 'updated_on': 'int' - } - - attribute_map = { - 'api': 'api', - 'configuration': 'configuration', - 'created_by': 'createdBy', - 'created_on': 'createdOn', - 'description': 'description', - 'enabled': 'enabled', - 'integration_name': 'integrationName', - 'tags': 'tags', - 'updated_by': 'updatedBy', - 'updated_on': 'updatedOn' - } - - discriminator: Optional[str] = field(default=None, repr=False) - - def __init__(self, api=None, configuration=None, created_by=None, created_on=None, description=None, enabled=None, - integration_name=None, tags=None, updated_by=None, updated_on=None): # noqa: E501 - """IntegrationApi - a model defined in Swagger""" # noqa: E501 - self._api = None - self._configuration = None - self._created_by = None - self._created_on = None - self._description = None - self._enabled = None - self._integration_name = None - self._tags = None - self._updated_by = None - self._updated_on = None - self.discriminator = None - if api is not None: - self.api = api - if configuration is not None: - self.configuration = configuration - if created_by is not None: - self.created_by = created_by - if created_on is not None: - self.created_on = created_on - if description is not None: - self.description = description - if enabled is not None: - self.enabled = enabled - if integration_name is not None: - self.integration_name = integration_name - if tags is not None: - self.tags = tags - if updated_by is not None: - self.updated_by = updated_by - if updated_on is not None: - self.updated_on = updated_on - - def __post_init__(self): - """Post initialization for dataclass""" - pass - - @property - def api(self): - """Gets the api of this IntegrationApi. # noqa: E501 - - - :return: The api of this IntegrationApi. # noqa: E501 - :rtype: str - """ - return self._api - - @api.setter - def api(self, api): - """Sets the api of this IntegrationApi. - - - :param api: The api of this IntegrationApi. # noqa: E501 - :type: str - """ - - self._api = api - - @property - def configuration(self): - """Gets the configuration of this IntegrationApi. # noqa: E501 - - - :return: The configuration of this IntegrationApi. # noqa: E501 - :rtype: dict(str, object) - """ - return self._configuration - - @configuration.setter - def configuration(self, configuration): - """Sets the configuration of this IntegrationApi. - - - :param configuration: The configuration of this IntegrationApi. # noqa: E501 - :type: dict(str, object) - """ - - self._configuration = configuration - - @property - @deprecated - def created_by(self): - """Gets the created_by of this IntegrationApi. # noqa: E501 - - - :return: The created_by of this IntegrationApi. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - @deprecated - def created_by(self, created_by): - """Sets the created_by of this IntegrationApi. - - - :param created_by: The created_by of this IntegrationApi. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - @deprecated - def created_on(self): - """Gets the created_on of this IntegrationApi. # noqa: E501 - - - :return: The created_on of this IntegrationApi. # noqa: E501 - :rtype: int - """ - return self._created_on - - @created_on.setter - @deprecated - def created_on(self, created_on): - """Sets the created_on of this IntegrationApi. - - - :param created_on: The created_on of this IntegrationApi. # noqa: E501 - :type: int - """ - - self._created_on = created_on - - @property - def description(self): - """Gets the description of this IntegrationApi. # noqa: E501 - - - :return: The description of this IntegrationApi. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this IntegrationApi. - - - :param description: The description of this IntegrationApi. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def enabled(self): - """Gets the enabled of this IntegrationApi. # noqa: E501 - - - :return: The enabled of this IntegrationApi. # noqa: E501 - :rtype: bool - """ - return self._enabled - - @enabled.setter - def enabled(self, enabled): - """Sets the enabled of this IntegrationApi. - - - :param enabled: The enabled of this IntegrationApi. # noqa: E501 - :type: bool - """ - - self._enabled = enabled - - @property - def integration_name(self): - """Gets the integration_name of this IntegrationApi. # noqa: E501 - - - :return: The integration_name of this IntegrationApi. # noqa: E501 - :rtype: str - """ - return self._integration_name - - @integration_name.setter - def integration_name(self, integration_name): - """Sets the integration_name of this IntegrationApi. - - - :param integration_name: The integration_name of this IntegrationApi. # noqa: E501 - :type: str - """ - - self._integration_name = integration_name - - @property - def tags(self): - """Gets the tags of this IntegrationApi. # noqa: E501 - - - :return: The tags of this IntegrationApi. # noqa: E501 - :rtype: list[TagObject] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this IntegrationApi. - - - :param tags: The tags of this IntegrationApi. # noqa: E501 - :type: list[TagObject] - """ - - self._tags = tags - - @property - @deprecated - def updated_by(self): - """Gets the updated_by of this IntegrationApi. # noqa: E501 - - - :return: The updated_by of this IntegrationApi. # noqa: E501 - :rtype: str - """ - return self._updated_by - - @updated_by.setter - @deprecated - def updated_by(self, updated_by): - """Sets the updated_by of this IntegrationApi. - - - :param updated_by: The updated_by of this IntegrationApi. # noqa: E501 - :type: str - """ - - self._updated_by = updated_by - - @property - @deprecated - def updated_on(self): - """Gets the updated_on of this IntegrationApi. # noqa: E501 - - - :return: The updated_on of this IntegrationApi. # noqa: E501 - :rtype: int - """ - return self._updated_on - - @updated_on.setter - @deprecated - def updated_on(self, updated_on): - """Sets the updated_on of this IntegrationApi. - - - :param updated_on: The updated_on of this IntegrationApi. # noqa: E501 - :type: int - """ - - self._updated_on = updated_on - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(IntegrationApi, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, IntegrationApi): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["IntegrationApi"] diff --git a/src/conductor/client/http/models/integration_api_update.py b/src/conductor/client/http/models/integration_api_update.py index 302baf94..820b2c24 100644 --- a/src/conductor/client/http/models/integration_api_update.py +++ b/src/conductor/client/http/models/integration_api_update.py @@ -1,232 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import Dict, Any, Optional, List, Union -from enum import Enum -from deprecated import deprecated +from conductor.client.adapters.models.integration_api_update_adapter import \ + IntegrationApiUpdateAdapter +IntegrationApiUpdate = IntegrationApiUpdateAdapter -class Frequency(str, Enum): - DAILY = "daily" - WEEKLY = "weekly" - MONTHLY = "monthly" - - @classmethod - def from_value(cls, value: str) -> 'Frequency': - for freq in cls: - if freq.value.lower() == value.lower(): - return freq - raise ValueError(f"Unknown frequency: {value}") - - -@dataclass -class IntegrationApiUpdate: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _configuration: Optional[Dict[str, Any]] = field(default=None, init=False) - _description: Optional[str] = field(default=None, init=False) - _enabled: Optional[bool] = field(default=None, init=False) - _max_tokens: Optional[int] = field(default=None, init=False) - _frequency: Optional[Frequency] = field(default=None, init=False) - - swagger_types = { - 'configuration': 'dict(str, object)', - 'description': 'str', - 'enabled': 'bool', - 'max_tokens': 'int', - 'frequency': 'Frequency' - } - - attribute_map = { - 'configuration': 'configuration', - 'description': 'description', - 'enabled': 'enabled', - 'max_tokens': 'maxTokens', - 'frequency': 'frequency' - } - - def __init__(self, configuration=None, description=None, enabled=None, max_tokens=None, frequency=None): # noqa: E501 - """IntegrationApiUpdate - a model defined in Swagger""" # noqa: E501 - self._configuration = None - self._description = None - self._enabled = None - self._max_tokens = None - self._frequency = None - self.discriminator = None - if configuration is not None: - self.configuration = configuration - if description is not None: - self.description = description - if enabled is not None: - self.enabled = enabled - if max_tokens is not None: - self.max_tokens = max_tokens - if frequency is not None: - self.frequency = frequency - - def __post_init__(self): - """Initialize fields after dataclass initialization""" - pass - - @property - def configuration(self): - """Gets the configuration of this IntegrationApiUpdate. # noqa: E501 - - - :return: The configuration of this IntegrationApiUpdate. # noqa: E501 - :rtype: dict(str, object) - """ - return self._configuration - - @configuration.setter - def configuration(self, configuration): - """Sets the configuration of this IntegrationApiUpdate. - - - :param configuration: The configuration of this IntegrationApiUpdate. # noqa: E501 - :type: dict(str, object) - """ - - self._configuration = configuration - - @property - def description(self): - """Gets the description of this IntegrationApiUpdate. # noqa: E501 - - - :return: The description of this IntegrationApiUpdate. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this IntegrationApiUpdate. - - - :param description: The description of this IntegrationApiUpdate. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def enabled(self): - """Gets the enabled of this IntegrationApiUpdate. # noqa: E501 - - - :return: The enabled of this IntegrationApiUpdate. # noqa: E501 - :rtype: bool - """ - return self._enabled - - @enabled.setter - def enabled(self, enabled): - """Sets the enabled of this IntegrationApiUpdate. - - - :param enabled: The enabled of this IntegrationApiUpdate. # noqa: E501 - :type: bool - """ - - self._enabled = enabled - - @property - def max_tokens(self): - """Gets the max_tokens of this IntegrationApiUpdate. # noqa: E501 - - - :return: The max_tokens of this IntegrationApiUpdate. # noqa: E501 - :rtype: int - """ - return self._max_tokens - - @max_tokens.setter - def max_tokens(self, max_tokens): - """Sets the max_tokens of this IntegrationApiUpdate. - - - :param max_tokens: The max_tokens of this IntegrationApiUpdate. # noqa: E501 - :type: int - """ - - self._max_tokens = max_tokens - - @property - def frequency(self): - """Gets the frequency of this IntegrationApiUpdate. # noqa: E501 - - - :return: The frequency of this IntegrationApiUpdate. # noqa: E501 - :rtype: Frequency - """ - return self._frequency - - @frequency.setter - def frequency(self, frequency): - """Sets the frequency of this IntegrationApiUpdate. - - - :param frequency: The frequency of this IntegrationApiUpdate. # noqa: E501 - :type: Frequency - """ - if isinstance(frequency, str): - frequency = Frequency.from_value(frequency) - - self._frequency = frequency - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(IntegrationApiUpdate, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, IntegrationApiUpdate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["IntegrationApiUpdate"] diff --git a/src/conductor/client/http/models/integration_def.py b/src/conductor/client/http/models/integration_def.py index 55ce669c..d36595cc 100644 --- a/src/conductor/client/http/models/integration_def.py +++ b/src/conductor/client/http/models/integration_def.py @@ -1,358 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, List, Optional, Any -from deprecated import deprecated +from conductor.client.adapters.models.integration_def_adapter import \ + IntegrationDefAdapter +IntegrationDef = IntegrationDefAdapter -@dataclass -class IntegrationDef: - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'category': 'str', - 'category_label': 'str', - 'configuration': 'list[IntegrationDefFormField]', - 'description': 'str', - 'enabled': 'bool', - 'icon_name': 'str', - 'name': 'str', - 'tags': 'list[str]', - 'type': 'str' - } - - attribute_map = { - 'category': 'category', - 'category_label': 'categoryLabel', - 'configuration': 'configuration', - 'description': 'description', - 'enabled': 'enabled', - 'icon_name': 'iconName', - 'name': 'name', - 'tags': 'tags', - 'type': 'type' - } - - category: Optional[str] = field(default=None) - category_label: Optional[str] = field(default=None) - description: Optional[str] = field(default=None) - enabled: Optional[bool] = field(default=None) - icon_name: Optional[str] = field(default=None) - name: Optional[str] = field(default=None) - tags: Optional[List[str]] = field(default=None) - type: Optional[str] = field(default=None) - configuration: Optional[List[Any]] = field(default=None) - - # Private backing fields for properties - _category: Optional[str] = field(init=False, repr=False, default=None) - _category_label: Optional[str] = field(init=False, repr=False, default=None) - _description: Optional[str] = field(init=False, repr=False, default=None) - _enabled: Optional[bool] = field(init=False, repr=False, default=None) - _icon_name: Optional[str] = field(init=False, repr=False, default=None) - _name: Optional[str] = field(init=False, repr=False, default=None) - _tags: Optional[List[str]] = field(init=False, repr=False, default=None) - _type: Optional[str] = field(init=False, repr=False, default=None) - _configuration: Optional[List[Any]] = field(init=False, repr=False, default=None) - - # For backward compatibility - discriminator: Optional[str] = field(init=False, repr=False, default=None) - - def __init__(self, category=None, category_label=None, configuration=None, description=None, enabled=None, - icon_name=None, name=None, tags=None, type=None): # noqa: E501 - """IntegrationDef - a model defined in Swagger""" # noqa: E501 - self._category = None - self._category_label = None - self._configuration = None - self._description = None - self._enabled = None - self._icon_name = None - self._name = None - self._tags = None - self._type = None - self.discriminator = None - if category is not None: - self.category = category - if category_label is not None: - self.category_label = category_label - if configuration is not None: - self.configuration = configuration - if description is not None: - self.description = description - if enabled is not None: - self.enabled = enabled - if icon_name is not None: - self.icon_name = icon_name - if name is not None: - self.name = name - if tags is not None: - self.tags = tags - if type is not None: - self.type = type - - def __post_init__(self): - """Initialize properties after dataclass initialization""" - if self.category is not None: - self.category = self.category - if self.category_label is not None: - self.category_label = self.category_label - if self.configuration is not None: - self.configuration = self.configuration - if self.description is not None: - self.description = self.description - if self.enabled is not None: - self.enabled = self.enabled - if self.icon_name is not None: - self.icon_name = self.icon_name - if self.name is not None: - self.name = self.name - if self.tags is not None: - self.tags = self.tags - if self.type is not None: - self.type = self.type - - @property - def category(self): - """Gets the category of this IntegrationDef. # noqa: E501 - - - :return: The category of this IntegrationDef. # noqa: E501 - :rtype: str - """ - return self._category - - @category.setter - def category(self, category): - """Sets the category of this IntegrationDef. - - - :param category: The category of this IntegrationDef. # noqa: E501 - :type: str - """ - allowed_values = ["API", "AI_MODEL", "VECTOR_DB", "RELATIONAL_DB"] # noqa: E501 - if category not in allowed_values: - raise ValueError( - "Invalid value for `category` ({0}), must be one of {1}" # noqa: E501 - .format(category, allowed_values) - ) - - self._category = category - - @property - def category_label(self): - """Gets the category_label of this IntegrationDef. # noqa: E501 - - - :return: The category_label of this IntegrationDef. # noqa: E501 - :rtype: str - """ - return self._category_label - - @category_label.setter - def category_label(self, category_label): - """Sets the category_label of this IntegrationDef. - - - :param category_label: The category_label of this IntegrationDef. # noqa: E501 - :type: str - """ - - self._category_label = category_label - - @property - def configuration(self): - """Gets the configuration of this IntegrationDef. # noqa: E501 - - - :return: The configuration of this IntegrationDef. # noqa: E501 - :rtype: list[IntegrationDefFormField] - """ - return self._configuration - - @configuration.setter - def configuration(self, configuration): - """Sets the configuration of this IntegrationDef. - - - :param configuration: The configuration of this IntegrationDef. # noqa: E501 - :type: list[IntegrationDefFormField] - """ - - self._configuration = configuration - - @property - def description(self): - """Gets the description of this IntegrationDef. # noqa: E501 - - - :return: The description of this IntegrationDef. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this IntegrationDef. - - - :param description: The description of this IntegrationDef. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def enabled(self): - """Gets the enabled of this IntegrationDef. # noqa: E501 - - - :return: The enabled of this IntegrationDef. # noqa: E501 - :rtype: bool - """ - return self._enabled - - @enabled.setter - def enabled(self, enabled): - """Sets the enabled of this IntegrationDef. - - - :param enabled: The enabled of this IntegrationDef. # noqa: E501 - :type: bool - """ - - self._enabled = enabled - - @property - def icon_name(self): - """Gets the icon_name of this IntegrationDef. # noqa: E501 - - - :return: The icon_name of this IntegrationDef. # noqa: E501 - :rtype: str - """ - return self._icon_name - - @icon_name.setter - def icon_name(self, icon_name): - """Sets the icon_name of this IntegrationDef. - - - :param icon_name: The icon_name of this IntegrationDef. # noqa: E501 - :type: str - """ - - self._icon_name = icon_name - - @property - def name(self): - """Gets the name of this IntegrationDef. # noqa: E501 - - - :return: The name of this IntegrationDef. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this IntegrationDef. - - - :param name: The name of this IntegrationDef. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def tags(self): - """Gets the tags of this IntegrationDef. # noqa: E501 - - - :return: The tags of this IntegrationDef. # noqa: E501 - :rtype: list[str] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this IntegrationDef. - - - :param tags: The tags of this IntegrationDef. # noqa: E501 - :type: list[str] - """ - - self._tags = tags - - @property - def type(self): - """Gets the type of this IntegrationDef. # noqa: E501 - - - :return: The type of this IntegrationDef. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this IntegrationDef. - - - :param type: The type of this IntegrationDef. # noqa: E501 - :type: str - """ - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(IntegrationDef, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, IntegrationDef): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["IntegrationDef"] diff --git a/src/conductor/client/http/models/integration_def_api.py b/src/conductor/client/http/models/integration_def_api.py new file mode 100644 index 00000000..da5a53ad --- /dev/null +++ b/src/conductor/client/http/models/integration_def_api.py @@ -0,0 +1,4 @@ +from conductor.client.adapters.models.integration_def_api_adapter import \ + IntegrationDefApi + +__all__ = ["IntegrationDefApi"] diff --git a/src/conductor/client/http/models/integration_def_form_field.py b/src/conductor/client/http/models/integration_def_form_field.py new file mode 100644 index 00000000..0f67b1d3 --- /dev/null +++ b/src/conductor/client/http/models/integration_def_form_field.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.integration_def_form_field_adapter import \ + IntegrationDefFormFieldAdapter + +IntegrationDefFormField = IntegrationDefFormFieldAdapter + +__all__ = ["IntegrationDefFormField"] diff --git a/src/conductor/client/http/models/integration_update.py b/src/conductor/client/http/models/integration_update.py index 3b238bb2..6778032c 100644 --- a/src/conductor/client/http/models/integration_update.py +++ b/src/conductor/client/http/models/integration_update.py @@ -1,229 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, Optional, Any -from dataclasses import asdict +from conductor.client.adapters.models.integration_update_adapter import \ + IntegrationUpdateAdapter +IntegrationUpdate = IntegrationUpdateAdapter -@dataclass -class IntegrationUpdate: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'category': 'str', - 'configuration': 'dict(str, object)', - 'description': 'str', - 'enabled': 'bool', - 'type': 'str' - } - - attribute_map = { - 'category': 'category', - 'configuration': 'configuration', - 'description': 'description', - 'enabled': 'enabled', - 'type': 'type' - } - - category: Optional[str] = field(default=None) - configuration: Optional[Dict[str, str]] = field(default=None) - description: Optional[str] = field(default=None) - enabled: Optional[bool] = field(default=None) - type: Optional[str] = field(default=None) - - # Private backing fields for properties - _category: Optional[str] = field(default=None, init=False, repr=False) - _configuration: Optional[Dict[str, str]] = field(default=None, init=False, repr=False) - _description: Optional[str] = field(default=None, init=False, repr=False) - _enabled: Optional[bool] = field(default=None, init=False, repr=False) - _type: Optional[str] = field(default=None, init=False, repr=False) - - def __init__(self, category=None, configuration=None, description=None, enabled=None, type=None): # noqa: E501 - """IntegrationUpdate - a model defined in Swagger""" # noqa: E501 - self._category = None - self._configuration = None - self._description = None - self._enabled = None - self._type = None - self.discriminator = None - if category is not None: - self.category = category - if configuration is not None: - self.configuration = configuration - if description is not None: - self.description = description - if enabled is not None: - self.enabled = enabled - if type is not None: - self.type = type - - def __post_init__(self): - """Initialize private fields after dataclass initialization""" - pass - - @property - def category(self): - """Gets the category of this IntegrationUpdate. # noqa: E501 - - - :return: The category of this IntegrationUpdate. # noqa: E501 - :rtype: str - """ - return self._category - - @category.setter - def category(self, category): - """Sets the category of this IntegrationUpdate. - - - :param category: The category of this IntegrationUpdate. # noqa: E501 - :type: str - """ - allowed_values = ["API", "AI_MODEL", "VECTOR_DB", "RELATIONAL_DB"] # noqa: E501 - if category not in allowed_values: - raise ValueError( - "Invalid value for `category` ({0}), must be one of {1}" # noqa: E501 - .format(category, allowed_values) - ) - - self._category = category - - @property - def configuration(self): - """Gets the configuration of this IntegrationUpdate. # noqa: E501 - - - :return: The configuration of this IntegrationUpdate. # noqa: E501 - :rtype: dict(str, object) - """ - return self._configuration - - @configuration.setter - def configuration(self, configuration): - """Sets the configuration of this IntegrationUpdate. - - - :param configuration: The configuration of this IntegrationUpdate. # noqa: E501 - :type: dict(str, object) - """ - - self._configuration = configuration - - @property - def description(self): - """Gets the description of this IntegrationUpdate. # noqa: E501 - - - :return: The description of this IntegrationUpdate. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this IntegrationUpdate. - - - :param description: The description of this IntegrationUpdate. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def enabled(self): - """Gets the enabled of this IntegrationUpdate. # noqa: E501 - - - :return: The enabled of this IntegrationUpdate. # noqa: E501 - :rtype: bool - """ - return self._enabled - - @enabled.setter - def enabled(self, enabled): - """Sets the enabled of this IntegrationUpdate. - - - :param enabled: The enabled of this IntegrationUpdate. # noqa: E501 - :type: bool - """ - - self._enabled = enabled - - @property - def type(self): - """Gets the type of this IntegrationUpdate. # noqa: E501 - - - :return: The type of this IntegrationUpdate. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this IntegrationUpdate. - - - :param type: The type of this IntegrationUpdate. # noqa: E501 - :type: str - """ - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(IntegrationUpdate, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, IntegrationUpdate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["IntegrationUpdate"] diff --git a/src/conductor/client/http/models/json_node.py b/src/conductor/client/http/models/json_node.py new file mode 100644 index 00000000..142e2285 --- /dev/null +++ b/src/conductor/client/http/models/json_node.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.json_node_adapter import JsonNodeAdapter + +JsonNode = JsonNodeAdapter + +__all__ = ["JsonNode"] diff --git a/src/conductor/client/http/models/location.py b/src/conductor/client/http/models/location.py new file mode 100644 index 00000000..e31da308 --- /dev/null +++ b/src/conductor/client/http/models/location.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.location_adapter import LocationAdapter + +Location = LocationAdapter + +__all__ = ["Location"] diff --git a/src/conductor/client/http/models/location_or_builder.py b/src/conductor/client/http/models/location_or_builder.py new file mode 100644 index 00000000..b1c6459d --- /dev/null +++ b/src/conductor/client/http/models/location_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.location_or_builder_adapter import \ + LocationOrBuilderAdapter + +LocationOrBuilder = LocationOrBuilderAdapter + +__all__ = ["LocationOrBuilder"] diff --git a/src/conductor/client/http/models/message.py b/src/conductor/client/http/models/message.py new file mode 100644 index 00000000..7fe7cbfd --- /dev/null +++ b/src/conductor/client/http/models/message.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.message_adapter import MessageAdapter + +Message = MessageAdapter + +__all__ = ["Message"] diff --git a/src/conductor/client/http/models/message_lite.py b/src/conductor/client/http/models/message_lite.py new file mode 100644 index 00000000..3d9555f9 --- /dev/null +++ b/src/conductor/client/http/models/message_lite.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.message_lite_adapter import \ + MessageLiteAdapter + +MessageLite = MessageLiteAdapter + +__all__ = ["MessageLite"] diff --git a/src/conductor/client/http/models/message_options.py b/src/conductor/client/http/models/message_options.py new file mode 100644 index 00000000..55d4fb32 --- /dev/null +++ b/src/conductor/client/http/models/message_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.message_options_adapter import \ + MessageOptionsAdapter + +MessageOptions = MessageOptionsAdapter + +__all__ = ["MessageOptions"] diff --git a/src/conductor/client/http/models/message_options_or_builder.py b/src/conductor/client/http/models/message_options_or_builder.py new file mode 100644 index 00000000..8deb4f91 --- /dev/null +++ b/src/conductor/client/http/models/message_options_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.message_options_or_builder_adapter import \ + MessageOptionsOrBuilderAdapter + +MessageOptionsOrBuilder = MessageOptionsOrBuilderAdapter + +__all__ = ["MessageOptionsOrBuilder"] diff --git a/src/conductor/client/http/models/message_template.py b/src/conductor/client/http/models/message_template.py new file mode 100644 index 00000000..2762d98e --- /dev/null +++ b/src/conductor/client/http/models/message_template.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.message_template_adapter import \ + MessageTemplateAdapter + +MessageTemplate = MessageTemplateAdapter + +__all__ = ["MessageTemplate"] diff --git a/src/conductor/client/http/models/method_descriptor.py b/src/conductor/client/http/models/method_descriptor.py new file mode 100644 index 00000000..2feec449 --- /dev/null +++ b/src/conductor/client/http/models/method_descriptor.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.method_descriptor_adapter import \ + MethodDescriptorAdapter + +MethodDescriptor = MethodDescriptorAdapter + +__all__ = ["MethodDescriptor"] diff --git a/src/conductor/client/http/models/method_descriptor_proto.py b/src/conductor/client/http/models/method_descriptor_proto.py new file mode 100644 index 00000000..8e02e6e3 --- /dev/null +++ b/src/conductor/client/http/models/method_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.method_descriptor_proto_adapter import \ + MethodDescriptorProtoAdapter + +MethodDescriptorProto = MethodDescriptorProtoAdapter + +__all__ = ["MethodDescriptorProto"] diff --git a/src/conductor/client/http/models/method_descriptor_proto_or_builder.py b/src/conductor/client/http/models/method_descriptor_proto_or_builder.py new file mode 100644 index 00000000..4d492d3c --- /dev/null +++ b/src/conductor/client/http/models/method_descriptor_proto_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.method_descriptor_proto_or_builder_adapter import \ + MethodDescriptorProtoOrBuilderAdapter + +MethodDescriptorProtoOrBuilder = MethodDescriptorProtoOrBuilderAdapter + +__all__ = ["MethodDescriptorProtoOrBuilder"] diff --git a/src/conductor/client/http/models/method_options.py b/src/conductor/client/http/models/method_options.py new file mode 100644 index 00000000..d8299b52 --- /dev/null +++ b/src/conductor/client/http/models/method_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.method_options_adapter import \ + MethodOptionsAdapter + +MethodOptions = MethodOptionsAdapter + +__all__ = ["MethodOptions"] diff --git a/src/conductor/client/http/models/method_options_or_builder.py b/src/conductor/client/http/models/method_options_or_builder.py new file mode 100644 index 00000000..55bc3c67 --- /dev/null +++ b/src/conductor/client/http/models/method_options_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.method_options_or_builder_adapter import \ + MethodOptionsOrBuilderAdapter + +MethodOptionsOrBuilder = MethodOptionsOrBuilderAdapter + +__all__ = ["MethodOptionsOrBuilder"] diff --git a/src/conductor/client/http/models/metrics_token.py b/src/conductor/client/http/models/metrics_token.py new file mode 100644 index 00000000..0fc89693 --- /dev/null +++ b/src/conductor/client/http/models/metrics_token.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.metrics_token_adapter import \ + MetricsTokenAdapter + +MetricsToken = MetricsTokenAdapter + +__all__ = ["MetricsToken"] diff --git a/src/conductor/client/http/models/name_part.py b/src/conductor/client/http/models/name_part.py new file mode 100644 index 00000000..4616d0d3 --- /dev/null +++ b/src/conductor/client/http/models/name_part.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.name_part_adapter import NamePartAdapter + +NamePart = NamePartAdapter + +__all__ = ["NamePart"] diff --git a/src/conductor/client/http/models/name_part_or_builder.py b/src/conductor/client/http/models/name_part_or_builder.py new file mode 100644 index 00000000..6768c2c1 --- /dev/null +++ b/src/conductor/client/http/models/name_part_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.name_part_or_builder_adapter import \ + NamePartOrBuilderAdapter + +NamePartOrBuilder = NamePartOrBuilderAdapter + +__all__ = ["NamePartOrBuilder"] diff --git a/src/conductor/client/http/models/oneof_descriptor.py b/src/conductor/client/http/models/oneof_descriptor.py new file mode 100644 index 00000000..64e6b422 --- /dev/null +++ b/src/conductor/client/http/models/oneof_descriptor.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.oneof_descriptor_adapter import \ + OneofDescriptorAdapter + +OneofDescriptor = OneofDescriptorAdapter + +__all__ = ["OneofDescriptor"] diff --git a/src/conductor/client/http/models/oneof_descriptor_proto.py b/src/conductor/client/http/models/oneof_descriptor_proto.py new file mode 100644 index 00000000..16b3f1ef --- /dev/null +++ b/src/conductor/client/http/models/oneof_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.oneof_descriptor_proto_adapter import \ + OneofDescriptorProtoAdapter + +OneofDescriptorProto = OneofDescriptorProtoAdapter + +__all__ = ["OneofDescriptorProto"] diff --git a/src/conductor/client/http/models/oneof_descriptor_proto_or_builder.py b/src/conductor/client/http/models/oneof_descriptor_proto_or_builder.py new file mode 100644 index 00000000..fdbee015 --- /dev/null +++ b/src/conductor/client/http/models/oneof_descriptor_proto_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.oneof_descriptor_proto_or_builder_adapter import \ + OneofDescriptorProtoOrBuilderAdapter + +OneofDescriptorProtoOrBuilder = OneofDescriptorProtoOrBuilderAdapter + +__all__ = ["OneofDescriptorProtoOrBuilder"] diff --git a/src/conductor/client/http/models/oneof_options.py b/src/conductor/client/http/models/oneof_options.py new file mode 100644 index 00000000..021dc51a --- /dev/null +++ b/src/conductor/client/http/models/oneof_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.oneof_options_adapter import \ + OneofOptionsAdapter + +OneofOptions = OneofOptionsAdapter + +__all__ = ["OneofOptions"] diff --git a/src/conductor/client/http/models/oneof_options_or_builder.py b/src/conductor/client/http/models/oneof_options_or_builder.py new file mode 100644 index 00000000..fdb06b76 --- /dev/null +++ b/src/conductor/client/http/models/oneof_options_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.oneof_options_or_builder_adapter import \ + OneofOptionsOrBuilderAdapter + +OneofOptionsOrBuilder = OneofOptionsOrBuilderAdapter + +__all__ = ["OneofOptionsOrBuilder"] diff --git a/src/conductor/client/http/models/option.py b/src/conductor/client/http/models/option.py new file mode 100644 index 00000000..9f248156 --- /dev/null +++ b/src/conductor/client/http/models/option.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.option_adapter import OptionAdapter + +Option = OptionAdapter + +__all__ = ["Option"] diff --git a/src/conductor/client/http/models/parser.py b/src/conductor/client/http/models/parser.py new file mode 100644 index 00000000..d23b6f06 --- /dev/null +++ b/src/conductor/client/http/models/parser.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.parser_adapter import ParserAdapter + +Parser = ParserAdapter + +__all__ = ["Parser"] diff --git a/src/conductor/client/http/models/parser_any.py b/src/conductor/client/http/models/parser_any.py new file mode 100644 index 00000000..e37615d9 --- /dev/null +++ b/src/conductor/client/http/models/parser_any.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_any_adapter import \ + ParserAnyAdapter + +ParserAny = ParserAnyAdapter + +__all__ = ["ParserAny"] diff --git a/src/conductor/client/http/models/parser_declaration.py b/src/conductor/client/http/models/parser_declaration.py new file mode 100644 index 00000000..eb8492a4 --- /dev/null +++ b/src/conductor/client/http/models/parser_declaration.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_declaration_adapter import \ + ParserDeclarationAdapter + +ParserDeclaration = ParserDeclarationAdapter + +__all__ = ["ParserDeclaration"] diff --git a/src/conductor/client/http/models/parser_descriptor_proto.py b/src/conductor/client/http/models/parser_descriptor_proto.py new file mode 100644 index 00000000..59c73b72 --- /dev/null +++ b/src/conductor/client/http/models/parser_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_descriptor_proto_adapter import \ + ParserDescriptorProtoAdapter + +ParserDescriptorProto = ParserDescriptorProtoAdapter + +__all__ = ["ParserDescriptorProto"] diff --git a/src/conductor/client/http/models/parser_edition_default.py b/src/conductor/client/http/models/parser_edition_default.py new file mode 100644 index 00000000..e9f958f9 --- /dev/null +++ b/src/conductor/client/http/models/parser_edition_default.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_edition_default_adapter import \ + ParserEditionDefaultAdapter + +ParserEditionDefault = ParserEditionDefaultAdapter + +__all__ = ["ParserEditionDefault"] diff --git a/src/conductor/client/http/models/parser_enum_descriptor_proto.py b/src/conductor/client/http/models/parser_enum_descriptor_proto.py new file mode 100644 index 00000000..2478e80a --- /dev/null +++ b/src/conductor/client/http/models/parser_enum_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_enum_descriptor_proto_adapter import \ + ParserEnumDescriptorProtoAdapter + +ParserEnumDescriptorProto = ParserEnumDescriptorProtoAdapter + +__all__ = ["ParserEnumDescriptorProto"] diff --git a/src/conductor/client/http/models/parser_enum_options.py b/src/conductor/client/http/models/parser_enum_options.py new file mode 100644 index 00000000..10d32040 --- /dev/null +++ b/src/conductor/client/http/models/parser_enum_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_enum_options_adapter import \ + ParserEnumOptionsAdapter + +ParserEnumOptions = ParserEnumOptionsAdapter + +__all__ = ["ParserEnumOptions"] diff --git a/src/conductor/client/http/models/parser_enum_reserved_range.py b/src/conductor/client/http/models/parser_enum_reserved_range.py new file mode 100644 index 00000000..f593aaa7 --- /dev/null +++ b/src/conductor/client/http/models/parser_enum_reserved_range.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_enum_reserved_range_adapter import \ + ParserEnumReservedRangeAdapter + +ParserEnumReservedRange = ParserEnumReservedRangeAdapter + +__all__ = ["ParserEnumReservedRange"] diff --git a/src/conductor/client/http/models/parser_enum_value_descriptor_proto.py b/src/conductor/client/http/models/parser_enum_value_descriptor_proto.py new file mode 100644 index 00000000..2e9f5ded --- /dev/null +++ b/src/conductor/client/http/models/parser_enum_value_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_enum_value_descriptor_proto_adapter import \ + ParserEnumValueDescriptorProtoAdapter + +ParserEnumValueDescriptorProto = ParserEnumValueDescriptorProtoAdapter + +__all__ = ["ParserEnumValueDescriptorProto"] diff --git a/src/conductor/client/http/models/parser_enum_value_options.py b/src/conductor/client/http/models/parser_enum_value_options.py new file mode 100644 index 00000000..21dd10e7 --- /dev/null +++ b/src/conductor/client/http/models/parser_enum_value_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_enum_value_options_adapter import \ + ParserEnumValueOptionsAdapter + +ParserEnumValueOptions = ParserEnumValueOptionsAdapter + +__all__ = ["ParserEnumValueOptions"] diff --git a/src/conductor/client/http/models/parser_extension_range.py b/src/conductor/client/http/models/parser_extension_range.py new file mode 100644 index 00000000..5c9afbb9 --- /dev/null +++ b/src/conductor/client/http/models/parser_extension_range.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_extension_range_adapter import \ + ParserExtensionRangeAdapter + +ParserExtensionRange = ParserExtensionRangeAdapter + +__all__ = ["ParserExtensionRange"] diff --git a/src/conductor/client/http/models/parser_extension_range_options.py b/src/conductor/client/http/models/parser_extension_range_options.py new file mode 100644 index 00000000..2ad9a621 --- /dev/null +++ b/src/conductor/client/http/models/parser_extension_range_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_extension_range_options_adapter import \ + ParserExtensionRangeOptionsAdapter + +ParserExtensionRangeOptions = ParserExtensionRangeOptionsAdapter + +__all__ = ["ParserExtensionRangeOptions"] diff --git a/src/conductor/client/http/models/parser_feature_set.py b/src/conductor/client/http/models/parser_feature_set.py new file mode 100644 index 00000000..8c7a4846 --- /dev/null +++ b/src/conductor/client/http/models/parser_feature_set.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_feature_set_adapter import \ + ParserFeatureSetAdapter + +ParserFeatureSet = ParserFeatureSetAdapter + +__all__ = ["ParserFeatureSet"] diff --git a/src/conductor/client/http/models/parser_field_descriptor_proto.py b/src/conductor/client/http/models/parser_field_descriptor_proto.py new file mode 100644 index 00000000..51ec9189 --- /dev/null +++ b/src/conductor/client/http/models/parser_field_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_field_descriptor_proto_adapter import \ + ParserFieldDescriptorProtoAdapter + +ParserFieldDescriptorProto = ParserFieldDescriptorProtoAdapter + +__all__ = ["ParserFieldDescriptorProto"] diff --git a/src/conductor/client/http/models/parser_field_options.py b/src/conductor/client/http/models/parser_field_options.py new file mode 100644 index 00000000..047379e1 --- /dev/null +++ b/src/conductor/client/http/models/parser_field_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_field_options_adapter import \ + ParserFieldOptionsAdapter + +ParserFieldOptions = ParserFieldOptionsAdapter + +__all__ = ["ParserFieldOptions"] diff --git a/src/conductor/client/http/models/parser_file_descriptor_proto.py b/src/conductor/client/http/models/parser_file_descriptor_proto.py new file mode 100644 index 00000000..ba5eb46e --- /dev/null +++ b/src/conductor/client/http/models/parser_file_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_file_descriptor_proto_adapter import \ + ParserFileDescriptorProtoAdapter + +ParserFileDescriptorProto = ParserFileDescriptorProtoAdapter + +__all__ = ["ParserFileDescriptorProto"] diff --git a/src/conductor/client/http/models/parser_file_options.py b/src/conductor/client/http/models/parser_file_options.py new file mode 100644 index 00000000..dfd6d595 --- /dev/null +++ b/src/conductor/client/http/models/parser_file_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_file_options_adapter import \ + ParserFileOptionsAdapter + +ParserFileOptions = ParserFileOptionsAdapter + +__all__ = ["ParserFileOptions"] diff --git a/src/conductor/client/http/models/parser_location.py b/src/conductor/client/http/models/parser_location.py new file mode 100644 index 00000000..134841ab --- /dev/null +++ b/src/conductor/client/http/models/parser_location.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_location_adapter import \ + ParserLocationAdapter + +ParserLocation = ParserLocationAdapter + +__all__ = ["ParserLocation"] diff --git a/src/conductor/client/http/models/parser_message.py b/src/conductor/client/http/models/parser_message.py new file mode 100644 index 00000000..3d4d9924 --- /dev/null +++ b/src/conductor/client/http/models/parser_message.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_message_adapter import \ + ParserMessageAdapter + +ParserMessage = ParserMessageAdapter + +__all__ = ["ParserMessage"] diff --git a/src/conductor/client/http/models/parser_message_lite.py b/src/conductor/client/http/models/parser_message_lite.py new file mode 100644 index 00000000..69079645 --- /dev/null +++ b/src/conductor/client/http/models/parser_message_lite.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_message_lite_adapter import \ + ParserMessageLiteAdapter + +ParserMessageLite = ParserMessageLiteAdapter + +__all__ = ["ParserMessageLite"] diff --git a/src/conductor/client/http/models/parser_message_options.py b/src/conductor/client/http/models/parser_message_options.py new file mode 100644 index 00000000..ca2d4ee9 --- /dev/null +++ b/src/conductor/client/http/models/parser_message_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_message_options_adapter import \ + ParserMessageOptionsAdapter + +ParserMessageOptions = ParserMessageOptionsAdapter + +__all__ = ["ParserMessageOptions"] diff --git a/src/conductor/client/http/models/parser_method_descriptor_proto.py b/src/conductor/client/http/models/parser_method_descriptor_proto.py new file mode 100644 index 00000000..3cc0d067 --- /dev/null +++ b/src/conductor/client/http/models/parser_method_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_method_descriptor_proto_adapter import \ + ParserMethodDescriptorProtoAdapter + +ParserMethodDescriptorProto = ParserMethodDescriptorProtoAdapter + +__all__ = ["ParserMethodDescriptorProto"] diff --git a/src/conductor/client/http/models/parser_method_options.py b/src/conductor/client/http/models/parser_method_options.py new file mode 100644 index 00000000..23787e87 --- /dev/null +++ b/src/conductor/client/http/models/parser_method_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_method_options_adapter import \ + ParserMethodOptionsAdapter + +ParserMethodOptions = ParserMethodOptionsAdapter + +__all__ = ["ParserMethodOptions"] diff --git a/src/conductor/client/http/models/parser_name_part.py b/src/conductor/client/http/models/parser_name_part.py new file mode 100644 index 00000000..9f02756d --- /dev/null +++ b/src/conductor/client/http/models/parser_name_part.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_name_part_adapter import \ + ParserNamePartAdapter + +ParserNamePart = ParserNamePartAdapter + +__all__ = ["ParserNamePart"] diff --git a/src/conductor/client/http/models/parser_oneof_descriptor_proto.py b/src/conductor/client/http/models/parser_oneof_descriptor_proto.py new file mode 100644 index 00000000..5872d400 --- /dev/null +++ b/src/conductor/client/http/models/parser_oneof_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_oneof_descriptor_proto_adapter import \ + ParserOneofDescriptorProtoAdapter + +ParserOneofDescriptorProto = ParserOneofDescriptorProtoAdapter + +__all__ = ["ParserOneofDescriptorProto"] diff --git a/src/conductor/client/http/models/parser_oneof_options.py b/src/conductor/client/http/models/parser_oneof_options.py new file mode 100644 index 00000000..a4d2194a --- /dev/null +++ b/src/conductor/client/http/models/parser_oneof_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_oneof_options_adapter import \ + ParserOneofOptionsAdapter + +ParserOneofOptions = ParserOneofOptionsAdapter + +__all__ = ["ParserOneofOptions"] diff --git a/src/conductor/client/http/models/parser_reserved_range.py b/src/conductor/client/http/models/parser_reserved_range.py new file mode 100644 index 00000000..7281cda9 --- /dev/null +++ b/src/conductor/client/http/models/parser_reserved_range.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_reserved_range_adapter import \ + ParserReservedRangeAdapter + +ParserReservedRange = ParserReservedRangeAdapter + +__all__ = ["ParserReservedRange"] diff --git a/src/conductor/client/http/models/parser_service_descriptor_proto.py b/src/conductor/client/http/models/parser_service_descriptor_proto.py new file mode 100644 index 00000000..b8ea17df --- /dev/null +++ b/src/conductor/client/http/models/parser_service_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_service_descriptor_proto_adapter import \ + ParserServiceDescriptorProtoAdapter + +ParserServiceDescriptorProto = ParserServiceDescriptorProtoAdapter + +__all__ = ["ParserServiceDescriptorProto"] diff --git a/src/conductor/client/http/models/parser_service_options.py b/src/conductor/client/http/models/parser_service_options.py new file mode 100644 index 00000000..e1353310 --- /dev/null +++ b/src/conductor/client/http/models/parser_service_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_service_options_adapter import \ + ParserServiceOptionsAdapter + +ParserServiceOptions = ParserServiceOptionsAdapter + +__all__ = ["ParserServiceOptions"] diff --git a/src/conductor/client/http/models/parser_source_code_info.py b/src/conductor/client/http/models/parser_source_code_info.py new file mode 100644 index 00000000..1e76c276 --- /dev/null +++ b/src/conductor/client/http/models/parser_source_code_info.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_source_code_info_adapter import \ + ParserSourceCodeInfoAdapter + +ParserSourceCodeInfo = ParserSourceCodeInfoAdapter + +__all__ = ["ParserSourceCodeInfo"] diff --git a/src/conductor/client/http/models/parser_uninterpreted_option.py b/src/conductor/client/http/models/parser_uninterpreted_option.py new file mode 100644 index 00000000..37f57344 --- /dev/null +++ b/src/conductor/client/http/models/parser_uninterpreted_option.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.parser_uninterpreted_option_adapter import \ + ParserUninterpretedOptionAdapter + +ParserUninterpretedOption = ParserUninterpretedOptionAdapter + +__all__ = ["ParserUninterpretedOption"] diff --git a/src/conductor/client/http/models/permission.py b/src/conductor/client/http/models/permission.py index e84d26c4..1dba8b97 100644 --- a/src/conductor/client/http/models/permission.py +++ b/src/conductor/client/http/models/permission.py @@ -1,105 +1,6 @@ -import pprint -import six -from dataclasses import dataclass, field, asdict -from typing import Dict, List, Optional, Any +from conductor.client.adapters.models.permission_adapter import \ + PermissionAdapter +Permission = PermissionAdapter -@dataclass -class Permission: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - _name: Optional[str] = field(default=None, init=False) - - def __init__(self, name=None): # noqa: E501 - """Permission - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - if name is not None: - self.name = name - - def __post_init__(self): - """Post initialization for dataclass""" - self.discriminator = None - - @property - def name(self): - """Gets the name of this Permission. # noqa: E501 - - - :return: The name of this Permission. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Permission. - - - :param name: The name of this Permission. # noqa: E501 - :type: str - """ - - self._name = name - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Permission, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Permission): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["Permission"] diff --git a/src/conductor/client/http/models/poll_data.py b/src/conductor/client/http/models/poll_data.py index 29bac813..5d5154e1 100644 --- a/src/conductor/client/http/models/poll_data.py +++ b/src/conductor/client/http/models/poll_data.py @@ -1,197 +1,5 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import Dict, List, Optional, Any -from dataclasses import InitVar +from conductor.client.adapters.models.poll_data_adapter import PollDataAdapter +PollData = PollDataAdapter -@dataclass -class PollData: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'queue_name': 'str', - 'domain': 'str', - 'worker_id': 'str', - 'last_poll_time': 'int' - } - - attribute_map = { - 'queue_name': 'queueName', - 'domain': 'domain', - 'worker_id': 'workerId', - 'last_poll_time': 'lastPollTime' - } - - queue_name: Optional[str] = field(default=None) - domain: Optional[str] = field(default=None) - worker_id: Optional[str] = field(default=None) - last_poll_time: Optional[int] = field(default=None) - - # Private backing fields for properties - _queue_name: Optional[str] = field(default=None, init=False, repr=False) - _domain: Optional[str] = field(default=None, init=False, repr=False) - _worker_id: Optional[str] = field(default=None, init=False, repr=False) - _last_poll_time: Optional[int] = field(default=None, init=False, repr=False) - - discriminator: Optional[str] = field(default=None, init=False, repr=False) - - def __init__(self, queue_name=None, domain=None, worker_id=None, last_poll_time=None): # noqa: E501 - """PollData - a model defined in Swagger""" # noqa: E501 - self._queue_name = None - self._domain = None - self._worker_id = None - self._last_poll_time = None - self.discriminator = None - if queue_name is not None: - self.queue_name = queue_name - if domain is not None: - self.domain = domain - if worker_id is not None: - self.worker_id = worker_id - if last_poll_time is not None: - self.last_poll_time = last_poll_time - - def __post_init__(self): - """Initialize private fields after dataclass initialization""" - pass - - @property - def queue_name(self): - """Gets the queue_name of this PollData. # noqa: E501 - - - :return: The queue_name of this PollData. # noqa: E501 - :rtype: str - """ - return self._queue_name - - @queue_name.setter - def queue_name(self, queue_name): - """Sets the queue_name of this PollData. - - - :param queue_name: The queue_name of this PollData. # noqa: E501 - :type: str - """ - - self._queue_name = queue_name - - @property - def domain(self): - """Gets the domain of this PollData. # noqa: E501 - - - :return: The domain of this PollData. # noqa: E501 - :rtype: str - """ - return self._domain - - @domain.setter - def domain(self, domain): - """Sets the domain of this PollData. - - - :param domain: The domain of this PollData. # noqa: E501 - :type: str - """ - - self._domain = domain - - @property - def worker_id(self): - """Gets the worker_id of this PollData. # noqa: E501 - - - :return: The worker_id of this PollData. # noqa: E501 - :rtype: str - """ - return self._worker_id - - @worker_id.setter - def worker_id(self, worker_id): - """Sets the worker_id of this PollData. - - - :param worker_id: The worker_id of this PollData. # noqa: E501 - :type: str - """ - - self._worker_id = worker_id - - @property - def last_poll_time(self): - """Gets the last_poll_time of this PollData. # noqa: E501 - - - :return: The last_poll_time of this PollData. # noqa: E501 - :rtype: int - """ - return self._last_poll_time - - @last_poll_time.setter - def last_poll_time(self, last_poll_time): - """Sets the last_poll_time of this PollData. - - - :param last_poll_time: The last_poll_time of this PollData. # noqa: E501 - :type: int - """ - - self._last_poll_time = last_poll_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(PollData, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PollData): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["PollData"] diff --git a/src/conductor/client/http/models/prompt_template.py b/src/conductor/client/http/models/prompt_template.py index d08a3304..db206b71 100644 --- a/src/conductor/client/http/models/prompt_template.py +++ b/src/conductor/client/http/models/prompt_template.py @@ -1,352 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import List, Optional -import dataclasses +from conductor.client.adapters.models.prompt_template_adapter import \ + PromptTemplateAdapter +PromptTemplate = PromptTemplateAdapter -@dataclass -class PromptTemplate: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'created_by': 'str', - 'created_on': 'int', - 'description': 'str', - 'integrations': 'list[str]', - 'name': 'str', - 'tags': 'list[TagObject]', - 'template': 'str', - 'updated_by': 'str', - 'updated_on': 'int', - 'variables': 'list[str]' - } - - attribute_map = { - 'created_by': 'createdBy', - 'created_on': 'createdOn', - 'description': 'description', - 'integrations': 'integrations', - 'name': 'name', - 'tags': 'tags', - 'template': 'template', - 'updated_by': 'updatedBy', - 'updated_on': 'updatedOn', - 'variables': 'variables' - } - - _created_by: Optional[str] = field(default=None) - _created_on: Optional[int] = field(default=None) - _description: Optional[str] = field(default=None) - _integrations: Optional[List[str]] = field(default=None) - _name: Optional[str] = field(default=None) - _tags: Optional[List['TagObject']] = field(default=None) - _template: Optional[str] = field(default=None) - _updated_by: Optional[str] = field(default=None) - _updated_on: Optional[int] = field(default=None) - _variables: Optional[List[str]] = field(default=None) - - def __init__(self, created_by=None, created_on=None, description=None, integrations=None, name=None, tags=None, - template=None, updated_by=None, updated_on=None, variables=None): # noqa: E501 - """PromptTemplate - a model defined in Swagger""" # noqa: E501 - self._created_by = None - self._created_on = None - self._description = None - self._integrations = None - self._name = None - self._tags = None - self._template = None - self._updated_by = None - self._updated_on = None - self._variables = None - self.discriminator = None - if created_by is not None: - self.created_by = created_by - if created_on is not None: - self.created_on = created_on - if description is not None: - self.description = description - if integrations is not None: - self.integrations = integrations - if name is not None: - self.name = name - if tags is not None: - self.tags = tags - if template is not None: - self.template = template - if updated_by is not None: - self.updated_by = updated_by - if updated_on is not None: - self.updated_on = updated_on - if variables is not None: - self.variables = variables - - def __post_init__(self): - """Post initialization for dataclass""" - pass - - @property - def created_by(self): - """Gets the created_by of this PromptTemplate. # noqa: E501 - - - :return: The created_by of this PromptTemplate. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this PromptTemplate. - - - :param created_by: The created_by of this PromptTemplate. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - def created_on(self): - """Gets the created_on of this PromptTemplate. # noqa: E501 - - - :return: The created_on of this PromptTemplate. # noqa: E501 - :rtype: int - """ - return self._created_on - - @created_on.setter - def created_on(self, created_on): - """Sets the created_on of this PromptTemplate. - - - :param created_on: The created_on of this PromptTemplate. # noqa: E501 - :type: int - """ - - self._created_on = created_on - - @property - def description(self): - """Gets the description of this PromptTemplate. # noqa: E501 - - - :return: The description of this PromptTemplate. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this PromptTemplate. - - - :param description: The description of this PromptTemplate. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def integrations(self): - """Gets the integrations of this PromptTemplate. # noqa: E501 - - - :return: The integrations of this PromptTemplate. # noqa: E501 - :rtype: list[str] - """ - return self._integrations - - @integrations.setter - def integrations(self, integrations): - """Sets the integrations of this PromptTemplate. - - - :param integrations: The integrations of this PromptTemplate. # noqa: E501 - :type: list[str] - """ - - self._integrations = integrations - - @property - def name(self): - """Gets the name of this PromptTemplate. # noqa: E501 - - - :return: The name of this PromptTemplate. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this PromptTemplate. - - - :param name: The name of this PromptTemplate. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def tags(self): - """Gets the tags of this PromptTemplate. # noqa: E501 - - - :return: The tags of this PromptTemplate. # noqa: E501 - :rtype: list[TagObject] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this PromptTemplate. - - - :param tags: The tags of this PromptTemplate. # noqa: E501 - :type: list[TagObject] - """ - - self._tags = tags - - @property - def template(self): - """Gets the template of this PromptTemplate. # noqa: E501 - - - :return: The template of this PromptTemplate. # noqa: E501 - :rtype: str - """ - return self._template - - @template.setter - def template(self, template): - """Sets the template of this PromptTemplate. - - - :param template: The template of this PromptTemplate. # noqa: E501 - :type: str - """ - - self._template = template - - @property - def updated_by(self): - """Gets the updated_by of this PromptTemplate. # noqa: E501 - - - :return: The updated_by of this PromptTemplate. # noqa: E501 - :rtype: str - """ - return self._updated_by - - @updated_by.setter - def updated_by(self, updated_by): - """Sets the updated_by of this PromptTemplate. - - - :param updated_by: The updated_by of this PromptTemplate. # noqa: E501 - :type: str - """ - - self._updated_by = updated_by - - @property - def updated_on(self): - """Gets the updated_on of this PromptTemplate. # noqa: E501 - - - :return: The updated_on of this PromptTemplate. # noqa: E501 - :rtype: int - """ - return self._updated_on - - @updated_on.setter - def updated_on(self, updated_on): - """Sets the updated_on of this PromptTemplate. - - - :param updated_on: The updated_on of this PromptTemplate. # noqa: E501 - :type: int - """ - - self._updated_on = updated_on - - @property - def variables(self): - """Gets the variables of this PromptTemplate. # noqa: E501 - - - :return: The variables of this PromptTemplate. # noqa: E501 - :rtype: list[str] - """ - return self._variables - - @variables.setter - def variables(self, variables): - """Sets the variables of this PromptTemplate. - - - :param variables: The variables of this PromptTemplate. # noqa: E501 - :type: list[str] - """ - - self._variables = variables - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(PromptTemplate, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PromptTemplate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["PromptTemplate"] diff --git a/src/conductor/client/http/models/prompt_template_test_request.py b/src/conductor/client/http/models/prompt_template_test_request.py new file mode 100644 index 00000000..235d8f09 --- /dev/null +++ b/src/conductor/client/http/models/prompt_template_test_request.py @@ -0,0 +1,7 @@ +from conductor.client.adapters.models.prompt_template_test_request_adapter import \ + PromptTemplateTestRequestAdapter + +PromptTemplateTestRequest = PromptTemplateTestRequestAdapter +PromptTemplateTestRequest.__name__ = "PromptTemplateTestRequest" + +__all__ = ["PromptTemplateTestRequest"] diff --git a/src/conductor/client/http/models/proto_registry_entry.py b/src/conductor/client/http/models/proto_registry_entry.py index f7332152..8a46a93e 100644 --- a/src/conductor/client/http/models/proto_registry_entry.py +++ b/src/conductor/client/http/models/proto_registry_entry.py @@ -1,49 +1,6 @@ -from dataclasses import dataclass -from typing import Optional -import six +from conductor.client.adapters.models.proto_registry_entry_adapter import \ + ProtoRegistryEntryAdapter +ProtoRegistryEntry = ProtoRegistryEntryAdapter -@dataclass -class ProtoRegistryEntry: - """Protocol buffer registry entry for storing service definitions.""" - - swagger_types = { - 'service_name': 'str', - 'filename': 'str', - 'data': 'bytes' - } - - attribute_map = { - 'service_name': 'serviceName', - 'filename': 'filename', - 'data': 'data' - } - - service_name: str - filename: str - data: bytes - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - return result - - def __str__(self): - return f"ProtoRegistryEntry(service_name='{self.service_name}', filename='{self.filename}', data_size={len(self.data)})" \ No newline at end of file +__all__ = ["ProtoRegistryEntry"] diff --git a/src/conductor/client/http/models/rate_limit.py b/src/conductor/client/http/models/rate_limit.py index 5ccadddf..cdb535a0 100644 --- a/src/conductor/client/http/models/rate_limit.py +++ b/src/conductor/client/http/models/rate_limit.py @@ -1,194 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, asdict -from typing import Optional -from deprecated import deprecated +from conductor.client.adapters.models.rate_limit_adapter import \ + RateLimitAdapter -@dataclass -class RateLimit: - """NOTE: This class is auto generated by the swagger code generator program. +RateLimit = RateLimitAdapter - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _rate_limit_key: Optional[str] = field(default=None, init=False) - _concurrent_exec_limit: Optional[int] = field(default=None, init=False) - _tag: Optional[str] = field(default=None, init=False) - _concurrent_execution_limit: Optional[int] = field(default=None, init=False) - - swagger_types = { - 'rate_limit_key': 'str', - 'concurrent_exec_limit': 'int', - 'tag': 'str', - 'concurrent_execution_limit': 'int' - } - - attribute_map = { - 'rate_limit_key': 'rateLimitKey', - 'concurrent_exec_limit': 'concurrentExecLimit', - 'tag': 'tag', - 'concurrent_execution_limit': 'concurrentExecutionLimit' - } - - def __init__(self, tag=None, concurrent_execution_limit=None, rate_limit_key=None, concurrent_exec_limit=None): # noqa: E501 - """RateLimit - a model defined in Swagger""" # noqa: E501 - self._tag = None - self._concurrent_execution_limit = None - self._rate_limit_key = None - self._concurrent_exec_limit = None - self.discriminator = None - if tag is not None: - self.tag = tag - if concurrent_execution_limit is not None: - self.concurrent_execution_limit = concurrent_execution_limit - if rate_limit_key is not None: - self.rate_limit_key = rate_limit_key - if concurrent_exec_limit is not None: - self.concurrent_exec_limit = concurrent_exec_limit - - def __post_init__(self): - """Post initialization for dataclass""" - pass - - @property - def rate_limit_key(self): - """Gets the rate_limit_key of this RateLimit. # noqa: E501 - - Key that defines the rate limit. Rate limit key is a combination of workflow payload such as - name, or correlationId etc. - - :return: The rate_limit_key of this RateLimit. # noqa: E501 - :rtype: str - """ - return self._rate_limit_key - - @rate_limit_key.setter - def rate_limit_key(self, rate_limit_key): - """Sets the rate_limit_key of this RateLimit. - - Key that defines the rate limit. Rate limit key is a combination of workflow payload such as - name, or correlationId etc. - - :param rate_limit_key: The rate_limit_key of this RateLimit. # noqa: E501 - :type: str - """ - self._rate_limit_key = rate_limit_key - - @property - def concurrent_exec_limit(self): - """Gets the concurrent_exec_limit of this RateLimit. # noqa: E501 - - Number of concurrently running workflows that are allowed per key - - :return: The concurrent_exec_limit of this RateLimit. # noqa: E501 - :rtype: int - """ - return self._concurrent_exec_limit - - @concurrent_exec_limit.setter - def concurrent_exec_limit(self, concurrent_exec_limit): - """Sets the concurrent_exec_limit of this RateLimit. - - Number of concurrently running workflows that are allowed per key - - :param concurrent_exec_limit: The concurrent_exec_limit of this RateLimit. # noqa: E501 - :type: int - """ - self._concurrent_exec_limit = concurrent_exec_limit - - @property - @deprecated(reason="Use rate_limit_key instead") - def tag(self): - """Gets the tag of this RateLimit. # noqa: E501 - - - :return: The tag of this RateLimit. # noqa: E501 - :rtype: str - """ - return self._tag - - @tag.setter - @deprecated(reason="Use rate_limit_key instead") - def tag(self, tag): - """Sets the tag of this RateLimit. - - - :param tag: The tag of this RateLimit. # noqa: E501 - :type: str - """ - self._tag = tag - - @property - @deprecated(reason="Use concurrent_exec_limit instead") - def concurrent_execution_limit(self): - """Gets the concurrent_execution_limit of this RateLimit. # noqa: E501 - - - :return: The concurrent_execution_limit of this RateLimit. # noqa: E501 - :rtype: int - """ - return self._concurrent_execution_limit - - @concurrent_execution_limit.setter - @deprecated(reason="Use concurrent_exec_limit instead") - def concurrent_execution_limit(self, concurrent_execution_limit): - """Sets the concurrent_execution_limit of this RateLimit. - - - :param concurrent_execution_limit: The concurrent_execution_limit of this RateLimit. # noqa: E501 - :type: int - """ - self._concurrent_execution_limit = concurrent_execution_limit - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(RateLimit, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, RateLimit): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["RateLimit"] diff --git a/src/conductor/client/http/models/rate_limit_config.py b/src/conductor/client/http/models/rate_limit_config.py new file mode 100644 index 00000000..3626ec41 --- /dev/null +++ b/src/conductor/client/http/models/rate_limit_config.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.rate_limit_config_adapter import \ + RateLimitConfigAdapter + +RateLimitConfig = RateLimitConfigAdapter + +__all__ = ["RateLimitConfig"] diff --git a/src/conductor/client/http/models/request_param.py b/src/conductor/client/http/models/request_param.py index 00ba9d9b..dd532483 100644 --- a/src/conductor/client/http/models/request_param.py +++ b/src/conductor/client/http/models/request_param.py @@ -1,98 +1,6 @@ -from dataclasses import dataclass -from typing import Optional, Any -import six +from conductor.client.adapters.models.request_param_adapter import ( + RequestParamAdapter, Schema) +RequestParam = RequestParamAdapter -@dataclass -class Schema: - """Schema definition for request parameters.""" - - swagger_types = { - 'type': 'str', - 'format': 'str', - 'default_value': 'object' - } - - attribute_map = { - 'type': 'type', - 'format': 'format', - 'default_value': 'defaultValue' - } - - type: Optional[str] = None - format: Optional[str] = None - default_value: Optional[Any] = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - return result - - def __str__(self): - return f"Schema(type='{self.type}', format='{self.format}', default_value={self.default_value})" - - -@dataclass -class RequestParam: - """Request parameter model for API endpoints.""" - - swagger_types = { - 'name': 'str', - 'type': 'str', - 'required': 'bool', - 'schema': 'Schema' - } - - attribute_map = { - 'name': 'name', - 'type': 'type', - 'required': 'required', - 'schema': 'schema' - } - - name: Optional[str] = None - type: Optional[str] = None # Query, Header, Path, etc. - required: bool = False - schema: Optional[Schema] = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - return result - - def __str__(self): - return f"RequestParam(name='{self.name}', type='{self.type}', required={self.required})" \ No newline at end of file +__all__ = ["RequestParam", "Schema"] diff --git a/src/conductor/client/http/models/rerun_workflow_request.py b/src/conductor/client/http/models/rerun_workflow_request.py index 9f7a7961..6f0a5eb1 100644 --- a/src/conductor/client/http/models/rerun_workflow_request.py +++ b/src/conductor/client/http/models/rerun_workflow_request.py @@ -1,200 +1,6 @@ -import pprint -import six -from dataclasses import dataclass, field -from typing import Dict, Any, Optional -from functools import partial -from deprecated import deprecated +from conductor.client.adapters.models.rerun_workflow_request_adapter import \ + RerunWorkflowRequestAdapter +RerunWorkflowRequest = RerunWorkflowRequestAdapter -@dataclass(init=False) -class RerunWorkflowRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - _re_run_from_workflow_id: Optional[str] = field(default=None, repr=False) - _workflow_input: Optional[Dict[str, Any]] = field(default=None, repr=False) - _re_run_from_task_id: Optional[str] = field(default=None, repr=False) - _task_input: Optional[Dict[str, Any]] = field(default=None, repr=False) - _correlation_id: Optional[str] = field(default=None, repr=False) - - # Class properties for swagger documentation - swagger_types = { - 're_run_from_workflow_id': 'str', - 'workflow_input': 'dict(str, object)', - 're_run_from_task_id': 'str', - 'task_input': 'dict(str, object)', - 'correlation_id': 'str' - } - - attribute_map = { - 're_run_from_workflow_id': 'reRunFromWorkflowId', - 'workflow_input': 'workflowInput', - 're_run_from_task_id': 'reRunFromTaskId', - 'task_input': 'taskInput', - 'correlation_id': 'correlationId' - } - - def __init__(self, re_run_from_workflow_id=None, workflow_input=None, re_run_from_task_id=None, task_input=None, - correlation_id=None): - """RerunWorkflowRequest - a model defined in Swagger""" - # Initialize the private fields - self._re_run_from_workflow_id = None - self._workflow_input = None - self._re_run_from_task_id = None - self._task_input = None - self._correlation_id = None - - # Set discriminator - self.discriminator = None - - # Set values if provided - if re_run_from_workflow_id is not None: - self.re_run_from_workflow_id = re_run_from_workflow_id - if workflow_input is not None: - self.workflow_input = workflow_input - if re_run_from_task_id is not None: - self.re_run_from_task_id = re_run_from_task_id - if task_input is not None: - self.task_input = task_input - if correlation_id is not None: - self.correlation_id = correlation_id - - @property - def re_run_from_workflow_id(self): - """Gets the re_run_from_workflow_id of this RerunWorkflowRequest. # noqa: E501 - - :return: The re_run_from_workflow_id of this RerunWorkflowRequest. # noqa: E501 - :rtype: str - """ - return self._re_run_from_workflow_id - - @re_run_from_workflow_id.setter - def re_run_from_workflow_id(self, re_run_from_workflow_id): - """Sets the re_run_from_workflow_id of this RerunWorkflowRequest. - - :param re_run_from_workflow_id: The re_run_from_workflow_id of this RerunWorkflowRequest. # noqa: E501 - :type: str - """ - self._re_run_from_workflow_id = re_run_from_workflow_id - - @property - def workflow_input(self): - """Gets the workflow_input of this RerunWorkflowRequest. # noqa: E501 - - :return: The workflow_input of this RerunWorkflowRequest. # noqa: E501 - :rtype: dict(str, object) - """ - return self._workflow_input - - @workflow_input.setter - def workflow_input(self, workflow_input): - """Sets the workflow_input of this RerunWorkflowRequest. - - :param workflow_input: The workflow_input of this RerunWorkflowRequest. # noqa: E501 - :type: dict(str, object) - """ - self._workflow_input = workflow_input - - @property - def re_run_from_task_id(self): - """Gets the re_run_from_task_id of this RerunWorkflowRequest. # noqa: E501 - - :return: The re_run_from_task_id of this RerunWorkflowRequest. # noqa: E501 - :rtype: str - """ - return self._re_run_from_task_id - - @re_run_from_task_id.setter - def re_run_from_task_id(self, re_run_from_task_id): - """Sets the re_run_from_task_id of this RerunWorkflowRequest. - - :param re_run_from_task_id: The re_run_from_task_id of this RerunWorkflowRequest. # noqa: E501 - :type: str - """ - self._re_run_from_task_id = re_run_from_task_id - - @property - def task_input(self): - """Gets the task_input of this RerunWorkflowRequest. # noqa: E501 - - :return: The task_input of this RerunWorkflowRequest. # noqa: E501 - :rtype: dict(str, object) - """ - return self._task_input - - @task_input.setter - def task_input(self, task_input): - """Sets the task_input of this RerunWorkflowRequest. - - :param task_input: The task_input of this RerunWorkflowRequest. # noqa: E501 - :type: dict(str, object) - """ - self._task_input = task_input - - @property - def correlation_id(self): - """Gets the correlation_id of this RerunWorkflowRequest. # noqa: E501 - - :return: The correlation_id of this RerunWorkflowRequest. # noqa: E501 - :rtype: str - """ - return self._correlation_id - - @correlation_id.setter - def correlation_id(self, correlation_id): - """Sets the correlation_id of this RerunWorkflowRequest. - - - :param correlation_id: The correlation_id of this RerunWorkflowRequest. # noqa: E501 - :type: str - """ - - self._correlation_id = correlation_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(RerunWorkflowRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, RerunWorkflowRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["RerunWorkflowRequest"] diff --git a/src/conductor/client/http/models/reserved_range.py b/src/conductor/client/http/models/reserved_range.py new file mode 100644 index 00000000..f8c57dec --- /dev/null +++ b/src/conductor/client/http/models/reserved_range.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.reserved_range_adapter import \ + ReservedRangeAdapter + +ReservedRange = ReservedRangeAdapter + +__all__ = ["ReservedRange"] diff --git a/src/conductor/client/http/models/reserved_range_or_builder.py b/src/conductor/client/http/models/reserved_range_or_builder.py new file mode 100644 index 00000000..6c7b0666 --- /dev/null +++ b/src/conductor/client/http/models/reserved_range_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.reserved_range_or_builder_adapter import \ + ReservedRangeOrBuilderAdapter + +ReservedRangeOrBuilder = ReservedRangeOrBuilderAdapter + +__all__ = ["ReservedRangeOrBuilder"] diff --git a/src/conductor/client/http/models/response.py b/src/conductor/client/http/models/response.py index 2e343a27..91695504 100644 --- a/src/conductor/client/http/models/response.py +++ b/src/conductor/client/http/models/response.py @@ -1,73 +1,5 @@ -import pprint -import re # noqa: F401 +from conductor.client.adapters.models.response_adapter import ResponseAdapter -import six +Response = ResponseAdapter - -class Response(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """Response - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Response, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Response): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other +__all__ = ["Response"] diff --git a/src/conductor/client/http/models/role.py b/src/conductor/client/http/models/role.py index 293acdc5..9fd5ea0b 100644 --- a/src/conductor/client/http/models/role.py +++ b/src/conductor/client/http/models/role.py @@ -1,141 +1,5 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import List, Optional +from conductor.client.adapters.models.role_adapter import RoleAdapter +Role = RoleAdapter -@dataclass -class Role: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str', - 'permissions': 'list[Permission]' - } - - attribute_map = { - 'name': 'name', - 'permissions': 'permissions' - } - - name: Optional[str] = field(default=None) - permissions: Optional[List['Permission']] = field(default=None) - - # InitVar parameters for backward compatibility - name_init: InitVar[Optional[str]] = field(default=None) - permissions_init: InitVar[Optional[List['Permission']]] = field(default=None) - - def __init__(self, name=None, permissions=None): # noqa: E501 - """Role - a model defined in Swagger""" # noqa: E501 - self._name = None - self._permissions = None - self.discriminator = None - if name is not None: - self.name = name - if permissions is not None: - self.permissions = permissions - - def __post_init__(self, name_init, permissions_init): - # Handle initialization from dataclass fields - if name_init is not None: - self.name = name_init - if permissions_init is not None: - self.permissions = permissions_init - - @property - def name(self): - """Gets the name of this Role. # noqa: E501 - - - :return: The name of this Role. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Role. - - - :param name: The name of this Role. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def permissions(self): - """Gets the permissions of this Role. # noqa: E501 - - - :return: The permissions of this Role. # noqa: E501 - :rtype: list[Permission] - """ - return self._permissions - - @permissions.setter - def permissions(self, permissions): - """Sets the permissions of this Role. - - - :param permissions: The permissions of this Role. # noqa: E501 - :type: list[Permission] - """ - - self._permissions = permissions - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Role, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Role): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["Role"] diff --git a/src/conductor/client/http/models/save_schedule_request.py b/src/conductor/client/http/models/save_schedule_request.py index 7901d42d..2f493651 100644 --- a/src/conductor/client/http/models/save_schedule_request.py +++ b/src/conductor/client/http/models/save_schedule_request.py @@ -1,414 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Optional, Dict, List, Any -from deprecated import deprecated +from conductor.client.adapters.models.save_schedule_request_adapter import \ + SaveScheduleRequestAdapter +SaveScheduleRequest = SaveScheduleRequestAdapter -@dataclass -class SaveScheduleRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str', - 'cron_expression': 'str', - 'run_catchup_schedule_instances': 'bool', - 'paused': 'bool', - 'start_workflow_request': 'StartWorkflowRequest', - 'created_by': 'str', - 'updated_by': 'str', - 'schedule_start_time': 'int', - 'schedule_end_time': 'int', - 'zone_id': 'str', - 'description': 'str' - } - - attribute_map = { - 'name': 'name', - 'cron_expression': 'cronExpression', - 'run_catchup_schedule_instances': 'runCatchupScheduleInstances', - 'paused': 'paused', - 'start_workflow_request': 'startWorkflowRequest', - 'created_by': 'createdBy', - 'updated_by': 'updatedBy', - 'schedule_start_time': 'scheduleStartTime', - 'schedule_end_time': 'scheduleEndTime', - 'zone_id': 'zoneId', - 'description': 'description' - } - - name: InitVar[Optional[str]] = None - cron_expression: InitVar[Optional[str]] = None - run_catchup_schedule_instances: InitVar[Optional[bool]] = None - paused: InitVar[Optional[bool]] = None - start_workflow_request: InitVar[Optional[Any]] = None - created_by: InitVar[Optional[str]] = None - updated_by: InitVar[Optional[str]] = None - schedule_start_time: InitVar[Optional[int]] = None - schedule_end_time: InitVar[Optional[int]] = None - zone_id: InitVar[Optional[str]] = None - description: InitVar[Optional[str]] = None - - # Private backing fields - _name: Optional[str] = field(default=None, init=False) - _cron_expression: Optional[str] = field(default=None, init=False) - _run_catchup_schedule_instances: Optional[bool] = field(default=None, init=False) - _paused: Optional[bool] = field(default=None, init=False) - _start_workflow_request: Optional[Any] = field(default=None, init=False) - _created_by: Optional[str] = field(default=None, init=False) - _updated_by: Optional[str] = field(default=None, init=False) - _schedule_start_time: Optional[int] = field(default=None, init=False) - _schedule_end_time: Optional[int] = field(default=None, init=False) - _zone_id: Optional[str] = field(default=None, init=False) - _description: Optional[str] = field(default=None, init=False) - - discriminator: Optional[str] = field(default=None, init=False) - - def __init__(self, name=None, cron_expression=None, run_catchup_schedule_instances=None, paused=None, - start_workflow_request=None, created_by=None, updated_by=None, schedule_start_time=None, - schedule_end_time=None, zone_id=None, description=None): # noqa: E501 - """SaveScheduleRequest - a model defined in Swagger""" # noqa: E501 - self._name = None - self._cron_expression = None - self._run_catchup_schedule_instances = None - self._paused = None - self._start_workflow_request = None - self._created_by = None - self._updated_by = None - self._schedule_start_time = None - self._schedule_end_time = None - self._zone_id = None - self._description = None - self.discriminator = None - self.name = name - self.cron_expression = cron_expression - if run_catchup_schedule_instances is not None: - self.run_catchup_schedule_instances = run_catchup_schedule_instances - if paused is not None: - self.paused = paused - if start_workflow_request is not None: - self.start_workflow_request = start_workflow_request - if created_by is not None: - self.created_by = created_by - if updated_by is not None: - self.updated_by = updated_by - if schedule_start_time is not None: - self.schedule_start_time = schedule_start_time - if schedule_end_time is not None: - self.schedule_end_time = schedule_end_time - if zone_id is not None: - self.zone_id = zone_id - if description is not None: - self.description = description - - def __post_init__(self, name, cron_expression, run_catchup_schedule_instances, paused, - start_workflow_request, created_by, updated_by, schedule_start_time, - schedule_end_time, zone_id, description): - """Post initialization for dataclass""" - if name is not None: - self.name = name - if cron_expression is not None: - self.cron_expression = cron_expression - if run_catchup_schedule_instances is not None: - self.run_catchup_schedule_instances = run_catchup_schedule_instances - if paused is not None: - self.paused = paused - if start_workflow_request is not None: - self.start_workflow_request = start_workflow_request - if created_by is not None: - self.created_by = created_by - if updated_by is not None: - self.updated_by = updated_by - if schedule_start_time is not None: - self.schedule_start_time = schedule_start_time - if schedule_end_time is not None: - self.schedule_end_time = schedule_end_time - if zone_id is not None: - self.zone_id = zone_id - if description is not None: - self.description = description - - @property - def name(self): - """Gets the name of this SaveScheduleRequest. # noqa: E501 - - - :return: The name of this SaveScheduleRequest. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this SaveScheduleRequest. - - - :param name: The name of this SaveScheduleRequest. # noqa: E501 - :type: str - """ - self._name = name - - @property - def cron_expression(self): - """Gets the cron_expression of this SaveScheduleRequest. # noqa: E501 - - - :return: The cron_expression of this SaveScheduleRequest. # noqa: E501 - :rtype: str - """ - return self._cron_expression - - @cron_expression.setter - def cron_expression(self, cron_expression): - """Sets the cron_expression of this SaveScheduleRequest. - - - :param cron_expression: The cron_expression of this SaveScheduleRequest. # noqa: E501 - :type: str - """ - self._cron_expression = cron_expression - - @property - def run_catchup_schedule_instances(self): - """Gets the run_catchup_schedule_instances of this SaveScheduleRequest. # noqa: E501 - - - :return: The run_catchup_schedule_instances of this SaveScheduleRequest. # noqa: E501 - :rtype: bool - """ - return self._run_catchup_schedule_instances - - @run_catchup_schedule_instances.setter - def run_catchup_schedule_instances(self, run_catchup_schedule_instances): - """Sets the run_catchup_schedule_instances of this SaveScheduleRequest. - - - :param run_catchup_schedule_instances: The run_catchup_schedule_instances of this SaveScheduleRequest. # noqa: E501 - :type: bool - """ - - self._run_catchup_schedule_instances = run_catchup_schedule_instances - - @property - def paused(self): - """Gets the paused of this SaveScheduleRequest. # noqa: E501 - - - :return: The paused of this SaveScheduleRequest. # noqa: E501 - :rtype: bool - """ - return self._paused - - @paused.setter - def paused(self, paused): - """Sets the paused of this SaveScheduleRequest. - - - :param paused: The paused of this SaveScheduleRequest. # noqa: E501 - :type: bool - """ - - self._paused = paused - - @property - def start_workflow_request(self): - """Gets the start_workflow_request of this SaveScheduleRequest. # noqa: E501 - - - :return: The start_workflow_request of this SaveScheduleRequest. # noqa: E501 - :rtype: StartWorkflowRequest - """ - return self._start_workflow_request - - @start_workflow_request.setter - def start_workflow_request(self, start_workflow_request): - """Sets the start_workflow_request of this SaveScheduleRequest. - - - :param start_workflow_request: The start_workflow_request of this SaveScheduleRequest. # noqa: E501 - :type: StartWorkflowRequest - """ - - self._start_workflow_request = start_workflow_request - - @property - def created_by(self): - """Gets the created_by of this SaveScheduleRequest. # noqa: E501 - - - :return: The created_by of this SaveScheduleRequest. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this SaveScheduleRequest. - - - :param created_by: The created_by of this SaveScheduleRequest. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - def updated_by(self): - """Gets the updated_by of this SaveScheduleRequest. # noqa: E501 - - - :return: The updated_by of this SaveScheduleRequest. # noqa: E501 - :rtype: str - """ - return self._updated_by - - @updated_by.setter - def updated_by(self, updated_by): - """Sets the updated_by of this SaveScheduleRequest. - - - :param updated_by: The updated_by of this SaveScheduleRequest. # noqa: E501 - :type: str - """ - - self._updated_by = updated_by - - @property - def schedule_start_time(self): - """Gets the schedule_start_time of this SaveScheduleRequest. # noqa: E501 - - - :return: The schedule_start_time of this SaveScheduleRequest. # noqa: E501 - :rtype: int - """ - return self._schedule_start_time - - @schedule_start_time.setter - def schedule_start_time(self, schedule_start_time): - """Sets the schedule_start_time of this SaveScheduleRequest. - - - :param schedule_start_time: The schedule_start_time of this SaveScheduleRequest. # noqa: E501 - :type: int - """ - - self._schedule_start_time = schedule_start_time - - @property - def schedule_end_time(self): - """Gets the schedule_end_time of this SaveScheduleRequest. # noqa: E501 - - - :return: The schedule_end_time of this SaveScheduleRequest. # noqa: E501 - :rtype: int - """ - return self._schedule_end_time - - @schedule_end_time.setter - def schedule_end_time(self, schedule_end_time): - """Sets the schedule_end_time of this SaveScheduleRequest. - - - :param schedule_end_time: The schedule_end_time of this SaveScheduleRequest. # noqa: E501 - :type: int - """ - - self._schedule_end_time = schedule_end_time - - @property - def zone_id(self): - """Gets the zone_id of this SaveScheduleRequest. # noqa: E501 - - - :return: The zone_id of this SaveScheduleRequest. # noqa: E501 - :rtype: str - """ - return self._zone_id - - @zone_id.setter - def zone_id(self, zone_id): - """Sets the zone_id of this SaveScheduleRequest. - - - :param zone_id: The zone_id of this SaveScheduleRequest. # noqa: E501 - :type: str - """ - - self._zone_id = zone_id - - @property - def description(self): - """Gets the description of this SaveScheduleRequest. # noqa: E501 - - - :return: The description of this SaveScheduleRequest. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this SaveScheduleRequest. - - - :param description: The description of this SaveScheduleRequest. # noqa: E501 - :type: str - """ - - self._description = description - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SaveScheduleRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SaveScheduleRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SaveScheduleRequest"] diff --git a/src/conductor/client/http/models/schema_def.py b/src/conductor/client/http/models/schema_def.py index 3be84a41..62f0a7cf 100644 --- a/src/conductor/client/http/models/schema_def.py +++ b/src/conductor/client/http/models/schema_def.py @@ -1,233 +1,6 @@ -import pprint -from dataclasses import dataclass, field, InitVar -from enum import Enum -from typing import Dict, Any, Optional -import six -from deprecated import deprecated +from conductor.client.adapters.models.schema_def_adapter import ( + SchemaDefAdapter, SchemaType) -from conductor.client.http.models.auditable import Auditable +SchemaDef = SchemaDefAdapter - -class SchemaType(str, Enum): - JSON = "JSON", - AVRO = "AVRO", - PROTOBUF = "PROTOBUF" - - def __str__(self) -> str: - return self.name.__str__() - - -@dataclass -class SchemaDef(Auditable): - swagger_types = { - **Auditable.swagger_types, - 'name': 'str', - 'version': 'int', - 'type': 'str', - 'data': 'dict(str, object)', - 'external_ref': 'str' - } - - attribute_map = { - **Auditable.attribute_map, - 'name': 'name', - 'version': 'version', - 'type': 'type', - 'data': 'data', - 'external_ref': 'externalRef' - } - - # Private fields for properties - _name: Optional[str] = field(default=None, init=False) - _version: int = field(default=1, init=False) - _type: Optional[SchemaType] = field(default=None, init=False) - _data: Optional[Dict[str, object]] = field(default=None, init=False) - _external_ref: Optional[str] = field(default=None, init=False) - - # InitVars for constructor parameters - name_init: InitVar[Optional[str]] = None - version_init: InitVar[Optional[int]] = 1 - type_init: InitVar[Optional[SchemaType]] = None - data_init: InitVar[Optional[Dict[str, object]]] = None - external_ref_init: InitVar[Optional[str]] = None - - discriminator: Any = field(default=None, init=False) - - def __init__(self, name: str = None, version: int = 1, type: SchemaType = None, - data: Dict[str, object] = None, external_ref: str = None, - owner_app: str = None, create_time: int = None, update_time: int = None, - created_by: str = None, updated_by: str = None): # noqa: E501 - super().__init__() - self._name = None - self._version = None - self._type = None - self._data = None - self._external_ref = None - self.discriminator = None - if name is not None: - self.name = name - if version is not None: - self.version = version - if type is not None: - self.type = type - if data is not None: - self.data = data - if external_ref is not None: - self.external_ref = external_ref - - # Set Auditable fields - if owner_app is not None: - self.owner_app = owner_app - if create_time is not None: - self.create_time = create_time - if update_time is not None: - self.update_time = update_time - if created_by is not None: - self.created_by = created_by - if updated_by is not None: - self.updated_by = updated_by - - def __post_init__(self, name_init: Optional[str], version_init: Optional[int], - type_init: Optional[SchemaType], data_init: Optional[Dict[str, object]], - external_ref_init: Optional[str]): - # This is called after __init__ when using @dataclass - # We don't need to do anything here as __init__ handles initialization - pass - - @property - def name(self): - """Gets the name of this SchemaDef. # noqa: E501 - - :return: The name of this SchemaDef. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this SchemaDef. - - :param name: The name of this SchemaDef. # noqa: E501 - :type: str - """ - self._name = name - - @property - @deprecated - def version(self): - """Gets the version of this SchemaDef. # noqa: E501 - - :return: The version of this SchemaDef. # noqa: E501 - :rtype: int - """ - return self._version - - @version.setter - @deprecated - def version(self, version): - """Sets the version of this SchemaDef. - - :param version: The version of this SchemaDef. # noqa: E501 - :type: int - """ - self._version = version - - @property - def type(self) -> SchemaType: - """Gets the type of this SchemaDef. # noqa: E501 - - :return: The type of this SchemaDef. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type: SchemaType): - """Sets the type of this SchemaDef. - - :param type: The type of this SchemaDef. # noqa: E501 - :type: str - """ - self._type = type - - @property - def data(self) -> Dict[str, object]: - """Gets the data of this SchemaDef. # noqa: E501 - - :return: The data of this SchemaDef. # noqa: E501 - :rtype: Dict[str, object] - """ - return self._data - - @data.setter - def data(self, data: Dict[str, object]): - """Sets the data of this SchemaDef. - - :param data: The data of this SchemaDef. # noqa: E501 - :type: Dict[str, object] - """ - self._data = data - - @property - def external_ref(self): - """Gets the external_ref of this SchemaDef. # noqa: E501 - - :return: The external_ref of this SchemaDef. # noqa: E501 - :rtype: str - """ - return self._external_ref - - @external_ref.setter - def external_ref(self, external_ref): - """Sets the external_ref of this SchemaDef. - - :param external_ref: The external_ref of this SchemaDef. # noqa: E501 - :type: str - """ - self._external_ref = external_ref - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SchemaDef, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SchemaDef): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SchemaDef", "SchemaType"] diff --git a/src/conductor/client/http/models/scrollable_search_result_workflow_summary.py b/src/conductor/client/http/models/scrollable_search_result_workflow_summary.py index 4e8631b6..fc1e367c 100644 --- a/src/conductor/client/http/models/scrollable_search_result_workflow_summary.py +++ b/src/conductor/client/http/models/scrollable_search_result_workflow_summary.py @@ -1,125 +1,6 @@ -import pprint -import re # noqa: F401 +from conductor.client.adapters.models.scrollable_search_result_workflow_summary_adapter import \ + ScrollableSearchResultWorkflowSummaryAdapter -import six +ScrollableSearchResultWorkflowSummary = ScrollableSearchResultWorkflowSummaryAdapter - -class ScrollableSearchResultWorkflowSummary(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'results': 'list[WorkflowSummary]', - 'query_id': 'str' - } - - attribute_map = { - 'results': 'results', - 'query_id': 'queryId' - } - - def __init__(self, results=None, query_id=None): # noqa: E501 - """ScrollableSearchResultWorkflowSummary - a model defined in Swagger""" # noqa: E501 - self._results = None - self._query_id = None - self.discriminator = None - if results is not None: - self.results = results - if query_id is not None: - self.query_id = query_id - - @property - def results(self): - """Gets the results of this ScrollableSearchResultWorkflowSummary. # noqa: E501 - - - :return: The results of this ScrollableSearchResultWorkflowSummary. # noqa: E501 - :rtype: list[WorkflowSummary] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this ScrollableSearchResultWorkflowSummary. - - - :param results: The results of this ScrollableSearchResultWorkflowSummary. # noqa: E501 - :type: list[WorkflowSummary] - """ - - self._results = results - - @property - def query_id(self): - """Gets the query_id of this ScrollableSearchResultWorkflowSummary. # noqa: E501 - - - :return: The query_id of this ScrollableSearchResultWorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._query_id - - @query_id.setter - def query_id(self, query_id): - """Sets the query_id of this ScrollableSearchResultWorkflowSummary. - - - :param query_id: The query_id of this ScrollableSearchResultWorkflowSummary. # noqa: E501 - :type: str - """ - - self._query_id = query_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ScrollableSearchResultWorkflowSummary, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ScrollableSearchResultWorkflowSummary): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other +__all__ = ["ScrollableSearchResultWorkflowSummary"] diff --git a/src/conductor/client/http/models/search_result_handled_event_response.py b/src/conductor/client/http/models/search_result_handled_event_response.py new file mode 100644 index 00000000..e284f8dd --- /dev/null +++ b/src/conductor/client/http/models/search_result_handled_event_response.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.search_result_handled_event_response_adapter import \ + SearchResultHandledEventResponseAdapter + +SearchResultHandledEventResponse = SearchResultHandledEventResponseAdapter + +__all__ = ["SearchResultHandledEventResponse"] diff --git a/src/conductor/client/http/models/search_result_task.py b/src/conductor/client/http/models/search_result_task.py index 7131d2e1..9adc5f4b 100644 --- a/src/conductor/client/http/models/search_result_task.py +++ b/src/conductor/client/http/models/search_result_task.py @@ -1,141 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import List, TypeVar, Generic, Optional -from dataclasses import InitVar +from conductor.client.adapters.models.search_result_task_adapter import \ + SearchResultTaskAdapter -T = TypeVar('T') +SearchResultTask = SearchResultTaskAdapter -@dataclass -class SearchResultTask(Generic[T]): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'total_hits': 'int', - 'results': 'list[Task]' - } - - attribute_map = { - 'total_hits': 'totalHits', - 'results': 'results' - } - - total_hits: Optional[int] = field(default=None) - results: Optional[List[T]] = field(default=None) - _total_hits: Optional[int] = field(default=None, init=False, repr=False) - _results: Optional[List[T]] = field(default=None, init=False, repr=False) - - def __init__(self, total_hits=None, results=None): # noqa: E501 - """SearchResultTask - a model defined in Swagger""" # noqa: E501 - self._total_hits = None - self._results = None - self.discriminator = None - if total_hits is not None: - self.total_hits = total_hits - if results is not None: - self.results = results - - def __post_init__(self): - """Initialize private fields after dataclass initialization""" - if self.total_hits is not None and self._total_hits is None: - self._total_hits = self.total_hits - if self.results is not None and self._results is None: - self._results = self.results - - @property - def total_hits(self): - """Gets the total_hits of this SearchResultTask. # noqa: E501 - - - :return: The total_hits of this SearchResultTask. # noqa: E501 - :rtype: int - """ - return self._total_hits - - @total_hits.setter - def total_hits(self, total_hits): - """Sets the total_hits of this SearchResultTask. - - - :param total_hits: The total_hits of this SearchResultTask. # noqa: E501 - :type: int - """ - - self._total_hits = total_hits - - @property - def results(self): - """Gets the results of this SearchResultTask. # noqa: E501 - - - :return: The results of this SearchResultTask. # noqa: E501 - :rtype: list[Task] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this SearchResultTask. - - - :param results: The results of this SearchResultTask. # noqa: E501 - :type: list[Task] - """ - - self._results = results - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SearchResultTask, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchResultTask): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SearchResultTask"] diff --git a/src/conductor/client/http/models/search_result_task_summary.py b/src/conductor/client/http/models/search_result_task_summary.py index d4a0f1fe..370d3308 100644 --- a/src/conductor/client/http/models/search_result_task_summary.py +++ b/src/conductor/client/http/models/search_result_task_summary.py @@ -1,136 +1,7 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import List, Optional, TypeVar, Generic -from deprecated import deprecated +from conductor.client.adapters.models.search_result_task_summary_adapter import \ + SearchResultTaskSummaryAdapter -T = TypeVar('T') +SearchResultTaskSummary = SearchResultTaskSummaryAdapter +SearchResultTaskSummary.__name__ = "SearchResultTaskSummary" -@dataclass -class SearchResultTaskSummary(Generic[T]): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'total_hits': 'int', - 'results': 'list[TaskSummary]' - } - - attribute_map = { - 'total_hits': 'totalHits', - 'results': 'results' - } - - _total_hits: Optional[int] = field(default=None) - _results: Optional[List[T]] = field(default=None) - - def __init__(self, total_hits=None, results=None): # noqa: E501 - """SearchResultTaskSummary - a model defined in Swagger""" # noqa: E501 - self._total_hits = None - self._results = None - self.discriminator = None - if total_hits is not None: - self.total_hits = total_hits - if results is not None: - self.results = results - - def __post_init__(self): - """Initialize dataclass after __init__""" - pass - - @property - def total_hits(self): - """Gets the total_hits of this SearchResultTaskSummary. # noqa: E501 - - - :return: The total_hits of this SearchResultTaskSummary. # noqa: E501 - :rtype: int - """ - return self._total_hits - - @total_hits.setter - def total_hits(self, total_hits): - """Sets the total_hits of this SearchResultTaskSummary. - - - :param total_hits: The total_hits of this SearchResultTaskSummary. # noqa: E501 - :type: int - """ - - self._total_hits = total_hits - - @property - def results(self): - """Gets the results of this SearchResultTaskSummary. # noqa: E501 - - - :return: The results of this SearchResultTaskSummary. # noqa: E501 - :rtype: list[TaskSummary] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this SearchResultTaskSummary. - - - :param results: The results of this SearchResultTaskSummary. # noqa: E501 - :type: list[TaskSummary] - """ - - self._results = results - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SearchResultTaskSummary, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchResultTaskSummary): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SearchResultTaskSummary"] diff --git a/src/conductor/client/http/models/search_result_workflow.py b/src/conductor/client/http/models/search_result_workflow.py index adaa07d8..ac1ddc24 100644 --- a/src/conductor/client/http/models/search_result_workflow.py +++ b/src/conductor/client/http/models/search_result_workflow.py @@ -1,138 +1,7 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import List, TypeVar, Generic, Optional -from dataclasses import InitVar +from conductor.client.adapters.models.search_result_workflow_adapter import \ + SearchResultWorkflowAdapter -T = TypeVar('T') +SearchResultWorkflow = SearchResultWorkflowAdapter +SearchResultWorkflow.__name__ = "SearchResultWorkflow" -@dataclass -class SearchResultWorkflow(Generic[T]): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'total_hits': 'int', - 'results': 'list[Workflow]' - } - - attribute_map = { - 'total_hits': 'totalHits', - 'results': 'results' - } - - total_hits: Optional[int] = field(default=None) - results: Optional[List[T]] = field(default=None) - _total_hits: Optional[int] = field(default=None, init=False, repr=False) - _results: Optional[List[T]] = field(default=None, init=False, repr=False) - - def __init__(self, total_hits=None, results=None): # noqa: E501 - """SearchResultWorkflow - a model defined in Swagger""" # noqa: E501 - self._total_hits = None - self._results = None - self.discriminator = None - if total_hits is not None: - self.total_hits = total_hits - if results is not None: - self.results = results - - def __post_init__(self): - """Initialize private fields after dataclass initialization""" - pass - - @property - def total_hits(self): - """Gets the total_hits of this SearchResultWorkflow. # noqa: E501 - - - :return: The total_hits of this SearchResultWorkflow. # noqa: E501 - :rtype: int - """ - return self._total_hits - - @total_hits.setter - def total_hits(self, total_hits): - """Sets the total_hits of this SearchResultWorkflow. - - - :param total_hits: The total_hits of this SearchResultWorkflow. # noqa: E501 - :type: int - """ - - self._total_hits = total_hits - - @property - def results(self): - """Gets the results of this SearchResultWorkflow. # noqa: E501 - - - :return: The results of this SearchResultWorkflow. # noqa: E501 - :rtype: list[T] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this SearchResultWorkflow. - - - :param results: The results of this SearchResultWorkflow. # noqa: E501 - :type: list[T] - """ - - self._results = results - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SearchResultWorkflow, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchResultWorkflow): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SearchResultWorkflow"] diff --git a/src/conductor/client/http/models/search_result_workflow_schedule_execution_model.py b/src/conductor/client/http/models/search_result_workflow_schedule_execution_model.py index 7fd90517..d37c0fc3 100644 --- a/src/conductor/client/http/models/search_result_workflow_schedule_execution_model.py +++ b/src/conductor/client/http/models/search_result_workflow_schedule_execution_model.py @@ -1,138 +1,8 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import List, Optional, TypeVar, Generic -from dataclasses import InitVar +from conductor.client.adapters.models.search_result_workflow_schedule_execution_model_adapter import \ + SearchResultWorkflowScheduleExecutionModelAdapter -T = TypeVar('T') +SearchResultWorkflowScheduleExecutionModel = ( + SearchResultWorkflowScheduleExecutionModelAdapter +) -@dataclass -class SearchResultWorkflowScheduleExecutionModel(Generic[T]): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'total_hits': 'int', - 'results': 'list[WorkflowScheduleExecutionModel]' - } - - attribute_map = { - 'total_hits': 'totalHits', - 'results': 'results' - } - - total_hits: Optional[int] = field(default=None) - results: Optional[List[T]] = field(default=None) - _total_hits: Optional[int] = field(default=None, init=False, repr=False) - _results: Optional[List[T]] = field(default=None, init=False, repr=False) - - def __init__(self, total_hits=None, results=None): # noqa: E501 - """SearchResultWorkflowScheduleExecutionModel - a model defined in Swagger""" # noqa: E501 - self._total_hits = None - self._results = None - self.discriminator = None - if total_hits is not None: - self.total_hits = total_hits - if results is not None: - self.results = results - - def __post_init__(self): - """Initialize private fields after dataclass initialization""" - pass - - @property - def total_hits(self): - """Gets the total_hits of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The total_hits of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 - :rtype: int - """ - return self._total_hits - - @total_hits.setter - def total_hits(self, total_hits): - """Sets the total_hits of this SearchResultWorkflowScheduleExecutionModel. - - - :param total_hits: The total_hits of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 - :type: int - """ - - self._total_hits = total_hits - - @property - def results(self): - """Gets the results of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The results of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 - :rtype: list[WorkflowScheduleExecutionModel] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this SearchResultWorkflowScheduleExecutionModel. - - - :param results: The results of this SearchResultWorkflowScheduleExecutionModel. # noqa: E501 - :type: list[WorkflowScheduleExecutionModel] - """ - - self._results = results - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SearchResultWorkflowScheduleExecutionModel, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchResultWorkflowScheduleExecutionModel): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SearchResultWorkflowScheduleExecutionModel"] diff --git a/src/conductor/client/http/models/search_result_workflow_summary.py b/src/conductor/client/http/models/search_result_workflow_summary.py index a9b41c64..a3bfa369 100644 --- a/src/conductor/client/http/models/search_result_workflow_summary.py +++ b/src/conductor/client/http/models/search_result_workflow_summary.py @@ -1,135 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import List, Optional, TypeVar, Generic +from conductor.client.adapters.models.search_result_workflow_summary_adapter import \ + SearchResultWorkflowSummaryAdapter -T = TypeVar('T') +SearchResultWorkflowSummary = SearchResultWorkflowSummaryAdapter -@dataclass -class SearchResultWorkflowSummary(Generic[T]): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'total_hits': 'int', - 'results': 'list[WorkflowSummary]' - } - - attribute_map = { - 'total_hits': 'totalHits', - 'results': 'results' - } - - _total_hits: Optional[int] = field(default=None) - _results: Optional[List[T]] = field(default=None) - - def __init__(self, total_hits=None, results=None): # noqa: E501 - """SearchResultWorkflowSummary - a model defined in Swagger""" # noqa: E501 - self._total_hits = None - self._results = None - self.discriminator = None - if total_hits is not None: - self.total_hits = total_hits - if results is not None: - self.results = results - - def __post_init__(self): - """Post initialization for dataclass""" - self.discriminator = None - - @property - def total_hits(self): - """Gets the total_hits of this SearchResultWorkflowSummary. # noqa: E501 - - - :return: The total_hits of this SearchResultWorkflowSummary. # noqa: E501 - :rtype: int - """ - return self._total_hits - - @total_hits.setter - def total_hits(self, total_hits): - """Sets the total_hits of this SearchResultWorkflowSummary. - - - :param total_hits: The total_hits of this SearchResultWorkflowSummary. # noqa: E501 - :type: int - """ - - self._total_hits = total_hits - - @property - def results(self): - """Gets the results of this SearchResultWorkflowSummary. # noqa: E501 - - - :return: The results of this SearchResultWorkflowSummary. # noqa: E501 - :rtype: list[WorkflowSummary] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this SearchResultWorkflowSummary. - - - :param results: The results of this SearchResultWorkflowSummary. # noqa: E501 - :type: list[WorkflowSummary] - """ - - self._results = results - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SearchResultWorkflowSummary, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchResultWorkflowSummary): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SearchResultWorkflowSummary"] diff --git a/src/conductor/client/http/models/service_descriptor.py b/src/conductor/client/http/models/service_descriptor.py new file mode 100644 index 00000000..5d859d42 --- /dev/null +++ b/src/conductor/client/http/models/service_descriptor.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.service_descriptor_adapter import \ + ServiceDescriptorAdapter + +ServiceDescriptor = ServiceDescriptorAdapter + +__all__ = ["ServiceDescriptor"] diff --git a/src/conductor/client/http/models/service_descriptor_proto.py b/src/conductor/client/http/models/service_descriptor_proto.py new file mode 100644 index 00000000..daa34cc1 --- /dev/null +++ b/src/conductor/client/http/models/service_descriptor_proto.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.service_descriptor_proto_adapter import \ + ServiceDescriptorProtoAdapter + +ServiceDescriptorProto = ServiceDescriptorProtoAdapter + +__all__ = ["ServiceDescriptorProto"] diff --git a/src/conductor/client/http/models/service_descriptor_proto_or_builder.py b/src/conductor/client/http/models/service_descriptor_proto_or_builder.py new file mode 100644 index 00000000..678eff72 --- /dev/null +++ b/src/conductor/client/http/models/service_descriptor_proto_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.service_descriptor_proto_or_builder_adapter import \ + ServiceDescriptorProtoOrBuilderAdapter + +ServiceDescriptorProtoOrBuilder = ServiceDescriptorProtoOrBuilderAdapter + +__all__ = ["ServiceDescriptorProtoOrBuilder"] diff --git a/src/conductor/client/http/models/service_method.py b/src/conductor/client/http/models/service_method.py index df03f550..dde1b002 100644 --- a/src/conductor/client/http/models/service_method.py +++ b/src/conductor/client/http/models/service_method.py @@ -1,91 +1,6 @@ -from dataclasses import dataclass -from typing import Optional, List, Dict, Any -import six +from conductor.client.adapters.models.service_method_adapter import \ + ServiceMethodAdapter +ServiceMethod = ServiceMethodAdapter -@dataclass -class ServiceMethod: - """Service method model matching the Java ServiceMethod POJO.""" - - swagger_types = { - 'id': 'int', - 'operation_name': 'str', - 'method_name': 'str', - 'method_type': 'str', - 'input_type': 'str', - 'output_type': 'str', - 'request_params': 'list[RequestParam]', - 'example_input': 'dict' - } - - attribute_map = { - 'id': 'id', - 'operation_name': 'operationName', - 'method_name': 'methodName', - 'method_type': 'methodType', - 'input_type': 'inputType', - 'output_type': 'outputType', - 'request_params': 'requestParams', - 'example_input': 'exampleInput' - } - - id: Optional[int] = None - operation_name: Optional[str] = None - method_name: Optional[str] = None - method_type: Optional[str] = None # GET, PUT, POST, UNARY, SERVER_STREAMING etc. - input_type: Optional[str] = None - output_type: Optional[str] = None - request_params: Optional[List[Any]] = None # List of RequestParam objects - example_input: Optional[Dict[str, Any]] = None - - def __post_init__(self): - """Initialize default values after dataclass creation.""" - if self.request_params is None: - self.request_params = [] - if self.example_input is None: - self.example_input = {} - - def to_dict(self): - """Returns the model properties as a dict using the correct JSON field names.""" - result = {} - for attr, json_key in six.iteritems(self.attribute_map): - value = getattr(self, attr) - if value is not None: - if isinstance(value, list): - result[json_key] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[json_key] = value.to_dict() - elif isinstance(value, dict): - result[json_key] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[json_key] = value - return result - - def __str__(self): - return f"ServiceMethod(operation_name='{self.operation_name}', method_name='{self.method_name}', method_type='{self.method_type}')" - - -# For backwards compatibility, add helper methods -@dataclass -class RequestParam: - """Request parameter model (placeholder - define based on actual Java RequestParam class).""" - - name: Optional[str] = None - type: Optional[str] = None - required: Optional[bool] = False - description: Optional[str] = None - - def to_dict(self): - return { - 'name': self.name, - 'type': self.type, - 'required': self.required, - 'description': self.description - } \ No newline at end of file +__all__ = ["ServiceMethod"] diff --git a/src/conductor/client/http/models/service_options.py b/src/conductor/client/http/models/service_options.py new file mode 100644 index 00000000..e2e07265 --- /dev/null +++ b/src/conductor/client/http/models/service_options.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.service_options_adapter import \ + ServiceOptionsAdapter + +ServiceOptions = ServiceOptionsAdapter + +__all__ = ["ServiceOptions"] diff --git a/src/conductor/client/http/models/service_options_or_builder.py b/src/conductor/client/http/models/service_options_or_builder.py new file mode 100644 index 00000000..854118fb --- /dev/null +++ b/src/conductor/client/http/models/service_options_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.service_options_or_builder_adapter import \ + ServiceOptionsOrBuilderAdapter + +ServiceOptionsOrBuilder = ServiceOptionsOrBuilderAdapter + +__all__ = ["ServiceOptionsOrBuilder"] diff --git a/src/conductor/client/http/models/service_registry.py b/src/conductor/client/http/models/service_registry.py index 6a9a3b36..d897019d 100644 --- a/src/conductor/client/http/models/service_registry.py +++ b/src/conductor/client/http/models/service_registry.py @@ -1,159 +1,6 @@ -from dataclasses import dataclass, field -from typing import List, Optional -from enum import Enum -import six +from conductor.client.adapters.models.service_registry_adapter import ( + Config, OrkesCircuitBreakerConfig, ServiceRegistryAdapter, ServiceType) +ServiceRegistry = ServiceRegistryAdapter -class ServiceType(str, Enum): - HTTP = "HTTP" - GRPC = "gRPC" - - -@dataclass -class OrkesCircuitBreakerConfig: - """Circuit breaker configuration for Orkes services.""" - - swagger_types = { - 'failure_rate_threshold': 'float', - 'sliding_window_size': 'int', - 'minimum_number_of_calls': 'int', - 'wait_duration_in_open_state': 'int', - 'permitted_number_of_calls_in_half_open_state': 'int', - 'slow_call_rate_threshold': 'float', - 'slow_call_duration_threshold': 'int', - 'automatic_transition_from_open_to_half_open_enabled': 'bool', - 'max_wait_duration_in_half_open_state': 'int' - } - - attribute_map = { - 'failure_rate_threshold': 'failureRateThreshold', - 'sliding_window_size': 'slidingWindowSize', - 'minimum_number_of_calls': 'minimumNumberOfCalls', - 'wait_duration_in_open_state': 'waitDurationInOpenState', - 'permitted_number_of_calls_in_half_open_state': 'permittedNumberOfCallsInHalfOpenState', - 'slow_call_rate_threshold': 'slowCallRateThreshold', - 'slow_call_duration_threshold': 'slowCallDurationThreshold', - 'automatic_transition_from_open_to_half_open_enabled': 'automaticTransitionFromOpenToHalfOpenEnabled', - 'max_wait_duration_in_half_open_state': 'maxWaitDurationInHalfOpenState' - } - - failure_rate_threshold: Optional[float] = None - sliding_window_size: Optional[int] = None - minimum_number_of_calls: Optional[int] = None - wait_duration_in_open_state: Optional[int] = None - permitted_number_of_calls_in_half_open_state: Optional[int] = None - slow_call_rate_threshold: Optional[float] = None - slow_call_duration_threshold: Optional[int] = None - automatic_transition_from_open_to_half_open_enabled: Optional[bool] = None - max_wait_duration_in_half_open_state: Optional[int] = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - return result - - -@dataclass -class Config: - """Configuration class for service registry.""" - - swagger_types = { - 'circuit_breaker_config': 'OrkesCircuitBreakerConfig' - } - - attribute_map = { - 'circuit_breaker_config': 'circuitBreakerConfig' - } - - circuit_breaker_config: OrkesCircuitBreakerConfig = field(default_factory=OrkesCircuitBreakerConfig) - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - return result - - -@dataclass -class ServiceRegistry: - """Service registry model for registering HTTP and gRPC services.""" - - swagger_types = { - 'name': 'str', - 'type': 'str', - 'service_uri': 'str', - 'methods': 'list[ServiceMethod]', - 'request_params': 'list[RequestParam]', - 'config': 'Config' - } - - attribute_map = { - 'name': 'name', - 'type': 'type', - 'service_uri': 'serviceURI', - 'methods': 'methods', - 'request_params': 'requestParams', - 'config': 'config' - } - - name: Optional[str] = None - type: Optional[str] = None - service_uri: Optional[str] = None - methods: List['ServiceMethod'] = field(default_factory=list) - request_params: List['RequestParam'] = field(default_factory=list) - config: Config = field(default_factory=Config) - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - return result \ No newline at end of file +__all__ = ["ServiceRegistry", "OrkesCircuitBreakerConfig", "Config", "ServiceType"] diff --git a/src/conductor/client/http/models/signal_response.py b/src/conductor/client/http/models/signal_response.py index 8f97cb30..04364d99 100644 --- a/src/conductor/client/http/models/signal_response.py +++ b/src/conductor/client/http/models/signal_response.py @@ -1,575 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from typing import Dict, Any, Optional, List -from enum import Enum +from conductor.client.adapters.models.signal_response_adapter import ( + SignalResponseAdapter, TaskStatus, WorkflowSignalReturnStrategy) +SignalResponse = SignalResponseAdapter -class WorkflowSignalReturnStrategy(Enum): - """Enum for workflow signal return strategy""" - TARGET_WORKFLOW = "TARGET_WORKFLOW" - BLOCKING_WORKFLOW = "BLOCKING_WORKFLOW" - BLOCKING_TASK = "BLOCKING_TASK" - BLOCKING_TASK_INPUT = "BLOCKING_TASK_INPUT" - - -class TaskStatus(Enum): - """Enum for task status""" - IN_PROGRESS = "IN_PROGRESS" - CANCELED = "CANCELED" - FAILED = "FAILED" - FAILED_WITH_TERMINAL_ERROR = "FAILED_WITH_TERMINAL_ERROR" - COMPLETED = "COMPLETED" - COMPLETED_WITH_ERRORS = "COMPLETED_WITH_ERRORS" - SCHEDULED = "SCHEDULED" - TIMED_OUT = "TIMED_OUT" - READY_FOR_RERUN = "READY_FOR_RERUN" - SKIPPED = "SKIPPED" - - -class SignalResponse: - swagger_types = { - 'response_type': 'str', - 'target_workflow_id': 'str', - 'target_workflow_status': 'str', - 'request_id': 'str', - 'workflow_id': 'str', - 'correlation_id': 'str', - 'input': 'dict(str, object)', - 'output': 'dict(str, object)', - 'task_type': 'str', - 'task_id': 'str', - 'reference_task_name': 'str', - 'retry_count': 'int', - 'task_def_name': 'str', - 'retried_task_id': 'str', - 'workflow_type': 'str', - 'reason_for_incompletion': 'str', - 'priority': 'int', - 'variables': 'dict(str, object)', - 'tasks': 'list[object]', - 'created_by': 'str', - 'create_time': 'int', - 'update_time': 'int', - 'status': 'str' - } - - attribute_map = { - 'response_type': 'responseType', - 'target_workflow_id': 'targetWorkflowId', - 'target_workflow_status': 'targetWorkflowStatus', - 'request_id': 'requestId', - 'workflow_id': 'workflowId', - 'correlation_id': 'correlationId', - 'input': 'input', - 'output': 'output', - 'task_type': 'taskType', - 'task_id': 'taskId', - 'reference_task_name': 'referenceTaskName', - 'retry_count': 'retryCount', - 'task_def_name': 'taskDefName', - 'retried_task_id': 'retriedTaskId', - 'workflow_type': 'workflowType', - 'reason_for_incompletion': 'reasonForIncompletion', - 'priority': 'priority', - 'variables': 'variables', - 'tasks': 'tasks', - 'created_by': 'createdBy', - 'create_time': 'createTime', - 'update_time': 'updateTime', - 'status': 'status' - } - - def __init__(self, **kwargs): - """Initialize with API response data, handling both camelCase and snake_case""" - - # Initialize all attributes with default values - self.response_type = None - self.target_workflow_id = None - self.target_workflow_status = None - self.request_id = None - self.workflow_id = None - self.correlation_id = None - self.input = {} - self.output = {} - self.task_type = None - self.task_id = None - self.reference_task_name = None - self.retry_count = 0 - self.task_def_name = None - self.retried_task_id = None - self.workflow_type = None - self.reason_for_incompletion = None - self.priority = 0 - self.variables = {} - self.tasks = [] - self.created_by = None - self.create_time = 0 - self.update_time = 0 - self.status = None - self.discriminator = None - - # Handle both camelCase (from API) and snake_case keys - reverse_mapping = {v: k for k, v in self.attribute_map.items()} - - for key, value in kwargs.items(): - if key in reverse_mapping: - # Convert camelCase to snake_case - snake_key = reverse_mapping[key] - if snake_key == 'status' and isinstance(value, str): - try: - setattr(self, snake_key, TaskStatus(value)) - except ValueError: - setattr(self, snake_key, value) - else: - setattr(self, snake_key, value) - elif hasattr(self, key): - # Direct snake_case assignment - if key == 'status' and isinstance(value, str): - try: - setattr(self, key, TaskStatus(value)) - except ValueError: - setattr(self, key, value) - else: - setattr(self, key, value) - - # Extract task information from the first IN_PROGRESS task if available - if self.response_type == "TARGET_WORKFLOW" and self.tasks: - in_progress_task = None - for task in self.tasks: - if isinstance(task, dict) and task.get('status') == 'IN_PROGRESS': - in_progress_task = task - break - - # If no IN_PROGRESS task, get the last task - if not in_progress_task and self.tasks: - in_progress_task = self.tasks[-1] if isinstance(self.tasks[-1], dict) else None - - if in_progress_task: - # Map task fields if they weren't already set - if self.task_id is None: - self.task_id = in_progress_task.get('taskId') - if self.task_type is None: - self.task_type = in_progress_task.get('taskType') - if self.reference_task_name is None: - self.reference_task_name = in_progress_task.get('referenceTaskName') - if self.task_def_name is None: - self.task_def_name = in_progress_task.get('taskDefName') - if self.retry_count == 0: - self.retry_count = in_progress_task.get('retryCount', 0) - - def __str__(self): - """Returns a detailed string representation similar to Swagger response""" - - def format_dict(d, indent=12): - if not d: - return "{}" - items = [] - for k, v in d.items(): - if isinstance(v, dict): - formatted_v = format_dict(v, indent + 4) - items.append(f"{' ' * indent}'{k}': {formatted_v}") - elif isinstance(v, list): - formatted_v = format_list(v, indent + 4) - items.append(f"{' ' * indent}'{k}': {formatted_v}") - elif isinstance(v, str): - items.append(f"{' ' * indent}'{k}': '{v}'") - else: - items.append(f"{' ' * indent}'{k}': {v}") - return "{\n" + ",\n".join(items) + f"\n{' ' * (indent - 4)}}}" - - def format_list(lst, indent=12): - if not lst: - return "[]" - items = [] - for item in lst: - if isinstance(item, dict): - formatted_item = format_dict(item, indent + 4) - items.append(f"{' ' * indent}{formatted_item}") - elif isinstance(item, str): - items.append(f"{' ' * indent}'{item}'") - else: - items.append(f"{' ' * indent}{item}") - return "[\n" + ",\n".join(items) + f"\n{' ' * (indent - 4)}]" - - # Format input and output - input_str = format_dict(self.input) if self.input else "{}" - output_str = format_dict(self.output) if self.output else "{}" - variables_str = format_dict(self.variables) if self.variables else "{}" - - # Handle different response types - if self.response_type == "TARGET_WORKFLOW": - # Workflow response - show tasks array - tasks_str = format_list(self.tasks, 12) if self.tasks else "[]" - return f"""SignalResponse( - responseType='{self.response_type}', - targetWorkflowId='{self.target_workflow_id}', - targetWorkflowStatus='{self.target_workflow_status}', - workflowId='{self.workflow_id}', - input={input_str}, - output={output_str}, - priority={self.priority}, - variables={variables_str}, - tasks={tasks_str}, - createdBy='{self.created_by}', - createTime={self.create_time}, - updateTime={self.update_time}, - status='{self.status}' -)""" - - elif self.response_type == "BLOCKING_TASK": - # Task response - show task-specific fields - status_str = self.status.value if hasattr(self.status, 'value') else str(self.status) - return f"""SignalResponse( - responseType='{self.response_type}', - targetWorkflowId='{self.target_workflow_id}', - targetWorkflowStatus='{self.target_workflow_status}', - workflowId='{self.workflow_id}', - input={input_str}, - output={output_str}, - taskType='{self.task_type}', - taskId='{self.task_id}', - referenceTaskName='{self.reference_task_name}', - retryCount={self.retry_count}, - taskDefName='{self.task_def_name}', - workflowType='{self.workflow_type}', - priority={self.priority}, - createTime={self.create_time}, - updateTime={self.update_time}, - status='{status_str}' -)""" - - else: - # Generic response - show all available fields - status_str = self.status.value if hasattr(self.status, 'value') else str(self.status) - result = f"""SignalResponse( - responseType='{self.response_type}', - targetWorkflowId='{self.target_workflow_id}', - targetWorkflowStatus='{self.target_workflow_status}', - workflowId='{self.workflow_id}', - input={input_str}, - output={output_str}, - priority={self.priority}""" - - # Add task fields if they exist - if self.task_type: - result += f",\n taskType='{self.task_type}'" - if self.task_id: - result += f",\n taskId='{self.task_id}'" - if self.reference_task_name: - result += f",\n referenceTaskName='{self.reference_task_name}'" - if self.retry_count > 0: - result += f",\n retryCount={self.retry_count}" - if self.task_def_name: - result += f",\n taskDefName='{self.task_def_name}'" - if self.workflow_type: - result += f",\n workflowType='{self.workflow_type}'" - - # Add workflow fields if they exist - if self.variables: - result += f",\n variables={variables_str}" - if self.tasks: - tasks_str = format_list(self.tasks, 12) - result += f",\n tasks={tasks_str}" - if self.created_by: - result += f",\n createdBy='{self.created_by}'" - - result += f",\n createTime={self.create_time}" - result += f",\n updateTime={self.update_time}" - result += f",\n status='{status_str}'" - result += "\n)" - - return result - - def get_task_by_reference_name(self, ref_name: str) -> Optional[Dict]: - """Get a specific task by its reference name""" - if not self.tasks: - return None - - for task in self.tasks: - if isinstance(task, dict) and task.get('referenceTaskName') == ref_name: - return task - return None - - def get_tasks_by_status(self, status: str) -> List[Dict]: - """Get all tasks with a specific status""" - if not self.tasks: - return [] - - return [task for task in self.tasks - if isinstance(task, dict) and task.get('status') == status] - - def get_in_progress_task(self) -> Optional[Dict]: - """Get the current IN_PROGRESS task""" - in_progress_tasks = self.get_tasks_by_status('IN_PROGRESS') - return in_progress_tasks[0] if in_progress_tasks else None - - def get_all_tasks(self) -> List[Dict]: - """Get all tasks in the workflow""" - return self.tasks if self.tasks else [] - - def get_completed_tasks(self) -> List[Dict]: - """Get all completed tasks""" - return self.get_tasks_by_status('COMPLETED') - - def get_failed_tasks(self) -> List[Dict]: - """Get all failed tasks""" - return self.get_tasks_by_status('FAILED') - - def get_task_chain(self) -> List[str]: - """Get the sequence of task reference names in execution order""" - if not self.tasks: - return [] - - # Sort by seq number if available, otherwise by the order in the list - sorted_tasks = sorted(self.tasks, key=lambda t: t.get('seq', 0) if isinstance(t, dict) else 0) - return [task.get('referenceTaskName', f'task_{i}') - for i, task in enumerate(sorted_tasks) if isinstance(task, dict)] - - # ===== HELPER METHODS (Following Go SDK Pattern) ===== - - def is_target_workflow(self) -> bool: - """Returns True if the response contains target workflow details""" - return self.response_type == "TARGET_WORKFLOW" - - def is_blocking_workflow(self) -> bool: - """Returns True if the response contains blocking workflow details""" - return self.response_type == "BLOCKING_WORKFLOW" - - def is_blocking_task(self) -> bool: - """Returns True if the response contains blocking task details""" - return self.response_type == "BLOCKING_TASK" - - def is_blocking_task_input(self) -> bool: - """Returns True if the response contains blocking task input""" - return self.response_type == "BLOCKING_TASK_INPUT" - - def get_workflow(self) -> Optional[Dict]: - """ - Extract workflow details from a SignalResponse. - Returns None if the response type doesn't contain workflow details. - """ - if not (self.is_target_workflow() or self.is_blocking_workflow()): - return None - - return { - 'workflowId': self.workflow_id, - 'status': self.status.value if hasattr(self.status, 'value') else str(self.status), - 'tasks': self.tasks or [], - 'createdBy': self.created_by, - 'createTime': self.create_time, - 'updateTime': self.update_time, - 'input': self.input or {}, - 'output': self.output or {}, - 'variables': self.variables or {}, - 'priority': self.priority, - 'targetWorkflowId': self.target_workflow_id, - 'targetWorkflowStatus': self.target_workflow_status - } - - def get_blocking_task(self) -> Optional[Dict]: - """ - Extract task details from a SignalResponse. - Returns None if the response type doesn't contain task details. - """ - if not (self.is_blocking_task() or self.is_blocking_task_input()): - return None - - return { - 'taskId': self.task_id, - 'taskType': self.task_type, - 'taskDefName': self.task_def_name, - 'workflowType': self.workflow_type, - 'referenceTaskName': self.reference_task_name, - 'retryCount': self.retry_count, - 'status': self.status.value if hasattr(self.status, 'value') else str(self.status), - 'workflowId': self.workflow_id, - 'input': self.input or {}, - 'output': self.output or {}, - 'priority': self.priority, - 'createTime': self.create_time, - 'updateTime': self.update_time - } - - def get_task_input(self) -> Optional[Dict]: - """ - Extract task input from a SignalResponse. - Only valid for BLOCKING_TASK_INPUT responses. - """ - if not self.is_blocking_task_input(): - return None - - return self.input or {} - - def print_summary(self): - """Print a concise summary for quick overview""" - status_str = self.status.value if hasattr(self.status, 'value') else str(self.status) - - print(f""" -=== Signal Response Summary === -Response Type: {self.response_type} -Workflow ID: {self.workflow_id} -Workflow Status: {self.target_workflow_status} -""") - - if self.is_target_workflow() or self.is_blocking_workflow(): - print(f"Total Tasks: {len(self.tasks) if self.tasks else 0}") - print(f"Workflow Status: {status_str}") - if self.created_by: - print(f"Created By: {self.created_by}") - - if self.is_blocking_task() or self.is_blocking_task_input(): - print(f"Task Info:") - print(f" Task ID: {self.task_id}") - print(f" Task Type: {self.task_type}") - print(f" Reference Name: {self.reference_task_name}") - print(f" Status: {status_str}") - print(f" Retry Count: {self.retry_count}") - if self.workflow_type: - print(f" Workflow Type: {self.workflow_type}") - - def get_response_summary(self) -> str: - """Get a quick text summary of the response type and key info""" - status_str = self.status.value if hasattr(self.status, 'value') else str(self.status) - - if self.is_target_workflow(): - return f"TARGET_WORKFLOW: {self.workflow_id} ({self.target_workflow_status}) - {len(self.tasks) if self.tasks else 0} tasks" - elif self.is_blocking_workflow(): - return f"BLOCKING_WORKFLOW: {self.workflow_id} ({status_str}) - {len(self.tasks) if self.tasks else 0} tasks" - elif self.is_blocking_task(): - return f"BLOCKING_TASK: {self.task_type} ({self.reference_task_name}) - {status_str}" - elif self.is_blocking_task_input(): - return f"BLOCKING_TASK_INPUT: {self.task_type} ({self.reference_task_name}) - Input data available" - else: - return f"UNKNOWN_RESPONSE_TYPE: {self.response_type}" - - def print_tasks_summary(self): - """Print a detailed summary of all tasks""" - if not self.tasks: - print("No tasks found in the response.") - return - - print(f"\n=== Tasks Summary ({len(self.tasks)} tasks) ===") - for i, task in enumerate(self.tasks, 1): - if isinstance(task, dict): - print(f"\nTask {i}:") - print(f" Type: {task.get('taskType', 'UNKNOWN')}") - print(f" Reference Name: {task.get('referenceTaskName', 'UNKNOWN')}") - print(f" Status: {task.get('status', 'UNKNOWN')}") - print(f" Task ID: {task.get('taskId', 'UNKNOWN')}") - print(f" Sequence: {task.get('seq', 'N/A')}") - if task.get('startTime'): - print(f" Start Time: {task.get('startTime')}") - if task.get('endTime'): - print(f" End Time: {task.get('endTime')}") - if task.get('inputData'): - print(f" Input Data: {task.get('inputData')}") - if task.get('outputData'): - print(f" Output Data: {task.get('outputData')}") - if task.get('workerId'): - print(f" Worker ID: {task.get('workerId')}") - - def get_full_json(self) -> str: - """Get the complete response as JSON string (like Swagger)""" - import json - return json.dumps(self.to_dict(), indent=2) - - def save_to_file(self, filename: str): - """Save the complete response to a JSON file""" - import json - with open(filename, 'w') as f: - json.dump(self.to_dict(), f, indent=2) - print(f"Response saved to {filename}") - - def to_dict(self): - """Returns the model properties as a dict with camelCase keys""" - result = {} - - for snake_key, value in self.__dict__.items(): - if value is None or snake_key == 'discriminator': - continue - - # Convert to camelCase using attribute_map - camel_key = self.attribute_map.get(snake_key, snake_key) - - if isinstance(value, TaskStatus): - result[camel_key] = value.value - elif snake_key == 'tasks' and not value: - # For BLOCKING_TASK responses, don't include empty tasks array - if self.response_type != "BLOCKING_TASK": - result[camel_key] = value - elif snake_key in ['task_type', 'task_id', 'reference_task_name', 'task_def_name', - 'workflow_type'] and not value: - # For TARGET_WORKFLOW responses, don't include empty task fields - if self.response_type == "BLOCKING_TASK": - continue - else: - result[camel_key] = value - elif snake_key in ['variables', 'created_by'] and not value: - # Don't include empty variables or None created_by - continue - else: - result[camel_key] = value - - return result - - @classmethod - def from_dict(cls, data: Dict[str, Any]) -> 'SignalResponse': - """Create instance from dictionary with camelCase keys""" - snake_case_data = {} - - # Reverse mapping from camelCase to snake_case - reverse_mapping = {v: k for k, v in cls.attribute_map.items()} - - for camel_key, value in data.items(): - if camel_key in reverse_mapping: - snake_key = reverse_mapping[camel_key] - if snake_key == 'status' and value: - snake_case_data[snake_key] = TaskStatus(value) - else: - snake_case_data[snake_key] = value - - return cls(**snake_case_data) - - @classmethod - def from_api_response(cls, data: Dict[str, Any]) -> 'SignalResponse': - """Create instance from API response dictionary with proper field mapping""" - if not isinstance(data, dict): - return cls() - - kwargs = {} - - # Reverse mapping from camelCase to snake_case - reverse_mapping = {v: k for k, v in cls.attribute_map.items()} - - for camel_key, value in data.items(): - if camel_key in reverse_mapping: - snake_key = reverse_mapping[camel_key] - if snake_key == 'status' and value and isinstance(value, str): - try: - kwargs[snake_key] = TaskStatus(value) - except ValueError: - kwargs[snake_key] = value - else: - kwargs[snake_key] = value - - return cls(**kwargs) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SignalResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SignalResponse", "WorkflowSignalReturnStrategy", "TaskStatus"] diff --git a/src/conductor/client/http/models/skip_task_request.py b/src/conductor/client/http/models/skip_task_request.py index 3cc3f3df..d58024dc 100644 --- a/src/conductor/client/http/models/skip_task_request.py +++ b/src/conductor/client/http/models/skip_task_request.py @@ -1,134 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, asdict -from typing import Dict, Any, Optional +from conductor.client.adapters.models.skip_task_request_adapter import \ + SkipTaskRequestAdapter +SkipTaskRequest = SkipTaskRequestAdapter -@dataclass -class SkipTaskRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'task_input': 'dict(str, object)', - 'task_output': 'dict(str, object)' - } - - attribute_map = { - 'task_input': 'taskInput', - 'task_output': 'taskOutput' - } - - _task_input: Optional[Dict[str, Any]] = field(default=None) - _task_output: Optional[Dict[str, Any]] = field(default=None) - - def __init__(self, task_input=None, task_output=None): # noqa: E501 - """SkipTaskRequest - a model defined in Swagger""" # noqa: E501 - self._task_input = None - self._task_output = None - self.discriminator = None - if task_input is not None: - self.task_input = task_input - if task_output is not None: - self.task_output = task_output - - def __post_init__(self): - """Post initialization for dataclass""" - self.discriminator = None - - @property - def task_input(self): - """Gets the task_input of this SkipTaskRequest. # noqa: E501 - - - :return: The task_input of this SkipTaskRequest. # noqa: E501 - :rtype: dict(str, object) - """ - return self._task_input - - @task_input.setter - def task_input(self, task_input): - """Sets the task_input of this SkipTaskRequest. - - - :param task_input: The task_input of this SkipTaskRequest. # noqa: E501 - :type: dict(str, object) - """ - - self._task_input = task_input - - @property - def task_output(self): - """Gets the task_output of this SkipTaskRequest. # noqa: E501 - - - :return: The task_output of this SkipTaskRequest. # noqa: E501 - :rtype: dict(str, object) - """ - return self._task_output - - @task_output.setter - def task_output(self, task_output): - """Sets the task_output of this SkipTaskRequest. - - - :param task_output: The task_output of this SkipTaskRequest. # noqa: E501 - :type: dict(str, object) - """ - - self._task_output = task_output - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SkipTaskRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SkipTaskRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SkipTaskRequest"] diff --git a/src/conductor/client/http/models/source_code_info.py b/src/conductor/client/http/models/source_code_info.py new file mode 100644 index 00000000..abb960d6 --- /dev/null +++ b/src/conductor/client/http/models/source_code_info.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.source_code_info_adapter import \ + SourceCodeInfoAdapter + +SourceCodeInfo = SourceCodeInfoAdapter + +__all__ = ["SourceCodeInfo"] diff --git a/src/conductor/client/http/models/source_code_info_or_builder.py b/src/conductor/client/http/models/source_code_info_or_builder.py new file mode 100644 index 00000000..f30a4eb0 --- /dev/null +++ b/src/conductor/client/http/models/source_code_info_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.source_code_info_or_builder_adapter import \ + SourceCodeInfoOrBuilderAdapter + +SourceCodeInfoOrBuilder = SourceCodeInfoOrBuilderAdapter + +__all__ = ["SourceCodeInfoOrBuilder"] diff --git a/src/conductor/client/http/models/start_workflow.py b/src/conductor/client/http/models/start_workflow.py index fddc7f7d..90bb056a 100644 --- a/src/conductor/client/http/models/start_workflow.py +++ b/src/conductor/client/http/models/start_workflow.py @@ -1,223 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, Any, Optional -from dataclasses import asdict +from conductor.client.adapters.models.start_workflow_adapter import \ + StartWorkflowAdapter +StartWorkflow = StartWorkflowAdapter -@dataclass -class StartWorkflow: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str', - 'version': 'int', - 'correlation_id': 'str', - 'input': 'dict(str, object)', - 'task_to_domain': 'dict(str, str)' - } - - attribute_map = { - 'name': 'name', - 'version': 'version', - 'correlation_id': 'correlationId', - 'input': 'input', - 'task_to_domain': 'taskToDomain' - } - - name: Optional[str] = field(default=None) - version: Optional[int] = field(default=None) - correlation_id: Optional[str] = field(default=None) - input: Optional[Dict[str, Any]] = field(default=None) - task_to_domain: Optional[Dict[str, str]] = field(default=None) - - # Private backing fields for properties - _name: Optional[str] = field(default=None, init=False, repr=False) - _version: Optional[int] = field(default=None, init=False, repr=False) - _correlation_id: Optional[str] = field(default=None, init=False, repr=False) - _input: Optional[Dict[str, Any]] = field(default=None, init=False, repr=False) - _task_to_domain: Optional[Dict[str, str]] = field(default=None, init=False, repr=False) - - def __init__(self, name=None, version=None, correlation_id=None, input=None, task_to_domain=None): # noqa: E501 - """StartWorkflow - a model defined in Swagger""" # noqa: E501 - self._name = None - self._version = None - self._correlation_id = None - self._input = None - self._task_to_domain = None - self.discriminator = None - if name is not None: - self.name = name - if version is not None: - self.version = version - if correlation_id is not None: - self.correlation_id = correlation_id - if input is not None: - self.input = input - if task_to_domain is not None: - self.task_to_domain = task_to_domain - - def __post_init__(self): - """Initialize private fields after dataclass initialization""" - pass - - @property - def name(self): - """Gets the name of this StartWorkflow. # noqa: E501 - - - :return: The name of this StartWorkflow. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this StartWorkflow. - - - :param name: The name of this StartWorkflow. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def version(self): - """Gets the version of this StartWorkflow. # noqa: E501 - - - :return: The version of this StartWorkflow. # noqa: E501 - :rtype: int - """ - return self._version - - @version.setter - def version(self, version): - """Sets the version of this StartWorkflow. - - - :param version: The version of this StartWorkflow. # noqa: E501 - :type: int - """ - - self._version = version - - @property - def correlation_id(self): - """Gets the correlation_id of this StartWorkflow. # noqa: E501 - - - :return: The correlation_id of this StartWorkflow. # noqa: E501 - :rtype: str - """ - return self._correlation_id - - @correlation_id.setter - def correlation_id(self, correlation_id): - """Sets the correlation_id of this StartWorkflow. - - - :param correlation_id: The correlation_id of this StartWorkflow. # noqa: E501 - :type: str - """ - - self._correlation_id = correlation_id - - @property - def input(self): - """Gets the input of this StartWorkflow. # noqa: E501 - - - :return: The input of this StartWorkflow. # noqa: E501 - :rtype: dict(str, object) - """ - return self._input - - @input.setter - def input(self, input): - """Sets the input of this StartWorkflow. - - - :param input: The input of this StartWorkflow. # noqa: E501 - :type: dict(str, object) - """ - - self._input = input - - @property - def task_to_domain(self): - """Gets the task_to_domain of this StartWorkflow. # noqa: E501 - - - :return: The task_to_domain of this StartWorkflow. # noqa: E501 - :rtype: dict(str, str) - """ - return self._task_to_domain - - @task_to_domain.setter - def task_to_domain(self, task_to_domain): - """Sets the task_to_domain of this StartWorkflow. - - - :param task_to_domain: The task_to_domain of this StartWorkflow. # noqa: E501 - :type: dict(str, str) - """ - - self._task_to_domain = task_to_domain - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(StartWorkflow, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StartWorkflow): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["StartWorkflow"] diff --git a/src/conductor/client/http/models/start_workflow_request.py b/src/conductor/client/http/models/start_workflow_request.py index 29440f8c..2f892234 100644 --- a/src/conductor/client/http/models/start_workflow_request.py +++ b/src/conductor/client/http/models/start_workflow_request.py @@ -1,411 +1,8 @@ -import pprint -import re # noqa: F401 -from dataclasses import dataclass, field, InitVar, fields -from enum import Enum -from typing import Dict, Any, Optional -import six -from deprecated import deprecated +from conductor.client.adapters.models.start_workflow_request_adapter import \ + StartWorkflowRequestAdapter +from conductor.shared.http.enums.idempotency_strategy import \ + IdempotencyStrategy +StartWorkflowRequest = StartWorkflowRequestAdapter -class IdempotencyStrategy(str, Enum): - FAIL = "FAIL", - RETURN_EXISTING = "RETURN_EXISTING" - - def __str__(self) -> str: - return self.name.__str__() - - -@dataclass -class StartWorkflowRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str', - 'version': 'int', - 'correlation_id': 'str', - 'input': 'dict(str, object)', - 'task_to_domain': 'dict(str, str)', - 'workflow_def': 'WorkflowDef', - 'external_input_payload_storage_path': 'str', - 'priority': 'int', - 'created_by': 'str', - 'idempotency_key': 'str', - 'idempotency_strategy': 'str' - } - - attribute_map = { - 'name': 'name', - 'version': 'version', - 'correlation_id': 'correlationId', - 'input': 'input', - 'task_to_domain': 'taskToDomain', - 'workflow_def': 'workflowDef', - 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', - 'priority': 'priority', - 'created_by': 'createdBy', - 'idempotency_key': 'idempotencyKey', - 'idempotency_strategy': 'idempotencyStrategy' - } - - # Dataclass fields - name: str = field(default=None) - version: Optional[int] = field(default=None) - correlation_id: Optional[str] = field(default=None) - input: Optional[Dict[str, Any]] = field(default_factory=dict) - task_to_domain: Optional[Dict[str, str]] = field(default_factory=dict) - workflow_def: Any = field(default=None) - external_input_payload_storage_path: Optional[str] = field(default=None) - priority: Optional[int] = field(default=0) - created_by: Optional[str] = field(default=None) - idempotency_key: Optional[str] = field(default=None) - idempotency_strategy: IdempotencyStrategy = field(default=IdempotencyStrategy.FAIL) - - # Private backing fields - _name: str = field(init=False, repr=False) - _version: Optional[int] = field(init=False, repr=False) - _correlation_id: Optional[str] = field(init=False, repr=False) - _input: Optional[Dict[str, Any]] = field(init=False, repr=False) - _task_to_domain: Optional[Dict[str, str]] = field(init=False, repr=False) - _workflow_def: Any = field(init=False, repr=False) - _external_input_payload_storage_path: Optional[str] = field(init=False, repr=False) - _priority: Optional[int] = field(init=False, repr=False) - _created_by: Optional[str] = field(init=False, repr=False) - _idempotency_key: Optional[str] = field(init=False, repr=False) - _idempotency_strategy: IdempotencyStrategy = field(init=False, repr=False) - - # Original init parameters - init_name: InitVar[str] = None - init_version: InitVar[Optional[int]] = None - init_correlation_id: InitVar[Optional[str]] = None - init_input: InitVar[Optional[Dict[str, Any]]] = None - init_task_to_domain: InitVar[Optional[Dict[str, str]]] = None - init_workflow_def: InitVar[Any] = None - init_external_input_payload_storage_path: InitVar[Optional[str]] = None - init_priority: InitVar[Optional[int]] = None - init_created_by: InitVar[Optional[str]] = None - init_idempotency_key: InitVar[Optional[str]] = None - init_idempotency_strategy: InitVar[IdempotencyStrategy] = IdempotencyStrategy.FAIL - - def __init__(self, name=None, version=None, correlation_id=None, input=None, task_to_domain=None, workflow_def=None, - external_input_payload_storage_path=None, priority=None, created_by=None, - idempotency_key: str = None, idempotency_strategy: IdempotencyStrategy = IdempotencyStrategy.FAIL): # noqa: E501 - """StartWorkflowRequest - a model defined in Swagger""" # noqa: E501 - self._name = None - self._version = None - self._correlation_id = None - self._input = None - self._task_to_domain = None - self._workflow_def = None - self._external_input_payload_storage_path = None - self._priority = None - self._created_by = None - self.discriminator = None - self.name = name - if version is not None: - self.version = version - if correlation_id is not None: - self.correlation_id = correlation_id - if input is not None: - self.input = input - if task_to_domain is not None: - self.task_to_domain = task_to_domain - if workflow_def is not None: - self.workflow_def = workflow_def - if external_input_payload_storage_path is not None: - self.external_input_payload_storage_path = external_input_payload_storage_path - if priority is not None: - self.priority = priority - if created_by is not None: - self.created_by = created_by - if idempotency_key is not None: - self._idempotency_key = idempotency_key - self._idempotency_strategy = idempotency_strategy - else: - self._idempotency_key = None - self._idempotency_strategy = IdempotencyStrategy.FAIL - - def __post_init__(self, init_name, init_version, init_correlation_id, init_input, init_task_to_domain, - init_workflow_def, init_external_input_payload_storage_path, init_priority, init_created_by, - init_idempotency_key, init_idempotency_strategy): - # Initialize from init vars if not already set by __init__ - if self._name is None: - self.name = init_name - if self._version is None: - self.version = init_version - if self._correlation_id is None: - self.correlation_id = init_correlation_id - if self._input is None: - self.input = init_input or {} - if self._task_to_domain is None: - self.task_to_domain = init_task_to_domain or {} - if self._workflow_def is None: - self.workflow_def = init_workflow_def - if self._external_input_payload_storage_path is None: - self.external_input_payload_storage_path = init_external_input_payload_storage_path - if self._priority is None: - self.priority = init_priority or 0 - if self._created_by is None: - self.created_by = init_created_by - if self._idempotency_key is None: - self.idempotency_key = init_idempotency_key - if init_idempotency_key is not None: - self.idempotency_strategy = init_idempotency_strategy - - @property - def name(self): - """Gets the name of this StartWorkflowRequest. # noqa: E501 - - - :return: The name of this StartWorkflowRequest. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this StartWorkflowRequest. - - - :param name: The name of this StartWorkflowRequest. # noqa: E501 - :type: str - """ - self._name = name - - @property - def version(self): - """Gets the version of this StartWorkflowRequest. # noqa: E501 - - - :return: The version of this StartWorkflowRequest. # noqa: E501 - :rtype: int - """ - return self._version - - @version.setter - def version(self, version): - """Sets the version of this StartWorkflowRequest. - - - :param version: The version of this StartWorkflowRequest. # noqa: E501 - :type: int - """ - - self._version = version - - @property - def correlation_id(self): - """Gets the correlation_id of this StartWorkflowRequest. # noqa: E501 - - - :return: The correlation_id of this StartWorkflowRequest. # noqa: E501 - :rtype: str - """ - return self._correlation_id - - @correlation_id.setter - def correlation_id(self, correlation_id): - """Sets the correlation_id of this StartWorkflowRequest. - - - :param correlation_id: The correlation_id of this StartWorkflowRequest. # noqa: E501 - :type: str - """ - - self._correlation_id = correlation_id - - @property - def input(self): - """Gets the input of this StartWorkflowRequest. # noqa: E501 - - - :return: The input of this StartWorkflowRequest. # noqa: E501 - :rtype: dict(str, object) - """ - return self._input - - @input.setter - def input(self, input): - """Sets the input of this StartWorkflowRequest. - - - :param input: The input of this StartWorkflowRequest. # noqa: E501 - :type: dict(str, object) - """ - - self._input = input - - @property - def task_to_domain(self): - """Gets the task_to_domain of this StartWorkflowRequest. # noqa: E501 - - - :return: The task_to_domain of this StartWorkflowRequest. # noqa: E501 - :rtype: dict(str, str) - """ - return self._task_to_domain - - @task_to_domain.setter - def task_to_domain(self, task_to_domain): - """Sets the task_to_domain of this StartWorkflowRequest. - - - :param task_to_domain: The task_to_domain of this StartWorkflowRequest. # noqa: E501 - :type: dict(str, str) - """ - - self._task_to_domain = task_to_domain - - @property - def workflow_def(self): - """Gets the workflow_def of this StartWorkflowRequest. # noqa: E501 - - - :return: The workflow_def of this StartWorkflowRequest. # noqa: E501 - :rtype: WorkflowDef - """ - return self._workflow_def - - @workflow_def.setter - def workflow_def(self, workflow_def): - """Sets the workflow_def of this StartWorkflowRequest. - - - :param workflow_def: The workflow_def of this StartWorkflowRequest. # noqa: E501 - :type: WorkflowDef - """ - - self._workflow_def = workflow_def - - @property - def external_input_payload_storage_path(self): - """Gets the external_input_payload_storage_path of this StartWorkflowRequest. # noqa: E501 - - - :return: The external_input_payload_storage_path of this StartWorkflowRequest. # noqa: E501 - :rtype: str - """ - return self._external_input_payload_storage_path - - @external_input_payload_storage_path.setter - def external_input_payload_storage_path(self, external_input_payload_storage_path): - """Sets the external_input_payload_storage_path of this StartWorkflowRequest. - - - :param external_input_payload_storage_path: The external_input_payload_storage_path of this StartWorkflowRequest. # noqa: E501 - :type: str - """ - - self._external_input_payload_storage_path = external_input_payload_storage_path - - @property - def priority(self): - """Gets the priority of this StartWorkflowRequest. # noqa: E501 - - - :return: The priority of this StartWorkflowRequest. # noqa: E501 - :rtype: int - """ - return self._priority - - @priority.setter - def priority(self, priority): - """Sets the priority of this StartWorkflowRequest. - - - :param priority: The priority of this StartWorkflowRequest. # noqa: E501 - :type: int - """ - - self._priority = priority - - @property - def created_by(self): - """Gets the created_by of this StartWorkflowRequest. # noqa: E501 - - - :return: The created_by of this StartWorkflowRequest. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this StartWorkflowRequest. - - - :param created_by: The created_by of this StartWorkflowRequest. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - def idempotency_key(self): - return self._idempotency_key - - @idempotency_key.setter - def idempotency_key(self, idempotency_key: str): - self._idempotency_key = idempotency_key - - @property - def idempotency_strategy(self) -> IdempotencyStrategy: - return self._idempotency_strategy - - @idempotency_strategy.setter - def idempotency_strategy(self, idempotency_strategy: IdempotencyStrategy): - self._idempotency_strategy = idempotency_strategy - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(StartWorkflowRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StartWorkflowRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["StartWorkflowRequest", "IdempotencyStrategy"] diff --git a/src/conductor/client/http/models/state_change_event.py b/src/conductor/client/http/models/state_change_event.py index 8a822424..a77c1d59 100644 --- a/src/conductor/client/http/models/state_change_event.py +++ b/src/conductor/client/http/models/state_change_event.py @@ -1,179 +1,6 @@ -from dataclasses import dataclass, field, InitVar -from enum import Enum -from typing import Union, List, Dict, Optional -from typing_extensions import Self -from deprecated import deprecated +from conductor.client.adapters.models.state_change_event_adapter import ( + StateChangeConfig, StateChangeEventAdapter, StateChangeEventType) +StateChangeEvent = StateChangeEventAdapter -class StateChangeEventType(Enum): - onScheduled = 'onScheduled' - onStart = 'onStart' - onFailed = 'onFailed' - onSuccess = 'onSuccess' - onCancelled = 'onCancelled' - - -@dataclass -class StateChangeEvent: - swagger_types = { - 'type': 'str', - 'payload': 'Dict[str, object]' - } - - attribute_map = { - 'type': 'type', - 'payload': 'payload' - } - - _type: str = field(default=None, init=False) - _payload: Dict[str, object] = field(default=None, init=False) - - # Keep original init for backward compatibility - def __init__(self, type: str, payload: Dict[str, object]) -> None: - self._type = type - self._payload = payload - - def __post_init__(self) -> None: - pass - - @property - def type(self): - return self._type - - @type.setter - def type(self, type: str) -> Self: - self._type = type - - @property - def payload(self): - return self._payload - - @payload.setter - def payload(self, payload: Dict[str, object]) -> Self: - self._payload = payload - - def to_dict(self) -> Dict: - """Returns the model properties as a dict""" - result = {} - for attr, _ in self.swagger_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - return result - - def to_str(self) -> str: - """Returns the string representation of the model""" - return f"StateChangeEvent{{type='{self.type}', payload={self.payload}}}" - - def __repr__(self) -> str: - return self.to_str() - - def __eq__(self, other) -> bool: - """Returns true if both objects are equal""" - if not isinstance(other, StateChangeEvent): - return False - return self.type == other.type and self.payload == other.payload - - def __ne__(self, other) -> bool: - """Returns true if both objects are not equal""" - return not self == other - - -@dataclass -class StateChangeConfig: - swagger_types = { - 'type': 'str', - 'events': 'list[StateChangeEvent]' - } - - attribute_map = { - 'type': 'type', - 'events': 'events' - } - - _type: str = field(default=None, init=False) - _events: List[StateChangeEvent] = field(default=None, init=False) - - # Keep original init for backward compatibility - def __init__(self, event_type: Union[str, StateChangeEventType, List[StateChangeEventType]] = None, events: List[StateChangeEvent] = None) -> None: - if event_type is None: - return - if isinstance(event_type, list): - str_values = [] - for et in event_type: - str_values.append(et.name) - self._type = ','.join(str_values) - else: - self._type = event_type.name - self._events = events - - def __post_init__(self) -> None: - pass - - @property - def type(self): - return self._type - - @type.setter - def type(self, event_type: StateChangeEventType) -> Self: - self._type = event_type.name - - @property - def events(self): - return self._events - - @events.setter - def events(self, events: List[StateChangeEvent]) -> Self: - self._events = events - - def to_dict(self) -> Dict: - """Returns the model properties as a dict""" - result = {} - for attr, _ in self.swagger_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - return result - - def to_str(self) -> str: - """Returns the string representation of the model""" - return f"StateChangeConfig{{type='{self.type}', events={self.events}}}" - - def __repr__(self) -> str: - return self.to_str() - - def __eq__(self, other) -> bool: - """Returns true if both objects are equal""" - if not isinstance(other, StateChangeConfig): - return False - return self.type == other.type and self.events == other.events - - def __ne__(self, other) -> bool: - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["StateChangeEvent", "StateChangeEventType", "StateChangeConfig"] diff --git a/src/conductor/client/http/models/sub_workflow_params.py b/src/conductor/client/http/models/sub_workflow_params.py index 01b0e6e3..39f55bb0 100644 --- a/src/conductor/client/http/models/sub_workflow_params.py +++ b/src/conductor/client/http/models/sub_workflow_params.py @@ -1,268 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import Dict, Optional, Any, Union -from deprecated import deprecated +from conductor.client.adapters.models.sub_workflow_params_adapter import \ + SubWorkflowParamsAdapter +SubWorkflowParams = SubWorkflowParamsAdapter -@dataclass -class SubWorkflowParams: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str', - 'version': 'int', - 'task_to_domain': 'dict(str, str)', - 'workflow_definition': 'WorkflowDef', - 'idempotency_key': 'str', - 'idempotency_strategy': 'IdempotencyStrategy', - 'priority': 'object' - } - - attribute_map = { - 'name': 'name', - 'version': 'version', - 'task_to_domain': 'taskToDomain', - 'workflow_definition': 'workflowDefinition', - 'idempotency_key': 'idempotencyKey', - 'idempotency_strategy': 'idempotencyStrategy', - 'priority': 'priority' - } - - _name: Optional[str] = field(default=None) - _version: Optional[int] = field(default=None) - _task_to_domain: Optional[Dict[str, str]] = field(default=None) - _workflow_definition: Optional[Any] = field(default=None) - _idempotency_key: Optional[str] = field(default=None) - _idempotency_strategy: Optional[Any] = field(default=None) - _priority: Optional[Any] = field(default=None) - - def __init__(self, name=None, version=None, task_to_domain=None, workflow_definition=None, idempotency_key=None, idempotency_strategy=None, priority=None): # noqa: E501 - """SubWorkflowParams - a model defined in Swagger""" # noqa: E501 - self._name = None - self._version = None - self._task_to_domain = None - self._workflow_definition = None - self._idempotency_key = None - self._idempotency_strategy = None - self._priority = None - self.discriminator = None - self.name = name - if version is not None: - self.version = version - if task_to_domain is not None: - self.task_to_domain = task_to_domain - if workflow_definition is not None: - self.workflow_definition = workflow_definition - if idempotency_key is not None: - self.idempotency_key = idempotency_key - if idempotency_strategy is not None: - self.idempotency_strategy = idempotency_strategy - if priority is not None: - self.priority = priority - - def __post_init__(self): - """Post initialization for dataclass""" - pass - - @property - def name(self): - """Gets the name of this SubWorkflowParams. # noqa: E501 - - - :return: The name of this SubWorkflowParams. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this SubWorkflowParams. - - - :param name: The name of this SubWorkflowParams. # noqa: E501 - :type: str - """ - self._name = name - - @property - def version(self): - """Gets the version of this SubWorkflowParams. # noqa: E501 - - - :return: The version of this SubWorkflowParams. # noqa: E501 - :rtype: int - """ - return self._version - - @version.setter - def version(self, version): - """Sets the version of this SubWorkflowParams. - - - :param version: The version of this SubWorkflowParams. # noqa: E501 - :type: int - """ - - self._version = version - - @property - def task_to_domain(self): - """Gets the task_to_domain of this SubWorkflowParams. # noqa: E501 - - - :return: The task_to_domain of this SubWorkflowParams. # noqa: E501 - :rtype: dict(str, str) - """ - return self._task_to_domain - - @task_to_domain.setter - def task_to_domain(self, task_to_domain): - """Sets the task_to_domain of this SubWorkflowParams. - - - :param task_to_domain: The task_to_domain of this SubWorkflowParams. # noqa: E501 - :type: dict(str, str) - """ - - self._task_to_domain = task_to_domain - - @property - def workflow_definition(self): - """Gets the workflow_definition of this SubWorkflowParams. # noqa: E501 - - - :return: The workflow_definition of this SubWorkflowParams. # noqa: E501 - :rtype: WorkflowDef - """ - return self._workflow_definition - - @workflow_definition.setter - def workflow_definition(self, workflow_definition): - """Sets the workflow_definition of this SubWorkflowParams. - - - :param workflow_definition: The workflow_definition of this SubWorkflowParams. # noqa: E501 - :type: WorkflowDef - """ - - self._workflow_definition = workflow_definition - - @property - def idempotency_key(self): - """Gets the idempotency_key of this SubWorkflowParams. # noqa: E501 - - - :return: The idempotency_key of this SubWorkflowParams. # noqa: E501 - :rtype: str - """ - return self._idempotency_key - - @idempotency_key.setter - def idempotency_key(self, idempotency_key): - """Sets the idempotency_key of this SubWorkflowParams. - - - :param idempotency_key: The idempotency_key of this SubWorkflowParams. # noqa: E501 - :type: str - """ - - self._idempotency_key = idempotency_key - - @property - def idempotency_strategy(self): - """Gets the idempotency_strategy of this SubWorkflowParams. # noqa: E501 - - - :return: The idempotency_strategy of this SubWorkflowParams. # noqa: E501 - :rtype: IdempotencyStrategy - """ - return self._idempotency_strategy - - @idempotency_strategy.setter - def idempotency_strategy(self, idempotency_strategy): - """Sets the idempotency_strategy of this SubWorkflowParams. - - - :param idempotency_strategy: The idempotency_strategy of this SubWorkflowParams. # noqa: E501 - :type: IdempotencyStrategy - """ - - self._idempotency_strategy = idempotency_strategy - - @property - def priority(self): - """Gets the priority of this SubWorkflowParams. # noqa: E501 - - - :return: The priority of this SubWorkflowParams. # noqa: E501 - :rtype: object - """ - return self._priority - - @priority.setter - def priority(self, priority): - """Sets the priority of this SubWorkflowParams. - - - :param priority: The priority of this SubWorkflowParams. # noqa: E501 - :type: object - """ - - self._priority = priority - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SubWorkflowParams, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SubWorkflowParams): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SubWorkflowParams"] diff --git a/src/conductor/client/http/models/subject_ref.py b/src/conductor/client/http/models/subject_ref.py index 72ea47df..99b7286d 100644 --- a/src/conductor/client/http/models/subject_ref.py +++ b/src/conductor/client/http/models/subject_ref.py @@ -1,149 +1,6 @@ -import pprint -import re # noqa: F401 -from dataclasses import dataclass, field, InitVar -from typing import Optional +from conductor.client.adapters.models.subject_ref_adapter import \ + SubjectRefAdapter -import six +SubjectRef = SubjectRefAdapter - -@dataclass -class SubjectRef: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'type': 'str', - 'id': 'str' - } - - attribute_map = { - 'type': 'type', - 'id': 'id' - } - - _type: Optional[str] = field(default=None, init=False) - _id: Optional[str] = field(default=None, init=False) - - # InitVars for backward compatibility with the old __init__ - type: InitVar[Optional[str]] = None - id: InitVar[Optional[str]] = None - - discriminator: Optional[str] = field(default=None, init=False) - - def __init__(self, type=None, id=None): # noqa: E501 - """SubjectRef - a model defined in Swagger""" # noqa: E501 - self._type = None - self._id = None - self.discriminator = None - if type is not None: - self.type = type - self.id = id - - def __post_init__(self, type: Optional[str], id: Optional[str]): - if type is not None: - self.type = type - if id is not None: - self.id = id - - @property - def type(self): - """Gets the type of this SubjectRef. # noqa: E501 - - User, role or group # noqa: E501 - - :return: The type of this SubjectRef. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this SubjectRef. - - User, role or group # noqa: E501 - - :param type: The type of this SubjectRef. # noqa: E501 - :type: str - """ - allowed_values = ["USER", "ROLE", "GROUP"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - @property - def id(self): - """Gets the id of this SubjectRef. # noqa: E501 - - - :return: The id of this SubjectRef. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this SubjectRef. - - - :param id: The id of this SubjectRef. # noqa: E501 - :type: str - """ - self._id = id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SubjectRef, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SubjectRef): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["SubjectRef"] diff --git a/src/conductor/client/http/models/tag.py b/src/conductor/client/http/models/tag.py new file mode 100644 index 00000000..743a2548 --- /dev/null +++ b/src/conductor/client/http/models/tag.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.tag_adapter import TagAdapter, TypeEnum + +Tag = TagAdapter + +__all__ = ["Tag", "TypeEnum"] diff --git a/src/conductor/client/http/models/tag_object.py b/src/conductor/client/http/models/tag_object.py index 0beee219..96f93156 100644 --- a/src/conductor/client/http/models/tag_object.py +++ b/src/conductor/client/http/models/tag_object.py @@ -1,188 +1,7 @@ -# coding: utf-8 +from conductor.client.adapters.models.tag_adapter import TypeEnum +from conductor.client.adapters.models.tag_object_adapter import \ + TagObjectAdapter -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Any, Dict, List, Optional -from enum import Enum -from deprecated import deprecated +TagObject = TagObjectAdapter -class TypeEnum(str, Enum): - METADATA = "METADATA" - RATE_LIMIT = "RATE_LIMIT" - -@dataclass -class TagObject: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'key': 'str', - 'type': 'str', - 'value': 'object' - } - - attribute_map = { - 'key': 'key', - 'type': 'type', - 'value': 'value' - } - - # Dataclass fields - _key: Optional[str] = field(default=None) - _type: Optional[str] = field(default=None) - _value: Any = field(default=None) - - # InitVars for constructor parameters - key: InitVar[Optional[str]] = None - type: InitVar[Optional[str]] = None - value: InitVar[Any] = None - - discriminator: Optional[str] = field(default=None) - - def __init__(self, key=None, type=None, value=None): # noqa: E501 - """TagObject - a model defined in Swagger""" # noqa: E501 - self._key = None - self._type = None - self._value = None - self.discriminator = None - if key is not None: - self.key = key - if type is not None: - self.type = type - if value is not None: - self.value = value - - def __post_init__(self, key, type, value): - if key is not None: - self.key = key - if type is not None: - self.type = type - if value is not None: - self.value = value - - @property - def key(self): - """Gets the key of this TagObject. # noqa: E501 - - - :return: The key of this TagObject. # noqa: E501 - :rtype: str - """ - return self._key - - @key.setter - def key(self, key): - """Sets the key of this TagObject. - - - :param key: The key of this TagObject. # noqa: E501 - :type: str - """ - - self._key = key - - @property - @deprecated("This field is deprecated in the Java SDK") - def type(self): - """Gets the type of this TagObject. # noqa: E501 - - - :return: The type of this TagObject. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - @deprecated("This field is deprecated in the Java SDK") - def type(self, type): - """Sets the type of this TagObject. - - - :param type: The type of this TagObject. # noqa: E501 - :type: str - """ - allowed_values = [TypeEnum.METADATA.value, TypeEnum.RATE_LIMIT.value] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - @property - def value(self): - """Gets the value of this TagObject. # noqa: E501 - - - :return: The value of this TagObject. # noqa: E501 - :rtype: object - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this TagObject. - - - :param value: The value of this TagObject. # noqa: E501 - :type: object - """ - - self._value = value - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TagObject, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TagObject): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["TagObject", "TypeEnum"] diff --git a/src/conductor/client/http/models/tag_string.py b/src/conductor/client/http/models/tag_string.py index 9325683f..28d495ec 100644 --- a/src/conductor/client/http/models/tag_string.py +++ b/src/conductor/client/http/models/tag_string.py @@ -1,180 +1,7 @@ -# coding: utf-8 +from conductor.client.adapters.models.tag_adapter import TypeEnum +from conductor.client.adapters.models.tag_string_adapter import \ + TagStringAdapter -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, asdict, fields -from typing import Optional, Dict, List, Any -from enum import Enum -from deprecated import deprecated +TagString = TagStringAdapter - -class TypeEnum(str, Enum): - METADATA = "METADATA" - RATE_LIMIT = "RATE_LIMIT" - - -@dataclass -class TagString: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _key: Optional[str] = field(default=None, init=False, repr=False) - _type: Optional[str] = field(default=None, init=False, repr=False) - _value: Optional[str] = field(default=None, init=False, repr=False) - - swagger_types = { - 'key': 'str', - 'type': 'str', - 'value': 'str' - } - - attribute_map = { - 'key': 'key', - 'type': 'type', - 'value': 'value' - } - - discriminator: None = field(default=None, repr=False) - - def __init__(self, key=None, type=None, value=None): # noqa: E501 - """TagString - a model defined in Swagger""" # noqa: E501 - self._key = None - self._type = None - self._value = None - self.discriminator = None - if key is not None: - self.key = key - if type is not None: - self.type = type - if value is not None: - self.value = value - - def __post_init__(self): - """Initialize after dataclass initialization""" - pass - - @property - def key(self): - """Gets the key of this TagString. # noqa: E501 - - - :return: The key of this TagString. # noqa: E501 - :rtype: str - """ - return self._key - - @key.setter - def key(self, key): - """Sets the key of this TagString. - - - :param key: The key of this TagString. # noqa: E501 - :type: str - """ - - self._key = key - - @property - @deprecated(reason="This field is deprecated in the Java SDK") - def type(self): - """Gets the type of this TagString. # noqa: E501 - - - :return: The type of this TagString. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - @deprecated(reason="This field is deprecated in the Java SDK") - def type(self, type): - """Sets the type of this TagString. - - - :param type: The type of this TagString. # noqa: E501 - :type: str - """ - allowed_values = [TypeEnum.METADATA.value, TypeEnum.RATE_LIMIT.value] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - @property - def value(self): - """Gets the value of this TagString. # noqa: E501 - - - :return: The value of this TagString. # noqa: E501 - :rtype: str - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this TagString. - - - :param value: The value of this TagString. # noqa: E501 - :type: str - """ - - self._value = value - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TagString, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TagString): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["TagString", "TypeEnum"] diff --git a/src/conductor/client/http/models/target_ref.py b/src/conductor/client/http/models/target_ref.py index 2cf83acd..bd3f497f 100644 --- a/src/conductor/client/http/models/target_ref.py +++ b/src/conductor/client/http/models/target_ref.py @@ -1,156 +1,6 @@ -import pprint -import re # noqa: F401 -from dataclasses import dataclass, field, InitVar -from typing import Optional -import six +from conductor.client.adapters.models.target_ref_adapter import \ + TargetRefAdapter -from conductor.shared.http.enums.target_type import TargetType +TargetRef = TargetRefAdapter - -@dataclass -class TargetRef: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'type': 'str', - 'id': 'str' - } - - attribute_map = { - 'type': 'type', - 'id': 'id' - } - - # Dataclass fields - type: Optional[str] = field(default=None) - id: Optional[str] = field(default=None) - - # InitVar for backward compatibility - type_init: InitVar[Optional[str]] = field(default=None) - id_init: InitVar[Optional[str]] = field(default=None) - - # Private backing fields - _type: Optional[str] = field(init=False, default=None, repr=False) - _id: Optional[str] = field(init=False, default=None, repr=False) - - # Keep original __init__ for backward compatibility - def __init__(self, type=None, id=None): # noqa: E501 - """TargetRef - a model defined in Swagger""" # noqa: E501 - self._type = None - self._id = None - self.discriminator = None - self.type = type - self.id = id - - def __post_init__(self, type_init, id_init): - # This will be called when instantiated as a dataclass - if not hasattr(self, 'discriminator'): - self.discriminator = None - - # Use init values if provided via dataclass instantiation - if type_init is not None and self._type is None: - self.type = type_init - if id_init is not None and self._id is None: - self.id = id_init - - @property - def type(self): - """Gets the type of this TargetRef. # noqa: E501 - - - :return: The type of this TargetRef. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this TargetRef. - - - :param type: The type of this TargetRef. # noqa: E501 - :type: str - """ - allowed_values = [t.value for t in TargetType] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - @property - def id(self): - """Gets the id of this TargetRef. # noqa: E501 - - - :return: The id of this TargetRef. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this TargetRef. - - - :param id: The id of this TargetRef. # noqa: E501 - :type: str - """ - self._id = id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TargetRef, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TargetRef): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["TargetRef"] diff --git a/src/conductor/client/http/models/task.py b/src/conductor/client/http/models/task.py index c1135217..3c0d1f5d 100644 --- a/src/conductor/client/http/models/task.py +++ b/src/conductor/client/http/models/task.py @@ -1,1248 +1,5 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, fields -from typing import Dict, List, Optional, Any, Union -from deprecated import deprecated +from conductor.client.adapters.models.task_adapter import TaskAdapter -from conductor.client.http.models import WorkflowTask -from conductor.client.http.models.task_result import TaskResult -from conductor.shared.http.enums import TaskResultStatus +Task = TaskAdapter - -@dataclass -class Task: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _task_type: str = field(default=None) - _status: str = field(default=None) - _input_data: Dict[str, object] = field(default=None) - _reference_task_name: str = field(default=None) - _retry_count: int = field(default=None) - _seq: int = field(default=None) - _correlation_id: str = field(default=None) - _poll_count: int = field(default=None) - _task_def_name: str = field(default=None) - _scheduled_time: int = field(default=None) - _start_time: int = field(default=None) - _end_time: int = field(default=None) - _update_time: int = field(default=None) - _start_delay_in_seconds: int = field(default=None) - _retried_task_id: str = field(default=None) - _retried: bool = field(default=None) - _executed: bool = field(default=None) - _callback_from_worker: bool = field(default=None) - _response_timeout_seconds: int = field(default=None) - _workflow_instance_id: str = field(default=None) - _workflow_type: str = field(default=None) - _task_id: str = field(default=None) - _reason_for_incompletion: str = field(default=None) - _callback_after_seconds: int = field(default=None) - _worker_id: str = field(default=None) - _output_data: Dict[str, object] = field(default=None) - _workflow_task: WorkflowTask = field(default=None) - _domain: str = field(default=None) - _rate_limit_per_frequency: int = field(default=None) - _rate_limit_frequency_in_seconds: int = field(default=None) - _external_input_payload_storage_path: str = field(default=None) - _external_output_payload_storage_path: str = field(default=None) - _workflow_priority: int = field(default=None) - _execution_name_space: str = field(default=None) - _isolation_group_id: str = field(default=None) - _iteration: int = field(default=None) - _sub_workflow_id: str = field(default=None) - _subworkflow_changed: bool = field(default=None) - _parent_task_id: str = field(default=None) - _first_start_time: int = field(default=None) - - # Fields that are in Python but not in Java - _loop_over_task: bool = field(default=None) - _task_definition: Any = field(default=None) - _queue_wait_time: int = field(default=None) - - swagger_types = { - 'task_type': 'str', - 'status': 'str', - 'input_data': 'dict(str, object)', - 'reference_task_name': 'str', - 'retry_count': 'int', - 'seq': 'int', - 'correlation_id': 'str', - 'poll_count': 'int', - 'task_def_name': 'str', - 'scheduled_time': 'int', - 'start_time': 'int', - 'end_time': 'int', - 'update_time': 'int', - 'start_delay_in_seconds': 'int', - 'retried_task_id': 'str', - 'retried': 'bool', - 'executed': 'bool', - 'callback_from_worker': 'bool', - 'response_timeout_seconds': 'int', - 'workflow_instance_id': 'str', - 'workflow_type': 'str', - 'task_id': 'str', - 'reason_for_incompletion': 'str', - 'callback_after_seconds': 'int', - 'worker_id': 'str', - 'output_data': 'dict(str, object)', - 'workflow_task': 'WorkflowTask', - 'domain': 'str', - 'rate_limit_per_frequency': 'int', - 'rate_limit_frequency_in_seconds': 'int', - 'external_input_payload_storage_path': 'str', - 'external_output_payload_storage_path': 'str', - 'workflow_priority': 'int', - 'execution_name_space': 'str', - 'isolation_group_id': 'str', - 'iteration': 'int', - 'sub_workflow_id': 'str', - 'subworkflow_changed': 'bool', - 'parent_task_id': 'str', - 'first_start_time': 'int', - 'loop_over_task': 'bool', - 'task_definition': 'TaskDef', - 'queue_wait_time': 'int' - } - - attribute_map = { - 'task_type': 'taskType', - 'status': 'status', - 'input_data': 'inputData', - 'reference_task_name': 'referenceTaskName', - 'retry_count': 'retryCount', - 'seq': 'seq', - 'correlation_id': 'correlationId', - 'poll_count': 'pollCount', - 'task_def_name': 'taskDefName', - 'scheduled_time': 'scheduledTime', - 'start_time': 'startTime', - 'end_time': 'endTime', - 'update_time': 'updateTime', - 'start_delay_in_seconds': 'startDelayInSeconds', - 'retried_task_id': 'retriedTaskId', - 'retried': 'retried', - 'executed': 'executed', - 'callback_from_worker': 'callbackFromWorker', - 'response_timeout_seconds': 'responseTimeoutSeconds', - 'workflow_instance_id': 'workflowInstanceId', - 'workflow_type': 'workflowType', - 'task_id': 'taskId', - 'reason_for_incompletion': 'reasonForIncompletion', - 'callback_after_seconds': 'callbackAfterSeconds', - 'worker_id': 'workerId', - 'output_data': 'outputData', - 'workflow_task': 'workflowTask', - 'domain': 'domain', - 'rate_limit_per_frequency': 'rateLimitPerFrequency', - 'rate_limit_frequency_in_seconds': 'rateLimitFrequencyInSeconds', - 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', - 'external_output_payload_storage_path': 'externalOutputPayloadStoragePath', - 'workflow_priority': 'workflowPriority', - 'execution_name_space': 'executionNameSpace', - 'isolation_group_id': 'isolationGroupId', - 'iteration': 'iteration', - 'sub_workflow_id': 'subWorkflowId', - 'subworkflow_changed': 'subworkflowChanged', - 'parent_task_id': 'parentTaskId', - 'first_start_time': 'firstStartTime', - 'loop_over_task': 'loopOverTask', - 'task_definition': 'taskDefinition', - 'queue_wait_time': 'queueWaitTime' - } - - def __init__(self, task_type=None, status=None, input_data=None, reference_task_name=None, retry_count=None, - seq=None, correlation_id=None, poll_count=None, task_def_name=None, scheduled_time=None, - start_time=None, end_time=None, update_time=None, start_delay_in_seconds=None, retried_task_id=None, - retried=None, executed=None, callback_from_worker=None, response_timeout_seconds=None, - workflow_instance_id=None, workflow_type=None, task_id=None, reason_for_incompletion=None, - callback_after_seconds=None, worker_id=None, output_data=None, workflow_task=None, domain=None, - rate_limit_per_frequency=None, rate_limit_frequency_in_seconds=None, - external_input_payload_storage_path=None, external_output_payload_storage_path=None, - workflow_priority=None, execution_name_space=None, isolation_group_id=None, iteration=None, - sub_workflow_id=None, subworkflow_changed=None, loop_over_task=None, task_definition=None, - queue_wait_time=None, parent_task_id=None, first_start_time=None): # noqa: E501 - """Task - a model defined in Swagger""" # noqa: E501 - self._task_type = None - self._status = None - self._input_data = None - self._reference_task_name = None - self._retry_count = None - self._seq = None - self._correlation_id = None - self._poll_count = None - self._task_def_name = None - self._scheduled_time = None - self._start_time = None - self._end_time = None - self._update_time = None - self._start_delay_in_seconds = None - self._retried_task_id = None - self._retried = None - self._executed = None - self._callback_from_worker = None - self._response_timeout_seconds = None - self._workflow_instance_id = None - self._workflow_type = None - self._task_id = None - self._reason_for_incompletion = None - self._callback_after_seconds = None - self._worker_id = None - self._output_data = None - self._workflow_task = None - self._domain = None - self._rate_limit_per_frequency = None - self._rate_limit_frequency_in_seconds = None - self._external_input_payload_storage_path = None - self._external_output_payload_storage_path = None - self._workflow_priority = None - self._execution_name_space = None - self._isolation_group_id = None - self._iteration = None - self._sub_workflow_id = None - self._subworkflow_changed = None - self._parent_task_id = None - self._first_start_time = None - self._loop_over_task = None - self._task_definition = None - self._queue_wait_time = None - self.discriminator = None - if task_type is not None: - self.task_type = task_type - if status is not None: - self.status = status - if input_data is not None: - self.input_data = input_data - if reference_task_name is not None: - self.reference_task_name = reference_task_name - if retry_count is not None: - self.retry_count = retry_count - if seq is not None: - self.seq = seq - if correlation_id is not None: - self.correlation_id = correlation_id - if poll_count is not None: - self.poll_count = poll_count - if task_def_name is not None: - self.task_def_name = task_def_name - if scheduled_time is not None: - self.scheduled_time = scheduled_time - if start_time is not None: - self.start_time = start_time - if end_time is not None: - self.end_time = end_time - if update_time is not None: - self.update_time = update_time - if start_delay_in_seconds is not None: - self.start_delay_in_seconds = start_delay_in_seconds - if retried_task_id is not None: - self.retried_task_id = retried_task_id - if retried is not None: - self.retried = retried - if executed is not None: - self.executed = executed - if callback_from_worker is not None: - self.callback_from_worker = callback_from_worker - if response_timeout_seconds is not None: - self.response_timeout_seconds = response_timeout_seconds - if workflow_instance_id is not None: - self.workflow_instance_id = workflow_instance_id - if workflow_type is not None: - self.workflow_type = workflow_type - if task_id is not None: - self.task_id = task_id - if reason_for_incompletion is not None: - self.reason_for_incompletion = reason_for_incompletion - if callback_after_seconds is not None: - self.callback_after_seconds = callback_after_seconds - if worker_id is not None: - self.worker_id = worker_id - if output_data is not None: - self.output_data = output_data - if workflow_task is not None: - self.workflow_task = workflow_task - if domain is not None: - self.domain = domain - if rate_limit_per_frequency is not None: - self.rate_limit_per_frequency = rate_limit_per_frequency - if rate_limit_frequency_in_seconds is not None: - self.rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds - if external_input_payload_storage_path is not None: - self.external_input_payload_storage_path = external_input_payload_storage_path - if external_output_payload_storage_path is not None: - self.external_output_payload_storage_path = external_output_payload_storage_path - if workflow_priority is not None: - self.workflow_priority = workflow_priority - if execution_name_space is not None: - self.execution_name_space = execution_name_space - if isolation_group_id is not None: - self.isolation_group_id = isolation_group_id - if iteration is not None: - self.iteration = iteration - if sub_workflow_id is not None: - self.sub_workflow_id = sub_workflow_id - if subworkflow_changed is not None: - self.subworkflow_changed = subworkflow_changed - if parent_task_id is not None: - self.parent_task_id = parent_task_id - if first_start_time is not None: - self.first_start_time = first_start_time - if loop_over_task is not None: - self.loop_over_task = loop_over_task - if task_definition is not None: - self.task_definition = task_definition - if queue_wait_time is not None: - self.queue_wait_time = queue_wait_time - - def __post_init__(self): - """Post initialization for dataclass""" - pass - - @property - def task_type(self): - """Gets the task_type of this Task. # noqa: E501 - - - :return: The task_type of this Task. # noqa: E501 - :rtype: str - """ - return self._task_type - - @task_type.setter - def task_type(self, task_type): - """Sets the task_type of this Task. - - - :param task_type: The task_type of this Task. # noqa: E501 - :type: str - """ - - self._task_type = task_type - - @property - def status(self): - """Gets the status of this Task. # noqa: E501 - - - :return: The status of this Task. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Task. - - - :param status: The status of this Task. # noqa: E501 - :type: str - """ - allowed_values = ["IN_PROGRESS", "CANCELED", "FAILED", "FAILED_WITH_TERMINAL_ERROR", "COMPLETED", - "COMPLETED_WITH_ERRORS", "SCHEDULED", "TIMED_OUT", "SKIPPED"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def input_data(self): - """Gets the input_data of this Task. # noqa: E501 - - - :return: The input_data of this Task. # noqa: E501 - :rtype: dict(str, object) - """ - return self._input_data - - @input_data.setter - def input_data(self, input_data): - """Sets the input_data of this Task. - - - :param input_data: The input_data of this Task. # noqa: E501 - :type: dict(str, object) - """ - - self._input_data = input_data - - @property - def reference_task_name(self): - """Gets the reference_task_name of this Task. # noqa: E501 - - - :return: The reference_task_name of this Task. # noqa: E501 - :rtype: str - """ - return self._reference_task_name - - @reference_task_name.setter - def reference_task_name(self, reference_task_name): - """Sets the reference_task_name of this Task. - - - :param reference_task_name: The reference_task_name of this Task. # noqa: E501 - :type: str - """ - - self._reference_task_name = reference_task_name - - @property - def retry_count(self): - """Gets the retry_count of this Task. # noqa: E501 - - - :return: The retry_count of this Task. # noqa: E501 - :rtype: int - """ - return self._retry_count - - @retry_count.setter - def retry_count(self, retry_count): - """Sets the retry_count of this Task. - - - :param retry_count: The retry_count of this Task. # noqa: E501 - :type: int - """ - - self._retry_count = retry_count - - @property - def seq(self): - """Gets the seq of this Task. # noqa: E501 - - - :return: The seq of this Task. # noqa: E501 - :rtype: int - """ - return self._seq - - @seq.setter - def seq(self, seq): - """Sets the seq of this Task. - - - :param seq: The seq of this Task. # noqa: E501 - :type: int - """ - - self._seq = seq - - @property - def correlation_id(self): - """Gets the correlation_id of this Task. # noqa: E501 - - - :return: The correlation_id of this Task. # noqa: E501 - :rtype: str - """ - return self._correlation_id - - @correlation_id.setter - def correlation_id(self, correlation_id): - """Sets the correlation_id of this Task. - - - :param correlation_id: The correlation_id of this Task. # noqa: E501 - :type: str - """ - - self._correlation_id = correlation_id - - @property - def poll_count(self): - """Gets the poll_count of this Task. # noqa: E501 - - - :return: The poll_count of this Task. # noqa: E501 - :rtype: int - """ - return self._poll_count - - @poll_count.setter - def poll_count(self, poll_count): - """Sets the poll_count of this Task. - - - :param poll_count: The poll_count of this Task. # noqa: E501 - :type: int - """ - - self._poll_count = poll_count - - @property - def task_def_name(self): - """Gets the task_def_name of this Task. # noqa: E501 - - - :return: The task_def_name of this Task. # noqa: E501 - :rtype: str - """ - return self._task_def_name - - @task_def_name.setter - def task_def_name(self, task_def_name): - """Sets the task_def_name of this Task. - - - :param task_def_name: The task_def_name of this Task. # noqa: E501 - :type: str - """ - - self._task_def_name = task_def_name - - @property - def scheduled_time(self): - """Gets the scheduled_time of this Task. # noqa: E501 - - - :return: The scheduled_time of this Task. # noqa: E501 - :rtype: int - """ - return self._scheduled_time - - @scheduled_time.setter - def scheduled_time(self, scheduled_time): - """Sets the scheduled_time of this Task. - - - :param scheduled_time: The scheduled_time of this Task. # noqa: E501 - :type: int - """ - - self._scheduled_time = scheduled_time - - @property - def start_time(self): - """Gets the start_time of this Task. # noqa: E501 - - - :return: The start_time of this Task. # noqa: E501 - :rtype: int - """ - return self._start_time - - @start_time.setter - def start_time(self, start_time): - """Sets the start_time of this Task. - - - :param start_time: The start_time of this Task. # noqa: E501 - :type: int - """ - - self._start_time = start_time - - @property - def end_time(self): - """Gets the end_time of this Task. # noqa: E501 - - - :return: The end_time of this Task. # noqa: E501 - :rtype: int - """ - return self._end_time - - @end_time.setter - def end_time(self, end_time): - """Sets the end_time of this Task. - - - :param end_time: The end_time of this Task. # noqa: E501 - :type: int - """ - - self._end_time = end_time - - @property - def update_time(self): - """Gets the update_time of this Task. # noqa: E501 - - - :return: The update_time of this Task. # noqa: E501 - :rtype: int - """ - return self._update_time - - @update_time.setter - def update_time(self, update_time): - """Sets the update_time of this Task. - - - :param update_time: The update_time of this Task. # noqa: E501 - :type: int - """ - - self._update_time = update_time - - @property - def start_delay_in_seconds(self): - """Gets the start_delay_in_seconds of this Task. # noqa: E501 - - - :return: The start_delay_in_seconds of this Task. # noqa: E501 - :rtype: int - """ - return self._start_delay_in_seconds - - @start_delay_in_seconds.setter - def start_delay_in_seconds(self, start_delay_in_seconds): - """Sets the start_delay_in_seconds of this Task. - - - :param start_delay_in_seconds: The start_delay_in_seconds of this Task. # noqa: E501 - :type: int - """ - - self._start_delay_in_seconds = start_delay_in_seconds - - @property - def retried_task_id(self): - """Gets the retried_task_id of this Task. # noqa: E501 - - - :return: The retried_task_id of this Task. # noqa: E501 - :rtype: str - """ - return self._retried_task_id - - @retried_task_id.setter - def retried_task_id(self, retried_task_id): - """Sets the retried_task_id of this Task. - - - :param retried_task_id: The retried_task_id of this Task. # noqa: E501 - :type: str - """ - - self._retried_task_id = retried_task_id - - @property - def retried(self): - """Gets the retried of this Task. # noqa: E501 - - - :return: The retried of this Task. # noqa: E501 - :rtype: bool - """ - return self._retried - - @retried.setter - def retried(self, retried): - """Sets the retried of this Task. - - - :param retried: The retried of this Task. # noqa: E501 - :type: bool - """ - - self._retried = retried - - @property - def executed(self): - """Gets the executed of this Task. # noqa: E501 - - - :return: The executed of this Task. # noqa: E501 - :rtype: bool - """ - return self._executed - - @executed.setter - def executed(self, executed): - """Sets the executed of this Task. - - - :param executed: The executed of this Task. # noqa: E501 - :type: bool - """ - - self._executed = executed - - @property - def callback_from_worker(self): - """Gets the callback_from_worker of this Task. # noqa: E501 - - - :return: The callback_from_worker of this Task. # noqa: E501 - :rtype: bool - """ - return self._callback_from_worker - - @callback_from_worker.setter - def callback_from_worker(self, callback_from_worker): - """Sets the callback_from_worker of this Task. - - - :param callback_from_worker: The callback_from_worker of this Task. # noqa: E501 - :type: bool - """ - - self._callback_from_worker = callback_from_worker - - @property - def response_timeout_seconds(self): - """Gets the response_timeout_seconds of this Task. # noqa: E501 - - - :return: The response_timeout_seconds of this Task. # noqa: E501 - :rtype: int - """ - return self._response_timeout_seconds - - @response_timeout_seconds.setter - def response_timeout_seconds(self, response_timeout_seconds): - """Sets the response_timeout_seconds of this Task. - - - :param response_timeout_seconds: The response_timeout_seconds of this Task. # noqa: E501 - :type: int - """ - - self._response_timeout_seconds = response_timeout_seconds - - @property - def workflow_instance_id(self): - """Gets the workflow_instance_id of this Task. # noqa: E501 - - - :return: The workflow_instance_id of this Task. # noqa: E501 - :rtype: str - """ - return self._workflow_instance_id - - @workflow_instance_id.setter - def workflow_instance_id(self, workflow_instance_id): - """Sets the workflow_instance_id of this Task. - - - :param workflow_instance_id: The workflow_instance_id of this Task. # noqa: E501 - :type: str - """ - - self._workflow_instance_id = workflow_instance_id - - @property - def workflow_type(self): - """Gets the workflow_type of this Task. # noqa: E501 - - - :return: The workflow_type of this Task. # noqa: E501 - :rtype: str - """ - return self._workflow_type - - @workflow_type.setter - def workflow_type(self, workflow_type): - """Sets the workflow_type of this Task. - - - :param workflow_type: The workflow_type of this Task. # noqa: E501 - :type: str - """ - - self._workflow_type = workflow_type - - @property - def task_id(self): - """Gets the task_id of this Task. # noqa: E501 - - - :return: The task_id of this Task. # noqa: E501 - :rtype: str - """ - return self._task_id - - @task_id.setter - def task_id(self, task_id): - """Sets the task_id of this Task. - - - :param task_id: The task_id of this Task. # noqa: E501 - :type: str - """ - - self._task_id = task_id - - @property - def reason_for_incompletion(self): - """Gets the reason_for_incompletion of this Task. # noqa: E501 - - - :return: The reason_for_incompletion of this Task. # noqa: E501 - :rtype: str - """ - return self._reason_for_incompletion - - @reason_for_incompletion.setter - def reason_for_incompletion(self, reason_for_incompletion): - """Sets the reason_for_incompletion of this Task. - - - :param reason_for_incompletion: The reason_for_incompletion of this Task. # noqa: E501 - :type: str - """ - - self._reason_for_incompletion = reason_for_incompletion - - @property - def callback_after_seconds(self): - """Gets the callback_after_seconds of this Task. # noqa: E501 - - - :return: The callback_after_seconds of this Task. # noqa: E501 - :rtype: int - """ - return self._callback_after_seconds - - @callback_after_seconds.setter - def callback_after_seconds(self, callback_after_seconds): - """Sets the callback_after_seconds of this Task. - - - :param callback_after_seconds: The callback_after_seconds of this Task. # noqa: E501 - :type: int - """ - - self._callback_after_seconds = callback_after_seconds - - @property - def worker_id(self): - """Gets the worker_id of this Task. # noqa: E501 - - - :return: The worker_id of this Task. # noqa: E501 - :rtype: str - """ - return self._worker_id - - @worker_id.setter - def worker_id(self, worker_id): - """Sets the worker_id of this Task. - - - :param worker_id: The worker_id of this Task. # noqa: E501 - :type: str - """ - - self._worker_id = worker_id - - @property - def output_data(self): - """Gets the output_data of this Task. # noqa: E501 - - - :return: The output_data of this Task. # noqa: E501 - :rtype: dict(str, object) - """ - return self._output_data - - @output_data.setter - def output_data(self, output_data): - """Sets the output_data of this Task. - - - :param output_data: The output_data of this Task. # noqa: E501 - :type: dict(str, object) - """ - - self._output_data = output_data - - @property - def workflow_task(self) -> WorkflowTask: - """Gets the workflow_task of this Task. # noqa: E501 - - - :return: The workflow_task of this Task. # noqa: E501 - :rtype: WorkflowTask - """ - return self._workflow_task - - @workflow_task.setter - def workflow_task(self, workflow_task): - """Sets the workflow_task of this Task. - - - :param workflow_task: The workflow_task of this Task. # noqa: E501 - :type: WorkflowTask - """ - - self._workflow_task = workflow_task - - @property - def domain(self): - """Gets the domain of this Task. # noqa: E501 - - - :return: The domain of this Task. # noqa: E501 - :rtype: str - """ - return self._domain - - @domain.setter - def domain(self, domain): - """Sets the domain of this Task. - - - :param domain: The domain of this Task. # noqa: E501 - :type: str - """ - - self._domain = domain - - @property - def rate_limit_per_frequency(self): - """Gets the rate_limit_per_frequency of this Task. # noqa: E501 - - - :return: The rate_limit_per_frequency of this Task. # noqa: E501 - :rtype: int - """ - return self._rate_limit_per_frequency - - @rate_limit_per_frequency.setter - def rate_limit_per_frequency(self, rate_limit_per_frequency): - """Sets the rate_limit_per_frequency of this Task. - - - :param rate_limit_per_frequency: The rate_limit_per_frequency of this Task. # noqa: E501 - :type: int - """ - - self._rate_limit_per_frequency = rate_limit_per_frequency - - @property - def rate_limit_frequency_in_seconds(self): - """Gets the rate_limit_frequency_in_seconds of this Task. # noqa: E501 - - - :return: The rate_limit_frequency_in_seconds of this Task. # noqa: E501 - :rtype: int - """ - return self._rate_limit_frequency_in_seconds - - @rate_limit_frequency_in_seconds.setter - def rate_limit_frequency_in_seconds(self, rate_limit_frequency_in_seconds): - """Sets the rate_limit_frequency_in_seconds of this Task. - - - :param rate_limit_frequency_in_seconds: The rate_limit_frequency_in_seconds of this Task. # noqa: E501 - :type: int - """ - - self._rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds - - @property - def external_input_payload_storage_path(self): - """Gets the external_input_payload_storage_path of this Task. # noqa: E501 - - - :return: The external_input_payload_storage_path of this Task. # noqa: E501 - :rtype: str - """ - return self._external_input_payload_storage_path - - @external_input_payload_storage_path.setter - def external_input_payload_storage_path(self, external_input_payload_storage_path): - """Sets the external_input_payload_storage_path of this Task. - - - :param external_input_payload_storage_path: The external_input_payload_storage_path of this Task. # noqa: E501 - :type: str - """ - - self._external_input_payload_storage_path = external_input_payload_storage_path - - @property - def external_output_payload_storage_path(self): - """Gets the external_output_payload_storage_path of this Task. # noqa: E501 - - - :return: The external_output_payload_storage_path of this Task. # noqa: E501 - :rtype: str - """ - return self._external_output_payload_storage_path - - @external_output_payload_storage_path.setter - def external_output_payload_storage_path(self, external_output_payload_storage_path): - """Sets the external_output_payload_storage_path of this Task. - - - :param external_output_payload_storage_path: The external_output_payload_storage_path of this Task. # noqa: E501 - :type: str - """ - - self._external_output_payload_storage_path = external_output_payload_storage_path - - @property - def workflow_priority(self): - """Gets the workflow_priority of this Task. # noqa: E501 - - - :return: The workflow_priority of this Task. # noqa: E501 - :rtype: int - """ - return self._workflow_priority - - @workflow_priority.setter - def workflow_priority(self, workflow_priority): - """Sets the workflow_priority of this Task. - - - :param workflow_priority: The workflow_priority of this Task. # noqa: E501 - :type: int - """ - - self._workflow_priority = workflow_priority - - @property - def execution_name_space(self): - """Gets the execution_name_space of this Task. # noqa: E501 - - - :return: The execution_name_space of this Task. # noqa: E501 - :rtype: str - """ - return self._execution_name_space - - @execution_name_space.setter - def execution_name_space(self, execution_name_space): - """Sets the execution_name_space of this Task. - - - :param execution_name_space: The execution_name_space of this Task. # noqa: E501 - :type: str - """ - - self._execution_name_space = execution_name_space - - @property - def isolation_group_id(self): - """Gets the isolation_group_id of this Task. # noqa: E501 - - - :return: The isolation_group_id of this Task. # noqa: E501 - :rtype: str - """ - return self._isolation_group_id - - @isolation_group_id.setter - def isolation_group_id(self, isolation_group_id): - """Sets the isolation_group_id of this Task. - - - :param isolation_group_id: The isolation_group_id of this Task. # noqa: E501 - :type: str - """ - - self._isolation_group_id = isolation_group_id - - @property - def iteration(self): - """Gets the iteration of this Task. # noqa: E501 - - - :return: The iteration of this Task. # noqa: E501 - :rtype: int - """ - return self._iteration - - @iteration.setter - def iteration(self, iteration): - """Sets the iteration of this Task. - - - :param iteration: The iteration of this Task. # noqa: E501 - :type: int - """ - - self._iteration = iteration - - @property - def sub_workflow_id(self): - """Gets the sub_workflow_id of this Task. # noqa: E501 - - - :return: The sub_workflow_id of this Task. # noqa: E501 - :rtype: str - """ - return self._sub_workflow_id - - @sub_workflow_id.setter - def sub_workflow_id(self, sub_workflow_id): - """Sets the sub_workflow_id of this Task. - - - :param sub_workflow_id: The sub_workflow_id of this Task. # noqa: E501 - :type: str - """ - - self._sub_workflow_id = sub_workflow_id - - @property - def subworkflow_changed(self): - """Gets the subworkflow_changed of this Task. # noqa: E501 - - - :return: The subworkflow_changed of this Task. # noqa: E501 - :rtype: bool - """ - return self._subworkflow_changed - - @subworkflow_changed.setter - def subworkflow_changed(self, subworkflow_changed): - """Sets the subworkflow_changed of this Task. - - - :param subworkflow_changed: The subworkflow_changed of this Task. # noqa: E501 - :type: bool - """ - - self._subworkflow_changed = subworkflow_changed - - @property - def parent_task_id(self): - return self._parent_task_id - - @parent_task_id.setter - def parent_task_id(self, parent_task_id): - self._parent_task_id = parent_task_id - - @property - def first_start_time(self): - return self._first_start_time - - @first_start_time.setter - def first_start_time(self, first_start_time): - self._first_start_time = first_start_time - - @property - def loop_over_task(self): - """Gets the loop_over_task of this Task. # noqa: E501 - - - :return: The loop_over_task of this Task. # noqa: E501 - :rtype: bool - """ - return self._loop_over_task - - @loop_over_task.setter - def loop_over_task(self, loop_over_task): - """Sets the loop_over_task of this Task. - - - :param loop_over_task: The loop_over_task of this Task. # noqa: E501 - :type: bool - """ - - self._loop_over_task = loop_over_task - - @property - def task_definition(self): - """Gets the task_definition of this Task. # noqa: E501 - - - :return: The task_definition of this Task. # noqa: E501 - :rtype: TaskDef - """ - return self._task_definition - - @task_definition.setter - def task_definition(self, task_definition): - """Sets the task_definition of this Task. - - - :param task_definition: The task_definition of this Task. # noqa: E501 - :type: TaskDef - """ - - self._task_definition = task_definition - - @property - def queue_wait_time(self): - """Gets the queue_wait_time of this Task. # noqa: E501 - - - :return: The queue_wait_time of this Task. # noqa: E501 - :rtype: int - """ - return self._queue_wait_time - - @queue_wait_time.setter - def queue_wait_time(self, queue_wait_time): - """Sets the queue_wait_time of this Task. - - - :param queue_wait_time: The queue_wait_time of this Task. # noqa: E501 - :type: int - """ - - self._queue_wait_time = queue_wait_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Task, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Task): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def to_task_result(self, status: TaskResultStatus = TaskResultStatus.COMPLETED) -> TaskResult: - task_result = TaskResult( - task_id=self.task_id, - workflow_instance_id=self.workflow_instance_id, - worker_id=self.worker_id, - status=status, - ) - return task_result \ No newline at end of file +__all__ = ["Task"] diff --git a/src/conductor/client/http/models/task_def.py b/src/conductor/client/http/models/task_def.py index 7d486862..9c32ff30 100644 --- a/src/conductor/client/http/models/task_def.py +++ b/src/conductor/client/http/models/task_def.py @@ -1,953 +1,5 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, List, Optional, Any, Union -from deprecated import deprecated +from conductor.client.adapters.models.task_def_adapter import TaskDefAdapter -from conductor.client.http.models.schema_def import SchemaDef +TaskDef = TaskDefAdapter - -@dataclass -class TaskDef: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'owner_app': 'str', - 'create_time': 'int', - 'update_time': 'int', - 'created_by': 'str', - 'updated_by': 'str', - 'name': 'str', - 'description': 'str', - 'retry_count': 'int', - 'timeout_seconds': 'int', - 'input_keys': 'list[str]', - 'output_keys': 'list[str]', - 'timeout_policy': 'str', - 'retry_logic': 'str', - 'retry_delay_seconds': 'int', - 'response_timeout_seconds': 'int', - 'concurrent_exec_limit': 'int', - 'input_template': 'dict(str, object)', - 'rate_limit_per_frequency': 'int', - 'rate_limit_frequency_in_seconds': 'int', - 'isolation_group_id': 'str', - 'execution_name_space': 'str', - 'owner_email': 'str', - 'poll_timeout_seconds': 'int', - 'backoff_scale_factor': 'int', - 'input_schema': 'SchemaDef', - 'output_schema': 'SchemaDef', - 'enforce_schema': 'bool', - 'base_type': 'str', - 'total_timeout_seconds': 'int' - } - - attribute_map = { - 'owner_app': 'ownerApp', - 'create_time': 'createTime', - 'update_time': 'updateTime', - 'created_by': 'createdBy', - 'updated_by': 'updatedBy', - 'name': 'name', - 'description': 'description', - 'retry_count': 'retryCount', - 'timeout_seconds': 'timeoutSeconds', - 'input_keys': 'inputKeys', - 'output_keys': 'outputKeys', - 'timeout_policy': 'timeoutPolicy', - 'retry_logic': 'retryLogic', - 'retry_delay_seconds': 'retryDelaySeconds', - 'response_timeout_seconds': 'responseTimeoutSeconds', - 'concurrent_exec_limit': 'concurrentExecLimit', - 'input_template': 'inputTemplate', - 'rate_limit_per_frequency': 'rateLimitPerFrequency', - 'rate_limit_frequency_in_seconds': 'rateLimitFrequencyInSeconds', - 'isolation_group_id': 'isolationGroupId', - 'execution_name_space': 'executionNameSpace', - 'owner_email': 'ownerEmail', - 'poll_timeout_seconds': 'pollTimeoutSeconds', - 'backoff_scale_factor': 'backoffScaleFactor', - 'input_schema': 'inputSchema', - 'output_schema': 'outputSchema', - 'enforce_schema': 'enforceSchema', - 'base_type': 'baseType', - 'total_timeout_seconds': 'totalTimeoutSeconds' - } - - # Fields for @dataclass - _owner_app: Optional[str] = field(default=None, init=False) - _create_time: Optional[int] = field(default=None, init=False) - _update_time: Optional[int] = field(default=None, init=False) - _created_by: Optional[str] = field(default=None, init=False) - _updated_by: Optional[str] = field(default=None, init=False) - _name: Optional[str] = field(default=None, init=False) - _description: Optional[str] = field(default=None, init=False) - _retry_count: Optional[int] = field(default=None, init=False) - _timeout_seconds: Optional[int] = field(default=None, init=False) - _input_keys: Optional[List[str]] = field(default=None, init=False) - _output_keys: Optional[List[str]] = field(default=None, init=False) - _timeout_policy: Optional[str] = field(default=None, init=False) - _retry_logic: Optional[str] = field(default=None, init=False) - _retry_delay_seconds: Optional[int] = field(default=None, init=False) - _response_timeout_seconds: Optional[int] = field(default=None, init=False) - _concurrent_exec_limit: Optional[int] = field(default=None, init=False) - _input_template: Optional[Dict[str, Any]] = field(default=None, init=False) - _rate_limit_per_frequency: Optional[int] = field(default=None, init=False) - _rate_limit_frequency_in_seconds: Optional[int] = field(default=None, init=False) - _isolation_group_id: Optional[str] = field(default=None, init=False) - _execution_name_space: Optional[str] = field(default=None, init=False) - _owner_email: Optional[str] = field(default=None, init=False) - _poll_timeout_seconds: Optional[int] = field(default=None, init=False) - _backoff_scale_factor: Optional[int] = field(default=None, init=False) - _input_schema: Optional[SchemaDef] = field(default=None, init=False) - _output_schema: Optional[SchemaDef] = field(default=None, init=False) - _enforce_schema: bool = field(default=False, init=False) - _base_type: Optional[str] = field(default=None, init=False) - _total_timeout_seconds: Optional[int] = field(default=None, init=False) - - # InitVars for constructor parameters - owner_app: InitVar[Optional[str]] = None - create_time: InitVar[Optional[int]] = None - update_time: InitVar[Optional[int]] = None - created_by: InitVar[Optional[str]] = None - updated_by: InitVar[Optional[str]] = None - name: InitVar[Optional[str]] = None - description: InitVar[Optional[str]] = None - retry_count: InitVar[Optional[int]] = None - timeout_seconds: InitVar[Optional[int]] = None - input_keys: InitVar[Optional[List[str]]] = None - output_keys: InitVar[Optional[List[str]]] = None - timeout_policy: InitVar[Optional[str]] = None - retry_logic: InitVar[Optional[str]] = None - retry_delay_seconds: InitVar[Optional[int]] = None - response_timeout_seconds: InitVar[Optional[int]] = None - concurrent_exec_limit: InitVar[Optional[int]] = None - input_template: InitVar[Optional[Dict[str, Any]]] = None - rate_limit_per_frequency: InitVar[Optional[int]] = None - rate_limit_frequency_in_seconds: InitVar[Optional[int]] = None - isolation_group_id: InitVar[Optional[str]] = None - execution_name_space: InitVar[Optional[str]] = None - owner_email: InitVar[Optional[str]] = None - poll_timeout_seconds: InitVar[Optional[int]] = None - backoff_scale_factor: InitVar[Optional[int]] = None - input_schema: InitVar[Optional[SchemaDef]] = None - output_schema: InitVar[Optional[SchemaDef]] = None - enforce_schema: InitVar[bool] = False - base_type: InitVar[Optional[str]] = None - total_timeout_seconds: InitVar[Optional[int]] = None - - discriminator: Optional[str] = field(default=None, init=False) - - def __init__(self, owner_app=None, create_time=None, update_time=None, created_by=None, updated_by=None, name=None, - description=None, retry_count=None, timeout_seconds=None, input_keys=None, output_keys=None, - timeout_policy=None, retry_logic=None, retry_delay_seconds=None, response_timeout_seconds=None, - concurrent_exec_limit=None, input_template=None, rate_limit_per_frequency=None, - rate_limit_frequency_in_seconds=None, isolation_group_id=None, execution_name_space=None, - owner_email=None, poll_timeout_seconds=None, backoff_scale_factor=None, - input_schema : SchemaDef = None, output_schema : SchemaDef = None, enforce_schema : bool = False, - base_type=None, total_timeout_seconds=None): # noqa: E501 - """TaskDef - a model defined in Swagger""" # noqa: E501 - self._owner_app = None - self._create_time = None - self._update_time = None - self._created_by = None - self._updated_by = None - self._name = None - self._description = None - self._retry_count = None - self._timeout_seconds = None - self._input_keys = None - self._output_keys = None - self._timeout_policy = None - self._retry_logic = None - self._retry_delay_seconds = None - self._response_timeout_seconds = None - self._concurrent_exec_limit = None - self._input_template = None - self._rate_limit_per_frequency = None - self._rate_limit_frequency_in_seconds = None - self._isolation_group_id = None - self._execution_name_space = None - self._owner_email = None - self._poll_timeout_seconds = None - self._backoff_scale_factor = None - self._base_type = None - self._total_timeout_seconds = None - self.discriminator = None - if owner_app is not None: - self.owner_app = owner_app - if create_time is not None: - self.create_time = create_time - if update_time is not None: - self.update_time = update_time - if created_by is not None: - self.created_by = created_by - if updated_by is not None: - self.updated_by = updated_by - self.name = name - if description is not None: - self.description = description - if retry_count is not None: - self.retry_count = retry_count - self.timeout_seconds = timeout_seconds - if input_keys is not None: - self.input_keys = input_keys - if output_keys is not None: - self.output_keys = output_keys - if timeout_policy is not None: - self.timeout_policy = timeout_policy - if retry_logic is not None: - self.retry_logic = retry_logic - if retry_delay_seconds is not None: - self.retry_delay_seconds = retry_delay_seconds - if response_timeout_seconds is not None: - self.response_timeout_seconds = response_timeout_seconds - if concurrent_exec_limit is not None: - self.concurrent_exec_limit = concurrent_exec_limit - if input_template is not None: - self.input_template = input_template - if rate_limit_per_frequency is not None: - self.rate_limit_per_frequency = rate_limit_per_frequency - if rate_limit_frequency_in_seconds is not None: - self.rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds - if isolation_group_id is not None: - self.isolation_group_id = isolation_group_id - if execution_name_space is not None: - self.execution_name_space = execution_name_space - if owner_email is not None: - self.owner_email = owner_email - if poll_timeout_seconds is not None: - self.poll_timeout_seconds = poll_timeout_seconds - if backoff_scale_factor is not None: - self.backoff_scale_factor = backoff_scale_factor - self._input_schema = input_schema - self._output_schema = output_schema - self._enforce_schema = enforce_schema - if base_type is not None: - self.base_type = base_type - if total_timeout_seconds is not None: - self.total_timeout_seconds = total_timeout_seconds - - def __post_init__(self, owner_app, create_time, update_time, created_by, updated_by, name, description, - retry_count, timeout_seconds, input_keys, output_keys, timeout_policy, retry_logic, - retry_delay_seconds, response_timeout_seconds, concurrent_exec_limit, input_template, - rate_limit_per_frequency, rate_limit_frequency_in_seconds, isolation_group_id, - execution_name_space, owner_email, poll_timeout_seconds, backoff_scale_factor, - input_schema, output_schema, enforce_schema, base_type, total_timeout_seconds): - if owner_app is not None: - self.owner_app = owner_app - if create_time is not None: - self.create_time = create_time - if update_time is not None: - self.update_time = update_time - if created_by is not None: - self.created_by = created_by - if updated_by is not None: - self.updated_by = updated_by - if name is not None: - self.name = name - if description is not None: - self.description = description - if retry_count is not None: - self.retry_count = retry_count - if timeout_seconds is not None: - self.timeout_seconds = timeout_seconds - if input_keys is not None: - self.input_keys = input_keys - if output_keys is not None: - self.output_keys = output_keys - if timeout_policy is not None: - self.timeout_policy = timeout_policy - if retry_logic is not None: - self.retry_logic = retry_logic - if retry_delay_seconds is not None: - self.retry_delay_seconds = retry_delay_seconds - if response_timeout_seconds is not None: - self.response_timeout_seconds = response_timeout_seconds - if concurrent_exec_limit is not None: - self.concurrent_exec_limit = concurrent_exec_limit - if input_template is not None: - self.input_template = input_template - if rate_limit_per_frequency is not None: - self.rate_limit_per_frequency = rate_limit_per_frequency - if rate_limit_frequency_in_seconds is not None: - self.rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds - if isolation_group_id is not None: - self.isolation_group_id = isolation_group_id - if execution_name_space is not None: - self.execution_name_space = execution_name_space - if owner_email is not None: - self.owner_email = owner_email - if poll_timeout_seconds is not None: - self.poll_timeout_seconds = poll_timeout_seconds - if backoff_scale_factor is not None: - self.backoff_scale_factor = backoff_scale_factor - if input_schema is not None: - self.input_schema = input_schema - if output_schema is not None: - self.output_schema = output_schema - if enforce_schema is not None: - self.enforce_schema = enforce_schema - if base_type is not None: - self.base_type = base_type - if total_timeout_seconds is not None: - self.total_timeout_seconds = total_timeout_seconds - - @property - @deprecated - def owner_app(self): - """Gets the owner_app of this TaskDef. # noqa: E501 - - - :return: The owner_app of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._owner_app - - @owner_app.setter - @deprecated - def owner_app(self, owner_app): - """Sets the owner_app of this TaskDef. - - - :param owner_app: The owner_app of this TaskDef. # noqa: E501 - :type: str - """ - - self._owner_app = owner_app - - @property - def create_time(self): - """Gets the create_time of this TaskDef. # noqa: E501 - - - :return: The create_time of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._create_time - - @create_time.setter - def create_time(self, create_time): - """Sets the create_time of this TaskDef. - - - :param create_time: The create_time of this TaskDef. # noqa: E501 - :type: int - """ - - self._create_time = create_time - - @property - def update_time(self): - """Gets the update_time of this TaskDef. # noqa: E501 - - - :return: The update_time of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._update_time - - @update_time.setter - def update_time(self, update_time): - """Sets the update_time of this TaskDef. - - - :param update_time: The update_time of this TaskDef. # noqa: E501 - :type: int - """ - - self._update_time = update_time - - @property - def created_by(self): - """Gets the created_by of this TaskDef. # noqa: E501 - - - :return: The created_by of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this TaskDef. - - - :param created_by: The created_by of this TaskDef. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - def updated_by(self): - """Gets the updated_by of this TaskDef. # noqa: E501 - - - :return: The updated_by of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._updated_by - - @updated_by.setter - def updated_by(self, updated_by): - """Sets the updated_by of this TaskDef. - - - :param updated_by: The updated_by of this TaskDef. # noqa: E501 - :type: str - """ - - self._updated_by = updated_by - - @property - def name(self): - """Gets the name of this TaskDef. # noqa: E501 - - - :return: The name of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this TaskDef. - - - :param name: The name of this TaskDef. # noqa: E501 - :type: str - """ - self._name = name - - @property - def description(self): - """Gets the description of this TaskDef. # noqa: E501 - - - :return: The description of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this TaskDef. - - - :param description: The description of this TaskDef. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def retry_count(self): - """Gets the retry_count of this TaskDef. # noqa: E501 - - - :return: The retry_count of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._retry_count - - @retry_count.setter - def retry_count(self, retry_count): - """Sets the retry_count of this TaskDef. - - - :param retry_count: The retry_count of this TaskDef. # noqa: E501 - :type: int - """ - - self._retry_count = retry_count - - @property - def timeout_seconds(self): - """Gets the timeout_seconds of this TaskDef. # noqa: E501 - - - :return: The timeout_seconds of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._timeout_seconds - - @timeout_seconds.setter - def timeout_seconds(self, timeout_seconds): - """Sets the timeout_seconds of this TaskDef. - - - :param timeout_seconds: The timeout_seconds of this TaskDef. # noqa: E501 - :type: int - """ - self._timeout_seconds = timeout_seconds - - @property - def input_keys(self): - """Gets the input_keys of this TaskDef. # noqa: E501 - - - :return: The input_keys of this TaskDef. # noqa: E501 - :rtype: list[str] - """ - return self._input_keys - - @input_keys.setter - def input_keys(self, input_keys): - """Sets the input_keys of this TaskDef. - - - :param input_keys: The input_keys of this TaskDef. # noqa: E501 - :type: list[str] - """ - - self._input_keys = input_keys - - @property - def output_keys(self): - """Gets the output_keys of this TaskDef. # noqa: E501 - - - :return: The output_keys of this TaskDef. # noqa: E501 - :rtype: list[str] - """ - return self._output_keys - - @output_keys.setter - def output_keys(self, output_keys): - """Sets the output_keys of this TaskDef. - - - :param output_keys: The output_keys of this TaskDef. # noqa: E501 - :type: list[str] - """ - - self._output_keys = output_keys - - @property - def timeout_policy(self): - """Gets the timeout_policy of this TaskDef. # noqa: E501 - - - :return: The timeout_policy of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._timeout_policy - - @timeout_policy.setter - def timeout_policy(self, timeout_policy): - """Sets the timeout_policy of this TaskDef. - - - :param timeout_policy: The timeout_policy of this TaskDef. # noqa: E501 - :type: str - """ - allowed_values = ["RETRY", "TIME_OUT_WF", "ALERT_ONLY"] # noqa: E501 - if timeout_policy not in allowed_values: - raise ValueError( - "Invalid value for `timeout_policy` ({0}), must be one of {1}" # noqa: E501 - .format(timeout_policy, allowed_values) - ) - - self._timeout_policy = timeout_policy - - @property - def retry_logic(self): - """Gets the retry_logic of this TaskDef. # noqa: E501 - - - :return: The retry_logic of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._retry_logic - - @retry_logic.setter - def retry_logic(self, retry_logic): - """Sets the retry_logic of this TaskDef. - - - :param retry_logic: The retry_logic of this TaskDef. # noqa: E501 - :type: str - """ - allowed_values = ["FIXED", "EXPONENTIAL_BACKOFF", "LINEAR_BACKOFF"] # noqa: E501 - if retry_logic not in allowed_values: - raise ValueError( - "Invalid value for `retry_logic` ({0}), must be one of {1}" # noqa: E501 - .format(retry_logic, allowed_values) - ) - - self._retry_logic = retry_logic - - @property - def retry_delay_seconds(self): - """Gets the retry_delay_seconds of this TaskDef. # noqa: E501 - - - :return: The retry_delay_seconds of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._retry_delay_seconds - - @retry_delay_seconds.setter - def retry_delay_seconds(self, retry_delay_seconds): - """Sets the retry_delay_seconds of this TaskDef. - - - :param retry_delay_seconds: The retry_delay_seconds of this TaskDef. # noqa: E501 - :type: int - """ - - self._retry_delay_seconds = retry_delay_seconds - - @property - def response_timeout_seconds(self): - """Gets the response_timeout_seconds of this TaskDef. # noqa: E501 - - - :return: The response_timeout_seconds of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._response_timeout_seconds - - @response_timeout_seconds.setter - def response_timeout_seconds(self, response_timeout_seconds): - """Sets the response_timeout_seconds of this TaskDef. - - - :param response_timeout_seconds: The response_timeout_seconds of this TaskDef. # noqa: E501 - :type: int - """ - - self._response_timeout_seconds = response_timeout_seconds - - @property - def concurrent_exec_limit(self): - """Gets the concurrent_exec_limit of this TaskDef. # noqa: E501 - - - :return: The concurrent_exec_limit of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._concurrent_exec_limit - - @concurrent_exec_limit.setter - def concurrent_exec_limit(self, concurrent_exec_limit): - """Sets the concurrent_exec_limit of this TaskDef. - - - :param concurrent_exec_limit: The concurrent_exec_limit of this TaskDef. # noqa: E501 - :type: int - """ - - self._concurrent_exec_limit = concurrent_exec_limit - - @property - def input_template(self): - """Gets the input_template of this TaskDef. # noqa: E501 - - - :return: The input_template of this TaskDef. # noqa: E501 - :rtype: dict(str, object) - """ - return self._input_template - - @input_template.setter - def input_template(self, input_template): - """Sets the input_template of this TaskDef. - - - :param input_template: The input_template of this TaskDef. # noqa: E501 - :type: dict(str, object) - """ - - self._input_template = input_template - - @property - def rate_limit_per_frequency(self): - """Gets the rate_limit_per_frequency of this TaskDef. # noqa: E501 - - - :return: The rate_limit_per_frequency of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._rate_limit_per_frequency - - @rate_limit_per_frequency.setter - def rate_limit_per_frequency(self, rate_limit_per_frequency): - """Sets the rate_limit_per_frequency of this TaskDef. - - - :param rate_limit_per_frequency: The rate_limit_per_frequency of this TaskDef. # noqa: E501 - :type: int - """ - - self._rate_limit_per_frequency = rate_limit_per_frequency - - @property - def rate_limit_frequency_in_seconds(self): - """Gets the rate_limit_frequency_in_seconds of this TaskDef. # noqa: E501 - - - :return: The rate_limit_frequency_in_seconds of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._rate_limit_frequency_in_seconds - - @rate_limit_frequency_in_seconds.setter - def rate_limit_frequency_in_seconds(self, rate_limit_frequency_in_seconds): - """Sets the rate_limit_frequency_in_seconds of this TaskDef. - - - :param rate_limit_frequency_in_seconds: The rate_limit_frequency_in_seconds of this TaskDef. # noqa: E501 - :type: int - """ - - self._rate_limit_frequency_in_seconds = rate_limit_frequency_in_seconds - - @property - def isolation_group_id(self): - """Gets the isolation_group_id of this TaskDef. # noqa: E501 - - - :return: The isolation_group_id of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._isolation_group_id - - @isolation_group_id.setter - def isolation_group_id(self, isolation_group_id): - """Sets the isolation_group_id of this TaskDef. - - - :param isolation_group_id: The isolation_group_id of this TaskDef. # noqa: E501 - :type: str - """ - - self._isolation_group_id = isolation_group_id - - @property - def execution_name_space(self): - """Gets the execution_name_space of this TaskDef. # noqa: E501 - - - :return: The execution_name_space of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._execution_name_space - - @execution_name_space.setter - def execution_name_space(self, execution_name_space): - """Sets the execution_name_space of this TaskDef. - - - :param execution_name_space: The execution_name_space of this TaskDef. # noqa: E501 - :type: str - """ - - self._execution_name_space = execution_name_space - - @property - def owner_email(self): - """Gets the owner_email of this TaskDef. # noqa: E501 - - - :return: The owner_email of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._owner_email - - @owner_email.setter - def owner_email(self, owner_email): - """Sets the owner_email of this TaskDef. - - - :param owner_email: The owner_email of this TaskDef. # noqa: E501 - :type: str - """ - - self._owner_email = owner_email - - @property - def poll_timeout_seconds(self): - """Gets the poll_timeout_seconds of this TaskDef. # noqa: E501 - - - :return: The poll_timeout_seconds of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._poll_timeout_seconds - - @poll_timeout_seconds.setter - def poll_timeout_seconds(self, poll_timeout_seconds): - """Sets the poll_timeout_seconds of this TaskDef. - - - :param poll_timeout_seconds: The poll_timeout_seconds of this TaskDef. # noqa: E501 - :type: int - """ - - self._poll_timeout_seconds = poll_timeout_seconds - - @property - def backoff_scale_factor(self): - """Gets the backoff_scale_factor of this TaskDef. # noqa: E501 - - - :return: The backoff_scale_factor of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._backoff_scale_factor - - @backoff_scale_factor.setter - def backoff_scale_factor(self, backoff_scale_factor): - """Sets the backoff_scale_factor of this TaskDef. - - - :param backoff_scale_factor: The backoff_scale_factor of this TaskDef. # noqa: E501 - :type: int - """ - - self._backoff_scale_factor = backoff_scale_factor - - @property - def input_schema(self) -> SchemaDef: - """Schema for the workflow input. - If enforce_schema is set then the input given to start this workflow MUST conform to this schema - If the validation fails, the start request will fail - """ - return self._input_schema - - @input_schema.setter - def input_schema(self, input_schema: SchemaDef): - """Schema for the workflow input. - If enforce_schema is set then the input given to start this workflow MUST conform to this schema - If the validation fails, the start request will fail - """ - self._input_schema = input_schema - - @property - def output_schema(self) -> SchemaDef: - """Schema for the workflow output. - Note: The output is documentation purpose and not enforced given the workflow output can be non-deterministic - based on the branch execution logic (switch tasks etc) - """ - return self._output_schema - - @output_schema.setter - def output_schema(self, output_schema: SchemaDef): - """Schema for the workflow output. - Note: The output is documentation purpose and not enforced given the workflow output can be non-deterministic - based on the branch execution logic (switch tasks etc) - """ - self._output_schema = output_schema - - @property - def enforce_schema(self) -> bool: - """If enforce_schema is set then the input given to start this workflow MUST conform to this schema - If the validation fails, the start request will fail - """ - return self._enforce_schema - - @enforce_schema.setter - def enforce_schema(self, enforce_schema: bool): - """If enforce_schema is set then the input given to start this workflow MUST conform to this schema - If the validation fails, the start request will fail - """ - self._enforce_schema = enforce_schema - - @property - def base_type(self) -> str: - """Gets the base_type of this TaskDef. # noqa: E501 - - - :return: The base_type of this TaskDef. # noqa: E501 - :rtype: str - """ - return self._base_type - - @base_type.setter - def base_type(self, base_type: str): - """Sets the base_type of this TaskDef. - - - :param base_type: The base_type of this TaskDef. # noqa: E501 - :type: str - """ - self._base_type = base_type - - @property - def total_timeout_seconds(self) -> int: - """Gets the total_timeout_seconds of this TaskDef. # noqa: E501 - - - :return: The total_timeout_seconds of this TaskDef. # noqa: E501 - :rtype: int - """ - return self._total_timeout_seconds - - @total_timeout_seconds.setter - def total_timeout_seconds(self, total_timeout_seconds: int): - """Sets the total_timeout_seconds of this TaskDef. - - - :param total_timeout_seconds: The total_timeout_seconds of this TaskDef. # noqa: E501 - :type: int - """ - self._total_timeout_seconds = total_timeout_seconds - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TaskDef, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TaskDef): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["TaskDef"] diff --git a/src/conductor/client/http/models/task_details.py b/src/conductor/client/http/models/task_details.py index a9cf8023..0c8aafbd 100644 --- a/src/conductor/client/http/models/task_details.py +++ b/src/conductor/client/http/models/task_details.py @@ -1,211 +1,6 @@ -import pprint -import six -from dataclasses import dataclass, field, fields -from typing import Dict, Any, Optional -from dataclasses import InitVar +from conductor.client.adapters.models.task_details_adapter import \ + TaskDetailsAdapter +TaskDetails = TaskDetailsAdapter -@dataclass -class TaskDetails: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'workflow_id': 'str', - 'task_ref_name': 'str', - 'output': 'dict(str, object)', - 'task_id': 'str' - } - - attribute_map = { - 'workflow_id': 'workflowId', - 'task_ref_name': 'taskRefName', - 'output': 'output', - 'task_id': 'taskId' - } - - _workflow_id: Optional[str] = field(default=None) - _task_ref_name: Optional[str] = field(default=None) - _output: Optional[Dict[str, Any]] = field(default=None) - _task_id: Optional[str] = field(default=None) - - workflow_id: InitVar[Optional[str]] = None - task_ref_name: InitVar[Optional[str]] = None - output: InitVar[Optional[Dict[str, Any]]] = None - task_id: InitVar[Optional[str]] = None - - def __init__(self, workflow_id=None, task_ref_name=None, output=None, task_id=None): # noqa: E501 - """TaskDetails - a model defined in Swagger""" # noqa: E501 - self._workflow_id = None - self._task_ref_name = None - self._output = None - self._task_id = None - self.discriminator = None - if workflow_id is not None: - self.workflow_id = workflow_id - if task_ref_name is not None: - self.task_ref_name = task_ref_name - if output is not None: - self.output = output - if task_id is not None: - self.task_id = task_id - - def __post_init__(self, workflow_id, task_ref_name, output, task_id): - if workflow_id is not None: - self.workflow_id = workflow_id - if task_ref_name is not None: - self.task_ref_name = task_ref_name - if output is not None: - self.output = output - if task_id is not None: - self.task_id = task_id - - @property - def workflow_id(self): - """Gets the workflow_id of this TaskDetails. # noqa: E501 - - - :return: The workflow_id of this TaskDetails. # noqa: E501 - :rtype: str - """ - return self._workflow_id - - @workflow_id.setter - def workflow_id(self, workflow_id): - """Sets the workflow_id of this TaskDetails. - - - :param workflow_id: The workflow_id of this TaskDetails. # noqa: E501 - :type: str - """ - - self._workflow_id = workflow_id - - @property - def task_ref_name(self): - """Gets the task_ref_name of this TaskDetails. # noqa: E501 - - - :return: The task_ref_name of this TaskDetails. # noqa: E501 - :rtype: str - """ - return self._task_ref_name - - @task_ref_name.setter - def task_ref_name(self, task_ref_name): - """Sets the task_ref_name of this TaskDetails. - - - :param task_ref_name: The task_ref_name of this TaskDetails. # noqa: E501 - :type: str - """ - - self._task_ref_name = task_ref_name - - @property - def output(self): - """Gets the output of this TaskDetails. # noqa: E501 - - - :return: The output of this TaskDetails. # noqa: E501 - :rtype: dict(str, object) - """ - return self._output - - @output.setter - def output(self, output): - """Sets the output of this TaskDetails. - - - :param output: The output of this TaskDetails. # noqa: E501 - :type: dict(str, object) - """ - - self._output = output - - @property - def task_id(self): - """Gets the task_id of this TaskDetails. # noqa: E501 - - - :return: The task_id of this TaskDetails. # noqa: E501 - :rtype: str - """ - return self._task_id - - @task_id.setter - def task_id(self, task_id): - """Sets the task_id of this TaskDetails. - - - :param task_id: The task_id of this TaskDetails. # noqa: E501 - :type: str - """ - - self._task_id = task_id - - def put_output_item(self, key, output_item): - """Adds an item to the output dictionary. - - :param key: The key for the output item - :param output_item: The value to add - :return: self - """ - if self._output is None: - self._output = {} - self._output[key] = output_item - return self - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TaskDetails, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TaskDetails): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["TaskDetails"] diff --git a/src/conductor/client/http/models/task_exec_log.py b/src/conductor/client/http/models/task_exec_log.py index 7dbf87ac..99be395c 100644 --- a/src/conductor/client/http/models/task_exec_log.py +++ b/src/conductor/client/http/models/task_exec_log.py @@ -1,176 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, asdict -from typing import Optional -from dataclasses import InitVar -from deprecated import deprecated +from conductor.client.adapters.models.task_exec_log_adapter import \ + TaskExecLogAdapter +TaskExecLog = TaskExecLogAdapter -@dataclass -class TaskExecLog: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'log': 'str', - 'task_id': 'str', - 'created_time': 'int' - } - - attribute_map = { - 'log': 'log', - 'task_id': 'taskId', - 'created_time': 'createdTime' - } - - log: Optional[str] = field(default=None) - task_id: Optional[str] = field(default=None) - created_time: Optional[int] = field(default=None) - - # Private backing fields for properties - _log: Optional[str] = field(default=None, init=False, repr=False) - _task_id: Optional[str] = field(default=None, init=False, repr=False) - _created_time: Optional[int] = field(default=None, init=False, repr=False) - - # For backward compatibility - discriminator: Optional[str] = field(default=None, init=False, repr=False) - - def __init__(self, log=None, task_id=None, created_time=None): # noqa: E501 - """TaskExecLog - a model defined in Swagger""" # noqa: E501 - self._log = None - self._task_id = None - self._created_time = None - self.discriminator = None - if log is not None: - self.log = log - if task_id is not None: - self.task_id = task_id - if created_time is not None: - self.created_time = created_time - - def __post_init__(self): - # Initialize properties from dataclass fields if not already set by __init__ - if self._log is None and self.log is not None: - self._log = self.log - if self._task_id is None and self.task_id is not None: - self._task_id = self.task_id - if self._created_time is None and self.created_time is not None: - self._created_time = self.created_time - - @property - def log(self): - """Gets the log of this TaskExecLog. # noqa: E501 - - - :return: The log of this TaskExecLog. # noqa: E501 - :rtype: str - """ - return self._log - - @log.setter - def log(self, log): - """Sets the log of this TaskExecLog. - - - :param log: The log of this TaskExecLog. # noqa: E501 - :type: str - """ - - self._log = log - - @property - def task_id(self): - """Gets the task_id of this TaskExecLog. # noqa: E501 - - - :return: The task_id of this TaskExecLog. # noqa: E501 - :rtype: str - """ - return self._task_id - - @task_id.setter - def task_id(self, task_id): - """Sets the task_id of this TaskExecLog. - - - :param task_id: The task_id of this TaskExecLog. # noqa: E501 - :type: str - """ - - self._task_id = task_id - - @property - def created_time(self): - """Gets the created_time of this TaskExecLog. # noqa: E501 - - - :return: The created_time of this TaskExecLog. # noqa: E501 - :rtype: int - """ - return self._created_time - - @created_time.setter - def created_time(self, created_time): - """Sets the created_time of this TaskExecLog. - - - :param created_time: The created_time of this TaskExecLog. # noqa: E501 - :type: int - """ - - self._created_time = created_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TaskExecLog, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TaskExecLog): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["TaskExecLog"] diff --git a/src/conductor/client/http/models/task_list_search_result_summary.py b/src/conductor/client/http/models/task_list_search_result_summary.py new file mode 100644 index 00000000..422ae593 --- /dev/null +++ b/src/conductor/client/http/models/task_list_search_result_summary.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.task_list_search_result_summary_adapter import \ + TaskListSearchResultSummaryAdapter + +TaskListSearchResultSummary = TaskListSearchResultSummaryAdapter + +__all__ = ["TaskListSearchResultSummary"] diff --git a/src/conductor/client/http/models/task_mock.py b/src/conductor/client/http/models/task_mock.py new file mode 100644 index 00000000..0e916f10 --- /dev/null +++ b/src/conductor/client/http/models/task_mock.py @@ -0,0 +1,5 @@ +from conductor.client.adapters.models.task_mock_adapter import TaskMockAdapter + +TaskMock = TaskMockAdapter + +__all__ = ["TaskMock"] diff --git a/src/conductor/client/http/models/task_result.py b/src/conductor/client/http/models/task_result.py index c38b552c..e285d775 100644 --- a/src/conductor/client/http/models/task_result.py +++ b/src/conductor/client/http/models/task_result.py @@ -1,494 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, List, Optional, Any, Union -from deprecated import deprecated +from conductor.client.adapters.models.task_result_adapter import \ + TaskResultAdapter -from conductor.shared.http.enums import TaskResultStatus -from conductor.client.http.models.task_exec_log import TaskExecLog +TaskResult = TaskResultAdapter - -@dataclass -class TaskResult: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'workflow_instance_id': 'str', - 'task_id': 'str', - 'reason_for_incompletion': 'str', - 'callback_after_seconds': 'int', - 'worker_id': 'str', - 'status': 'str', - 'output_data': 'dict(str, object)', - 'logs': 'list[TaskExecLog]', - 'external_output_payload_storage_path': 'str', - 'sub_workflow_id': 'str', - 'extend_lease': 'bool' - } - - attribute_map = { - 'workflow_instance_id': 'workflowInstanceId', - 'task_id': 'taskId', - 'reason_for_incompletion': 'reasonForIncompletion', - 'callback_after_seconds': 'callbackAfterSeconds', - 'worker_id': 'workerId', - 'status': 'status', - 'output_data': 'outputData', - 'logs': 'logs', - 'external_output_payload_storage_path': 'externalOutputPayloadStoragePath', - 'sub_workflow_id': 'subWorkflowId', - 'extend_lease': 'extendLease' - } - - workflow_instance_id: Optional[str] = field(default=None) - task_id: Optional[str] = field(default=None) - reason_for_incompletion: Optional[str] = field(default=None) - callback_after_seconds: Optional[int] = field(default=None) - worker_id: Optional[str] = field(default=None) - status: Optional[TaskResultStatus] = field(default=None) - output_data: Dict[str, Any] = field(default_factory=dict) - logs: List[TaskExecLog] = field(default_factory=list) - external_output_payload_storage_path: Optional[str] = field(default=None) - sub_workflow_id: Optional[str] = field(default=None) - extend_lease: bool = field(default=False) - - # Private backing fields for properties - _workflow_instance_id: Optional[str] = field(init=False, repr=False, default=None) - _task_id: Optional[str] = field(init=False, repr=False, default=None) - _reason_for_incompletion: Optional[str] = field(init=False, repr=False, default=None) - _callback_after_seconds: Optional[int] = field(init=False, repr=False, default=None) - _worker_id: Optional[str] = field(init=False, repr=False, default=None) - _status: Optional[TaskResultStatus] = field(init=False, repr=False, default=None) - _output_data: Dict[str, Any] = field(init=False, repr=False, default_factory=dict) - _logs: List[TaskExecLog] = field(init=False, repr=False, default_factory=list) - _external_output_payload_storage_path: Optional[str] = field(init=False, repr=False, default=None) - _sub_workflow_id: Optional[str] = field(init=False, repr=False, default=None) - _extend_lease: bool = field(init=False, repr=False, default=False) - - # Keep the original __init__ for backward compatibility - def __init__(self, workflow_instance_id=None, task_id=None, reason_for_incompletion=None, - callback_after_seconds=None, worker_id=None, status=None, output_data=None, logs=None, - external_output_payload_storage_path=None, sub_workflow_id=None, extend_lease=False): # noqa: E501 - """TaskResult - a model defined in Swagger""" # noqa: E501 - self._workflow_instance_id = None - self._task_id = None - self._reason_for_incompletion = None - self._callback_after_seconds = None - self._worker_id = None - self._status = None - self._output_data = None - self._logs = None - self._external_output_payload_storage_path = None - self._sub_workflow_id = None - self._extend_lease = False - self.discriminator = None - self.workflow_instance_id = workflow_instance_id - self.task_id = task_id - if reason_for_incompletion is not None: - self.reason_for_incompletion = reason_for_incompletion - if callback_after_seconds is not None: - self.callback_after_seconds = callback_after_seconds - if worker_id is not None: - self.worker_id = worker_id - if status is not None: - self.status = status - if output_data is not None: - self.output_data = output_data - if logs is not None: - self.logs = logs - if external_output_payload_storage_path is not None: - self.external_output_payload_storage_path = external_output_payload_storage_path - if sub_workflow_id is not None: - self.sub_workflow_id = sub_workflow_id - if extend_lease is not None: - self.extend_lease = extend_lease - - def __post_init__(self): - """Initialize fields after dataclass initialization""" - if self.workflow_instance_id is not None: - self._workflow_instance_id = self.workflow_instance_id - if self.task_id is not None: - self._task_id = self.task_id - if self.reason_for_incompletion is not None: - self._reason_for_incompletion = self.reason_for_incompletion - if self.callback_after_seconds is not None: - self._callback_after_seconds = self.callback_after_seconds - if self.worker_id is not None: - self._worker_id = self.worker_id - if self.status is not None: - self._status = self.status - if self.output_data is not None: - self._output_data = self.output_data - if self.logs is not None: - self._logs = self.logs - if self.external_output_payload_storage_path is not None: - self._external_output_payload_storage_path = self.external_output_payload_storage_path - if self.sub_workflow_id is not None: - self._sub_workflow_id = self.sub_workflow_id - if self.extend_lease is not None: - self._extend_lease = self.extend_lease - - @property - def workflow_instance_id(self): - """Gets the workflow_instance_id of this TaskResult. # noqa: E501 - - - :return: The workflow_instance_id of this TaskResult. # noqa: E501 - :rtype: str - """ - return self._workflow_instance_id - - @workflow_instance_id.setter - def workflow_instance_id(self, workflow_instance_id): - """Sets the workflow_instance_id of this TaskResult. - - - :param workflow_instance_id: The workflow_instance_id of this TaskResult. # noqa: E501 - :type: str - """ - self._workflow_instance_id = workflow_instance_id - - @property - def task_id(self): - """Gets the task_id of this TaskResult. # noqa: E501 - - - :return: The task_id of this TaskResult. # noqa: E501 - :rtype: str - """ - return self._task_id - - @task_id.setter - def task_id(self, task_id): - """Sets the task_id of this TaskResult. - - - :param task_id: The task_id of this TaskResult. # noqa: E501 - :type: str - """ - self._task_id = task_id - - @property - def reason_for_incompletion(self): - """Gets the reason_for_incompletion of this TaskResult. # noqa: E501 - - - :return: The reason_for_incompletion of this TaskResult. # noqa: E501 - :rtype: str - """ - return self._reason_for_incompletion - - @reason_for_incompletion.setter - def reason_for_incompletion(self, reason_for_incompletion): - """Sets the reason_for_incompletion of this TaskResult. - - - :param reason_for_incompletion: The reason_for_incompletion of this TaskResult. # noqa: E501 - :type: str - """ - - self._reason_for_incompletion = reason_for_incompletion - - @property - def callback_after_seconds(self): - """Gets the callback_after_seconds of this TaskResult. # noqa: E501 - - - :return: The callback_after_seconds of this TaskResult. # noqa: E501 - :rtype: int - """ - return self._callback_after_seconds - - @callback_after_seconds.setter - def callback_after_seconds(self, callback_after_seconds): - """Sets the callback_after_seconds of this TaskResult. - - - :param callback_after_seconds: The callback_after_seconds of this TaskResult. # noqa: E501 - :type: int - """ - - self._callback_after_seconds = callback_after_seconds - - @property - def worker_id(self): - """Gets the worker_id of this TaskResult. # noqa: E501 - - - :return: The worker_id of this TaskResult. # noqa: E501 - :rtype: str - """ - return self._worker_id - - @worker_id.setter - def worker_id(self, worker_id): - """Sets the worker_id of this TaskResult. - - - :param worker_id: The worker_id of this TaskResult. # noqa: E501 - :type: str - """ - - self._worker_id = worker_id - - @property - def status(self): - """Gets the status of this TaskResult. # noqa: E501 - - - :return: The status of this TaskResult. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this TaskResult. - - - :param status: The status of this TaskResult. # noqa: E501 - :type: str - """ - allowed_values = [ - task_result_status.name for task_result_status in TaskResultStatus - ] - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = TaskResultStatus[status] - - @property - def output_data(self): - """Gets the output_data of this TaskResult. # noqa: E501 - - - :return: The output_data of this TaskResult. # noqa: E501 - :rtype: dict(str, object) - """ - return self._output_data - - @output_data.setter - def output_data(self, output_data): - """Sets the output_data of this TaskResult. - - - :param output_data: The output_data of this TaskResult. # noqa: E501 - :type: dict(str, object) - """ - - self._output_data = output_data - - @property - def logs(self): - """Gets the logs of this TaskResult. # noqa: E501 - - - :return: The logs of this TaskResult. # noqa: E501 - :rtype: list[TaskExecLog] - """ - return self._logs - - @logs.setter - def logs(self, logs): - """Sets the logs of this TaskResult. - - - :param logs: The logs of this TaskResult. # noqa: E501 - :type: list[TaskExecLog] - """ - - self._logs = logs - - @property - def external_output_payload_storage_path(self): - """Gets the external_output_payload_storage_path of this TaskResult. # noqa: E501 - - - :return: The external_output_payload_storage_path of this TaskResult. # noqa: E501 - :rtype: str - """ - return self._external_output_payload_storage_path - - @external_output_payload_storage_path.setter - def external_output_payload_storage_path(self, external_output_payload_storage_path): - """Sets the external_output_payload_storage_path of this TaskResult. - - - :param external_output_payload_storage_path: The external_output_payload_storage_path of this TaskResult. # noqa: E501 - :type: str - """ - - self._external_output_payload_storage_path = external_output_payload_storage_path - - @property - def sub_workflow_id(self): - """Gets the sub_workflow_id of this TaskResult. # noqa: E501 - - - :return: The sub_workflow_id of this TaskResult. # noqa: E501 - :rtype: str - """ - return self._sub_workflow_id - - @sub_workflow_id.setter - def sub_workflow_id(self, sub_workflow_id): - """Sets the sub_workflow_id of this TaskResult. - - - :param sub_workflow_id: The sub_workflow_id of this TaskResult. # noqa: E501 - :type: str - """ - - self._sub_workflow_id = sub_workflow_id - - @property - def extend_lease(self): - """Gets the extend_lease of this TaskResult. # noqa: E501 - - - :return: The extend_lease of this TaskResult. # noqa: E501 - :rtype: bool - """ - return self._extend_lease - - @extend_lease.setter - def extend_lease(self, extend_lease): - """Sets the extend_lease of this TaskResult. - - - :param extend_lease: The extend_lease of this TaskResult. # noqa: E501 - :type: bool - """ - - self._extend_lease = extend_lease - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TaskResult, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TaskResult): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def add_output_data(self, key, value): - if self.output_data is None: - self.output_data = {} - self.output_data[key] = value - return self - - def log(self, log): - """Adds a log entry to this TaskResult. - - :param log: The log message to add - :type: str - :return: This TaskResult instance - :rtype: TaskResult - """ - if self.logs is None: - self.logs = [] - self.logs.append(TaskExecLog(log)) - return self - - @staticmethod - def complete(): - """Creates a new TaskResult with COMPLETED status. - - :return: A new TaskResult with COMPLETED status - :rtype: TaskResult - """ - return TaskResult.new_task_result("COMPLETED") - - @staticmethod - def failed(): - """Creates a new TaskResult with FAILED status. - - :return: A new TaskResult with FAILED status - :rtype: TaskResult - """ - return TaskResult.new_task_result("FAILED") - - @staticmethod - def failed(failure_reason): - """Creates a new TaskResult with FAILED status and the specified failure reason. - - :param failure_reason: The reason for failure - :type: str - :return: A new TaskResult with FAILED status and the specified failure reason - :rtype: TaskResult - """ - result = TaskResult.new_task_result("FAILED") - result.reason_for_incompletion = failure_reason - return result - - @staticmethod - def in_progress(): - """Creates a new TaskResult with IN_PROGRESS status. - - :return: A new TaskResult with IN_PROGRESS status - :rtype: TaskResult - """ - return TaskResult.new_task_result("IN_PROGRESS") - - @staticmethod - def new_task_result(status): - """Creates a new TaskResult with the specified status. - - :param status: The status for the new TaskResult - :type: str - :return: A new TaskResult with the specified status - :rtype: TaskResult - """ - result = TaskResult() - result.status = status - return result \ No newline at end of file +__all__ = ["TaskResult"] diff --git a/src/conductor/client/http/models/task_result_status.py b/src/conductor/client/http/models/task_result_status.py index 8e048301..c0795a07 100644 --- a/src/conductor/client/http/models/task_result_status.py +++ b/src/conductor/client/http/models/task_result_status.py @@ -1,319 +1,3 @@ -from dataclasses import dataclass, field -from enum import Enum -from typing import Dict, List, Optional, Any -from deprecated import deprecated +from conductor.shared.http.enums.task_result_status import TaskResultStatus - -class TaskResultStatus(str, Enum): - COMPLETED = "COMPLETED", - FAILED = "FAILED", - FAILED_WITH_TERMINAL_ERROR = "FAILED_WITH_TERMINAL_ERROR", - IN_PROGRESS = "IN_PROGRESS" - - def __str__(self) -> str: - return self.name.__str__() - - -class TaskExecLog: - def __init__(self, log: str): - self.log = log - - -@dataclass -class TaskResult: - _workflow_instance_id: str = field(default=None) - _task_id: str = field(default=None) - _reason_for_incompletion: str = field(default=None) - _callback_after_seconds: int = field(default=0) - _worker_id: str = field(default=None) - _status: TaskResultStatus = field(default=None) - _output_data: Dict[str, Any] = field(default_factory=dict) - _logs: List[TaskExecLog] = field(default_factory=list) - _external_output_payload_storage_path: str = field(default=None) - _sub_workflow_id: str = field(default=None) - _extend_lease: bool = field(default=False) - - def __init__(self, task=None): - self._workflow_instance_id = None - self._task_id = None - self._reason_for_incompletion = None - self._callback_after_seconds = 0 - self._worker_id = None - self._status = None - self._output_data = {} - self._logs = [] - self._external_output_payload_storage_path = None - self._sub_workflow_id = None - self._extend_lease = False - - if task is not None: - self._workflow_instance_id = task.workflow_instance_id - self._task_id = task.task_id - self._reason_for_incompletion = task.reason_for_incompletion - self._callback_after_seconds = task.callback_after_seconds - self._worker_id = task.worker_id - self._output_data = task.output_data - self._external_output_payload_storage_path = task.external_output_payload_storage_path - self._sub_workflow_id = task.sub_workflow_id - - if task.status == "CANCELED" or task.status == "COMPLETED_WITH_ERRORS" or task.status == "TIMED_OUT" or task.status == "SKIPPED": - self._status = TaskResultStatus.FAILED - elif task.status == "SCHEDULED": - self._status = TaskResultStatus.IN_PROGRESS - else: - self._status = TaskResultStatus[task.status] - - def __post_init__(self): - if self._output_data is None: - self._output_data = {} - if self._logs is None: - self._logs = [] - - @property - def workflow_instance_id(self) -> str: - """ - Returns the workflow instance id - """ - return self._workflow_instance_id - - @workflow_instance_id.setter - def workflow_instance_id(self, workflow_instance_id: str): - """ - Sets the workflow instance id - """ - self._workflow_instance_id = workflow_instance_id - - @property - def task_id(self) -> str: - """ - Returns the task id - """ - return self._task_id - - @task_id.setter - def task_id(self, task_id: str): - """ - Sets the task id - """ - self._task_id = task_id - - @property - def reason_for_incompletion(self) -> str: - """ - Returns the reason for incompletion - """ - return self._reason_for_incompletion - - @reason_for_incompletion.setter - def reason_for_incompletion(self, reason_for_incompletion: str): - """ - Sets the reason for incompletion - """ - if reason_for_incompletion and len(reason_for_incompletion) > 500: - self._reason_for_incompletion = reason_for_incompletion[:500] - else: - self._reason_for_incompletion = reason_for_incompletion - - @property - def callback_after_seconds(self) -> int: - """ - Returns the callback after seconds - """ - return self._callback_after_seconds - - @callback_after_seconds.setter - def callback_after_seconds(self, callback_after_seconds: int): - """ - Sets the callback after seconds - """ - self._callback_after_seconds = callback_after_seconds - - @property - def worker_id(self) -> str: - """ - Returns the worker id - """ - return self._worker_id - - @worker_id.setter - def worker_id(self, worker_id: str): - """ - Sets the worker id - """ - self._worker_id = worker_id - - @property - def status(self) -> TaskResultStatus: - """ - Returns the status - """ - return self._status - - @status.setter - def status(self, status: TaskResultStatus): - """ - Sets the status - """ - self._status = status - - @property - def output_data(self) -> Dict[str, Any]: - """ - Returns the output data - """ - return self._output_data - - @output_data.setter - def output_data(self, output_data: Dict[str, Any]): - """ - Sets the output data - """ - self._output_data = output_data - - @property - def logs(self) -> List[TaskExecLog]: - """ - Returns the logs - """ - return self._logs - - @logs.setter - def logs(self, logs: List[TaskExecLog]): - """ - Sets the logs - """ - self._logs = logs - - @property - def external_output_payload_storage_path(self) -> str: - """ - Returns the external output payload storage path - """ - return self._external_output_payload_storage_path - - @external_output_payload_storage_path.setter - def external_output_payload_storage_path(self, external_output_payload_storage_path: str): - """ - Sets the external output payload storage path - """ - self._external_output_payload_storage_path = external_output_payload_storage_path - - @property - def sub_workflow_id(self) -> str: - """ - Returns the sub workflow id - """ - return self._sub_workflow_id - - @sub_workflow_id.setter - def sub_workflow_id(self, sub_workflow_id: str): - """ - Sets the sub workflow id - """ - self._sub_workflow_id = sub_workflow_id - - @property - def extend_lease(self) -> bool: - """ - Returns whether to extend lease - """ - return self._extend_lease - - @extend_lease.setter - def extend_lease(self, extend_lease: bool): - """ - Sets whether to extend lease - """ - self._extend_lease = extend_lease - - def add_output_data(self, key: str, value: Any) -> 'TaskResult': - """ - Adds output data - """ - self._output_data[key] = value - return self - - def log(self, log: str) -> 'TaskResult': - """ - Adds a log - """ - self._logs.append(TaskExecLog(log)) - return self - - def __str__(self) -> str: - return f"TaskResult{{workflowInstanceId='{self._workflow_instance_id}', taskId='{self._task_id}', reasonForIncompletion='{self._reason_for_incompletion}', callbackAfterSeconds={self._callback_after_seconds}, workerId='{self._worker_id}', status={self._status}, outputData={self._output_data}, logs={self._logs}, externalOutputPayloadStoragePath='{self._external_output_payload_storage_path}', subWorkflowId='{self._sub_workflow_id}', extendLease='{self._extend_lease}'}}" - - def __eq__(self, other): - if not isinstance(other, TaskResult): - return False - return (self._workflow_instance_id == other.workflow_instance_id and - self._task_id == other.task_id and - self._reason_for_incompletion == other.reason_for_incompletion and - self._callback_after_seconds == other.callback_after_seconds and - self._worker_id == other.worker_id and - self._status == other.status and - self._output_data == other.output_data and - self._logs == other.logs and - self._external_output_payload_storage_path == other.external_output_payload_storage_path and - self._sub_workflow_id == other.sub_workflow_id and - self._extend_lease == other.extend_lease) - - def __ne__(self, other): - return not self.__eq__(other) - - def to_dict(self) -> Dict[str, Any]: - """ - Converts the task result to a dictionary - """ - return { - "workflowInstanceId": self._workflow_instance_id, - "taskId": self._task_id, - "reasonForIncompletion": self._reason_for_incompletion, - "callbackAfterSeconds": self._callback_after_seconds, - "workerId": self._worker_id, - "status": self._status.name if self._status else None, - "outputData": self._output_data, - "logs": self._logs, - "externalOutputPayloadStoragePath": self._external_output_payload_storage_path, - "subWorkflowId": self._sub_workflow_id, - "extendLease": self._extend_lease - } - - @staticmethod - def complete() -> 'TaskResult': - """ - Creates a completed task result - """ - return TaskResult.new_task_result(TaskResultStatus.COMPLETED) - - @staticmethod - def failed() -> 'TaskResult': - """ - Creates a failed task result - """ - return TaskResult.new_task_result(TaskResultStatus.FAILED) - - @staticmethod - def failed(failure_reason: str) -> 'TaskResult': - """ - Creates a failed task result with a reason - """ - result = TaskResult.new_task_result(TaskResultStatus.FAILED) - result.reason_for_incompletion = failure_reason - return result - - @staticmethod - def in_progress() -> 'TaskResult': - """ - Creates an in progress task result - """ - return TaskResult.new_task_result(TaskResultStatus.IN_PROGRESS) - - @staticmethod - def new_task_result(status: TaskResultStatus) -> 'TaskResult': - """ - Creates a new task result with the given status - """ - result = TaskResult() - result.status = status - return result \ No newline at end of file +__all__ = ["TaskResultStatus"] diff --git a/src/conductor/client/http/models/task_summary.py b/src/conductor/client/http/models/task_summary.py index dd34d4b1..85d015fc 100644 --- a/src/conductor/client/http/models/task_summary.py +++ b/src/conductor/client/http/models/task_summary.py @@ -1,697 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Optional, Dict, List, Any -from deprecated import deprecated +from conductor.client.adapters.models.task_summary_adapter import \ + TaskSummaryAdapter +TaskSummary = TaskSummaryAdapter -@dataclass -class TaskSummary: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'workflow_id': 'str', - 'workflow_type': 'str', - 'correlation_id': 'str', - 'scheduled_time': 'str', - 'start_time': 'str', - 'update_time': 'str', - 'end_time': 'str', - 'status': 'str', - 'reason_for_incompletion': 'str', - 'execution_time': 'int', - 'queue_wait_time': 'int', - 'task_def_name': 'str', - 'task_type': 'str', - 'input': 'str', - 'output': 'str', - 'task_id': 'str', - 'external_input_payload_storage_path': 'str', - 'external_output_payload_storage_path': 'str', - 'workflow_priority': 'int', - 'domain': 'str' - } - - attribute_map = { - 'workflow_id': 'workflowId', - 'workflow_type': 'workflowType', - 'correlation_id': 'correlationId', - 'scheduled_time': 'scheduledTime', - 'start_time': 'startTime', - 'update_time': 'updateTime', - 'end_time': 'endTime', - 'status': 'status', - 'reason_for_incompletion': 'reasonForIncompletion', - 'execution_time': 'executionTime', - 'queue_wait_time': 'queueWaitTime', - 'task_def_name': 'taskDefName', - 'task_type': 'taskType', - 'input': 'input', - 'output': 'output', - 'task_id': 'taskId', - 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', - 'external_output_payload_storage_path': 'externalOutputPayloadStoragePath', - 'workflow_priority': 'workflowPriority', - 'domain': 'domain' - } - - # Dataclass fields with default values - workflow_id: Optional[str] = field(default=None) - workflow_type: Optional[str] = field(default=None) - correlation_id: Optional[str] = field(default=None) - scheduled_time: Optional[str] = field(default=None) - start_time: Optional[str] = field(default=None) - update_time: Optional[str] = field(default=None) - end_time: Optional[str] = field(default=None) - status: Optional[str] = field(default=None) - reason_for_incompletion: Optional[str] = field(default=None) - execution_time: Optional[int] = field(default=None) - queue_wait_time: Optional[int] = field(default=None) - task_def_name: Optional[str] = field(default=None) - task_type: Optional[str] = field(default=None) - input: Optional[str] = field(default=None) - output: Optional[str] = field(default=None) - task_id: Optional[str] = field(default=None) - external_input_payload_storage_path: Optional[str] = field(default=None) - external_output_payload_storage_path: Optional[str] = field(default=None) - workflow_priority: Optional[int] = field(default=None) - domain: Optional[str] = field(default=None) - - # Private backing fields for properties - _workflow_id: Optional[str] = field(init=False, repr=False, default=None) - _workflow_type: Optional[str] = field(init=False, repr=False, default=None) - _correlation_id: Optional[str] = field(init=False, repr=False, default=None) - _scheduled_time: Optional[str] = field(init=False, repr=False, default=None) - _start_time: Optional[str] = field(init=False, repr=False, default=None) - _update_time: Optional[str] = field(init=False, repr=False, default=None) - _end_time: Optional[str] = field(init=False, repr=False, default=None) - _status: Optional[str] = field(init=False, repr=False, default=None) - _reason_for_incompletion: Optional[str] = field(init=False, repr=False, default=None) - _execution_time: Optional[int] = field(init=False, repr=False, default=None) - _queue_wait_time: Optional[int] = field(init=False, repr=False, default=None) - _task_def_name: Optional[str] = field(init=False, repr=False, default=None) - _task_type: Optional[str] = field(init=False, repr=False, default=None) - _input: Optional[str] = field(init=False, repr=False, default=None) - _output: Optional[str] = field(init=False, repr=False, default=None) - _task_id: Optional[str] = field(init=False, repr=False, default=None) - _external_input_payload_storage_path: Optional[str] = field(init=False, repr=False, default=None) - _external_output_payload_storage_path: Optional[str] = field(init=False, repr=False, default=None) - _workflow_priority: Optional[int] = field(init=False, repr=False, default=None) - _domain: Optional[str] = field(init=False, repr=False, default=None) - - # For backward compatibility - discriminator: Optional[str] = field(init=False, repr=False, default=None) - - def __init__(self, workflow_id=None, workflow_type=None, correlation_id=None, scheduled_time=None, start_time=None, - update_time=None, end_time=None, status=None, reason_for_incompletion=None, execution_time=None, - queue_wait_time=None, task_def_name=None, task_type=None, input=None, output=None, task_id=None, - external_input_payload_storage_path=None, external_output_payload_storage_path=None, - workflow_priority=None, domain=None): # noqa: E501 - """TaskSummary - a model defined in Swagger""" # noqa: E501 - self._workflow_id = None - self._workflow_type = None - self._correlation_id = None - self._scheduled_time = None - self._start_time = None - self._update_time = None - self._end_time = None - self._status = None - self._reason_for_incompletion = None - self._execution_time = None - self._queue_wait_time = None - self._task_def_name = None - self._task_type = None - self._input = None - self._output = None - self._task_id = None - self._external_input_payload_storage_path = None - self._external_output_payload_storage_path = None - self._workflow_priority = None - self._domain = None - self.discriminator = None - if workflow_id is not None: - self.workflow_id = workflow_id - if workflow_type is not None: - self.workflow_type = workflow_type - if correlation_id is not None: - self.correlation_id = correlation_id - if scheduled_time is not None: - self.scheduled_time = scheduled_time - if start_time is not None: - self.start_time = start_time - if update_time is not None: - self.update_time = update_time - if end_time is not None: - self.end_time = end_time - if status is not None: - self.status = status - if reason_for_incompletion is not None: - self.reason_for_incompletion = reason_for_incompletion - if execution_time is not None: - self.execution_time = execution_time - if queue_wait_time is not None: - self.queue_wait_time = queue_wait_time - if task_def_name is not None: - self.task_def_name = task_def_name - if task_type is not None: - self.task_type = task_type - if input is not None: - self.input = input - if output is not None: - self.output = output - if task_id is not None: - self.task_id = task_id - if external_input_payload_storage_path is not None: - self.external_input_payload_storage_path = external_input_payload_storage_path - if external_output_payload_storage_path is not None: - self.external_output_payload_storage_path = external_output_payload_storage_path - if workflow_priority is not None: - self.workflow_priority = workflow_priority - if domain is not None: - self.domain = domain - - def __post_init__(self): - """Initialize attributes after dataclass initialization""" - if self.workflow_id is not None: - self._workflow_id = self.workflow_id - if self.workflow_type is not None: - self._workflow_type = self.workflow_type - if self.correlation_id is not None: - self._correlation_id = self.correlation_id - if self.scheduled_time is not None: - self._scheduled_time = self.scheduled_time - if self.start_time is not None: - self._start_time = self.start_time - if self.update_time is not None: - self._update_time = self.update_time - if self.end_time is not None: - self._end_time = self.end_time - if self.status is not None: - self._status = self.status - if self.reason_for_incompletion is not None: - self._reason_for_incompletion = self.reason_for_incompletion - if self.execution_time is not None: - self._execution_time = self.execution_time - if self.queue_wait_time is not None: - self._queue_wait_time = self.queue_wait_time - if self.task_def_name is not None: - self._task_def_name = self.task_def_name - if self.task_type is not None: - self._task_type = self.task_type - if self.input is not None: - self._input = self.input - if self.output is not None: - self._output = self.output - if self.task_id is not None: - self._task_id = self.task_id - if self.external_input_payload_storage_path is not None: - self._external_input_payload_storage_path = self.external_input_payload_storage_path - if self.external_output_payload_storage_path is not None: - self._external_output_payload_storage_path = self.external_output_payload_storage_path - if self.workflow_priority is not None: - self._workflow_priority = self.workflow_priority - if self.domain is not None: - self._domain = self.domain - - @property - def workflow_id(self): - """Gets the workflow_id of this TaskSummary. # noqa: E501 - - - :return: The workflow_id of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._workflow_id - - @workflow_id.setter - def workflow_id(self, workflow_id): - """Sets the workflow_id of this TaskSummary. - - - :param workflow_id: The workflow_id of this TaskSummary. # noqa: E501 - :type: str - """ - - self._workflow_id = workflow_id - - @property - def workflow_type(self): - """Gets the workflow_type of this TaskSummary. # noqa: E501 - - - :return: The workflow_type of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._workflow_type - - @workflow_type.setter - def workflow_type(self, workflow_type): - """Sets the workflow_type of this TaskSummary. - - - :param workflow_type: The workflow_type of this TaskSummary. # noqa: E501 - :type: str - """ - - self._workflow_type = workflow_type - - @property - def correlation_id(self): - """Gets the correlation_id of this TaskSummary. # noqa: E501 - - - :return: The correlation_id of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._correlation_id - - @correlation_id.setter - def correlation_id(self, correlation_id): - """Sets the correlation_id of this TaskSummary. - - - :param correlation_id: The correlation_id of this TaskSummary. # noqa: E501 - :type: str - """ - - self._correlation_id = correlation_id - - @property - def scheduled_time(self): - """Gets the scheduled_time of this TaskSummary. # noqa: E501 - - - :return: The scheduled_time of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._scheduled_time - - @scheduled_time.setter - def scheduled_time(self, scheduled_time): - """Sets the scheduled_time of this TaskSummary. - - - :param scheduled_time: The scheduled_time of this TaskSummary. # noqa: E501 - :type: str - """ - - self._scheduled_time = scheduled_time - - @property - def start_time(self): - """Gets the start_time of this TaskSummary. # noqa: E501 - - - :return: The start_time of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._start_time - - @start_time.setter - def start_time(self, start_time): - """Sets the start_time of this TaskSummary. - - - :param start_time: The start_time of this TaskSummary. # noqa: E501 - :type: str - """ - - self._start_time = start_time - - @property - def update_time(self): - """Gets the update_time of this TaskSummary. # noqa: E501 - - - :return: The update_time of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._update_time - - @update_time.setter - def update_time(self, update_time): - """Sets the update_time of this TaskSummary. - - - :param update_time: The update_time of this TaskSummary. # noqa: E501 - :type: str - """ - - self._update_time = update_time - - @property - def end_time(self): - """Gets the end_time of this TaskSummary. # noqa: E501 - - - :return: The end_time of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._end_time - - @end_time.setter - def end_time(self, end_time): - """Sets the end_time of this TaskSummary. - - - :param end_time: The end_time of this TaskSummary. # noqa: E501 - :type: str - """ - - self._end_time = end_time - - @property - def status(self): - """Gets the status of this TaskSummary. # noqa: E501 - - - :return: The status of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this TaskSummary. - - - :param status: The status of this TaskSummary. # noqa: E501 - :type: str - """ - allowed_values = ["IN_PROGRESS", "CANCELED", "FAILED", "FAILED_WITH_TERMINAL_ERROR", "COMPLETED", - "COMPLETED_WITH_ERRORS", "SCHEDULED", "TIMED_OUT", "SKIPPED"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def reason_for_incompletion(self): - """Gets the reason_for_incompletion of this TaskSummary. # noqa: E501 - - - :return: The reason_for_incompletion of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._reason_for_incompletion - - @reason_for_incompletion.setter - def reason_for_incompletion(self, reason_for_incompletion): - """Sets the reason_for_incompletion of this TaskSummary. - - - :param reason_for_incompletion: The reason_for_incompletion of this TaskSummary. # noqa: E501 - :type: str - """ - - self._reason_for_incompletion = reason_for_incompletion - - @property - def execution_time(self): - """Gets the execution_time of this TaskSummary. # noqa: E501 - - - :return: The execution_time of this TaskSummary. # noqa: E501 - :rtype: int - """ - return self._execution_time - - @execution_time.setter - def execution_time(self, execution_time): - """Sets the execution_time of this TaskSummary. - - - :param execution_time: The execution_time of this TaskSummary. # noqa: E501 - :type: int - """ - - self._execution_time = execution_time - - @property - def queue_wait_time(self): - """Gets the queue_wait_time of this TaskSummary. # noqa: E501 - - - :return: The queue_wait_time of this TaskSummary. # noqa: E501 - :rtype: int - """ - return self._queue_wait_time - - @queue_wait_time.setter - def queue_wait_time(self, queue_wait_time): - """Sets the queue_wait_time of this TaskSummary. - - - :param queue_wait_time: The queue_wait_time of this TaskSummary. # noqa: E501 - :type: int - """ - - self._queue_wait_time = queue_wait_time - - @property - def task_def_name(self): - """Gets the task_def_name of this TaskSummary. # noqa: E501 - - - :return: The task_def_name of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._task_def_name - - @task_def_name.setter - def task_def_name(self, task_def_name): - """Sets the task_def_name of this TaskSummary. - - - :param task_def_name: The task_def_name of this TaskSummary. # noqa: E501 - :type: str - """ - - self._task_def_name = task_def_name - - @property - def task_type(self): - """Gets the task_type of this TaskSummary. # noqa: E501 - - - :return: The task_type of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._task_type - - @task_type.setter - def task_type(self, task_type): - """Sets the task_type of this TaskSummary. - - - :param task_type: The task_type of this TaskSummary. # noqa: E501 - :type: str - """ - - self._task_type = task_type - - @property - def input(self): - """Gets the input of this TaskSummary. # noqa: E501 - - - :return: The input of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._input - - @input.setter - def input(self, input): - """Sets the input of this TaskSummary. - - - :param input: The input of this TaskSummary. # noqa: E501 - :type: str - """ - - self._input = input - - @property - def output(self): - """Gets the output of this TaskSummary. # noqa: E501 - - - :return: The output of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._output - - @output.setter - def output(self, output): - """Sets the output of this TaskSummary. - - - :param output: The output of this TaskSummary. # noqa: E501 - :type: str - """ - - self._output = output - - @property - def task_id(self): - """Gets the task_id of this TaskSummary. # noqa: E501 - - - :return: The task_id of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._task_id - - @task_id.setter - def task_id(self, task_id): - """Sets the task_id of this TaskSummary. - - - :param task_id: The task_id of this TaskSummary. # noqa: E501 - :type: str - """ - - self._task_id = task_id - - @property - def external_input_payload_storage_path(self): - """Gets the external_input_payload_storage_path of this TaskSummary. # noqa: E501 - - - :return: The external_input_payload_storage_path of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._external_input_payload_storage_path - - @external_input_payload_storage_path.setter - def external_input_payload_storage_path(self, external_input_payload_storage_path): - """Sets the external_input_payload_storage_path of this TaskSummary. - - - :param external_input_payload_storage_path: The external_input_payload_storage_path of this TaskSummary. # noqa: E501 - :type: str - """ - - self._external_input_payload_storage_path = external_input_payload_storage_path - - @property - def external_output_payload_storage_path(self): - """Gets the external_output_payload_storage_path of this TaskSummary. # noqa: E501 - - - :return: The external_output_payload_storage_path of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._external_output_payload_storage_path - - @external_output_payload_storage_path.setter - def external_output_payload_storage_path(self, external_output_payload_storage_path): - """Sets the external_output_payload_storage_path of this TaskSummary. - - - :param external_output_payload_storage_path: The external_output_payload_storage_path of this TaskSummary. # noqa: E501 - :type: str - """ - - self._external_output_payload_storage_path = external_output_payload_storage_path - - @property - def workflow_priority(self): - """Gets the workflow_priority of this TaskSummary. # noqa: E501 - - - :return: The workflow_priority of this TaskSummary. # noqa: E501 - :rtype: int - """ - return self._workflow_priority - - @workflow_priority.setter - def workflow_priority(self, workflow_priority): - """Sets the workflow_priority of this TaskSummary. - - - :param workflow_priority: The workflow_priority of this TaskSummary. # noqa: E501 - :type: int - """ - - self._workflow_priority = workflow_priority - - @property - def domain(self): - """Gets the domain of this TaskSummary. # noqa: E501 - - - :return: The domain of this TaskSummary. # noqa: E501 - :rtype: str - """ - return self._domain - - @domain.setter - def domain(self, domain): - """Sets the domain of this TaskSummary. - - - :param domain: The domain of this TaskSummary. # noqa: E501 - :type: str - """ - - self._domain = domain - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TaskSummary, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TaskSummary): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["TaskSummary"] diff --git a/src/conductor/client/http/models/terminate_workflow.py b/src/conductor/client/http/models/terminate_workflow.py index e4a1803e..614e6977 100644 --- a/src/conductor/client/http/models/terminate_workflow.py +++ b/src/conductor/client/http/models/terminate_workflow.py @@ -1,36 +1,6 @@ -from dataclasses import dataclass, field -from typing import Optional +from conductor.client.adapters.models.terminate_workflow_adapter import \ + TerminateWorkflowAdapter +TerminateWorkflow = TerminateWorkflowAdapter -@dataclass -class TerminateWorkflow: - """TerminateWorkflow model for workflow termination operations. - - Attributes: - workflow_id: The ID of the workflow to terminate - termination_reason: The reason for terminating the workflow - """ - workflow_id: Optional[str] = None - termination_reason: Optional[str] = None - - # Define JSON mapping for serialization - swagger_types: dict = field(default_factory=lambda: { - 'workflow_id': 'str', - 'termination_reason': 'str' - }) - - attribute_map: dict = field(default_factory=lambda: { - 'workflow_id': 'workflowId', - 'termination_reason': 'terminationReason' - }) - - def to_dict(self): - """Returns the model properties as a dict""" - return { - 'workflowId': self.workflow_id, - 'terminationReason': self.termination_reason - } - - def __repr__(self): - """Returns string representation of the model""" - return f"TerminateWorkflow(workflow_id={self.workflow_id!r}, termination_reason={self.termination_reason!r})" \ No newline at end of file +__all__ = ["TerminateWorkflow"] diff --git a/src/conductor/client/http/models/token.py b/src/conductor/client/http/models/token.py index db6a0b85..32783fb0 100644 --- a/src/conductor/client/http/models/token.py +++ b/src/conductor/client/http/models/token.py @@ -1,21 +1,5 @@ -class Token(object): - swagger_types = { - 'token': 'str' - } +from conductor.client.adapters.models.token_adapter import TokenAdapter - attribute_map = { - 'token': 'token' - } +Token = TokenAdapter - def __init__(self, token: str = None): - self.token = None - if token is not None: - self.token = token - - @property - def token(self) -> str: - return self._token - - @token.setter - def token(self, token: str): - self._token = token +__all__ = ["Token"] diff --git a/src/conductor/client/http/models/uninterpreted_option.py b/src/conductor/client/http/models/uninterpreted_option.py new file mode 100644 index 00000000..aa323d37 --- /dev/null +++ b/src/conductor/client/http/models/uninterpreted_option.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.uninterpreted_option_adapter import \ + UninterpretedOptionAdapter + +UninterpretedOption = UninterpretedOptionAdapter + +__all__ = ["UninterpretedOption"] diff --git a/src/conductor/client/http/models/uninterpreted_option_or_builder.py b/src/conductor/client/http/models/uninterpreted_option_or_builder.py new file mode 100644 index 00000000..5022106b --- /dev/null +++ b/src/conductor/client/http/models/uninterpreted_option_or_builder.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.uninterpreted_option_or_builder_adapter import \ + UninterpretedOptionOrBuilderAdapter + +UninterpretedOptionOrBuilder = UninterpretedOptionOrBuilderAdapter + +__all__ = ["UninterpretedOptionOrBuilder"] diff --git a/src/conductor/client/http/models/unknown_field_set.py b/src/conductor/client/http/models/unknown_field_set.py new file mode 100644 index 00000000..44f4a2cf --- /dev/null +++ b/src/conductor/client/http/models/unknown_field_set.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.unknown_field_set_adapter import \ + UnknownFieldSetAdapter + +UnknownFieldSet = UnknownFieldSetAdapter + +__all__ = ["UnknownFieldSet"] diff --git a/src/conductor/client/http/models/update_workflow_variables.py b/src/conductor/client/http/models/update_workflow_variables.py index c64480cd..c7e12dfd 100644 --- a/src/conductor/client/http/models/update_workflow_variables.py +++ b/src/conductor/client/http/models/update_workflow_variables.py @@ -1,41 +1,6 @@ -from dataclasses import dataclass, field -from typing import Optional, Dict, Any +from conductor.client.adapters.models.update_workflow_variables_adapter import \ + UpdateWorkflowVariablesAdapter +UpdateWorkflowVariables = UpdateWorkflowVariablesAdapter -@dataclass -class UpdateWorkflowVariables: - """UpdateWorkflowVariables model for updating workflow variables. - - Attributes: - workflow_id: The ID of the workflow to update - variables: Map of variable names to their values - append_array: Whether to append to arrays in existing variables - """ - workflow_id: Optional[str] = None - variables: Optional[Dict[str, Any]] = None - append_array: Optional[bool] = None - - # Define JSON mapping for serialization - swagger_types: dict = field(default_factory=lambda: { - 'workflow_id': 'str', - 'variables': 'dict(str, object)', - 'append_array': 'bool' - }) - - attribute_map: dict = field(default_factory=lambda: { - 'workflow_id': 'workflowId', - 'variables': 'variables', - 'append_array': 'appendArray' - }) - - def to_dict(self): - """Returns the model properties as a dict""" - return { - 'workflowId': self.workflow_id, - 'variables': self.variables, - 'appendArray': self.append_array - } - - def __repr__(self): - """Returns string representation of the model""" - return f"UpdateWorkflowVariables(workflow_id={self.workflow_id!r}, variables={self.variables!r}, append_array={self.append_array!r})" \ No newline at end of file +__all__ = ["UpdateWorkflowVariables"] diff --git a/src/conductor/client/http/models/upgrade_workflow_request.py b/src/conductor/client/http/models/upgrade_workflow_request.py new file mode 100644 index 00000000..576c9dab --- /dev/null +++ b/src/conductor/client/http/models/upgrade_workflow_request.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.upgrade_workflow_request_adapter import \ + UpgradeWorkflowRequestAdapter + +UpgradeWorkflowRequest = UpgradeWorkflowRequestAdapter + +__all__ = ["UpgradeWorkflowRequest"] diff --git a/src/conductor/client/http/models/upsert_group_request.py b/src/conductor/client/http/models/upsert_group_request.py index 13b6eb3c..05506d00 100644 --- a/src/conductor/client/http/models/upsert_group_request.py +++ b/src/conductor/client/http/models/upsert_group_request.py @@ -1,177 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, List, Optional, Any -from dataclasses import asdict +from conductor.client.adapters.models.upsert_group_request_adapter import \ + UpsertGroupRequestAdapter +UpsertGroupRequest = UpsertGroupRequestAdapter -@dataclass -class UpsertGroupRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'default_access': 'dict(str, list[str])', - 'description': 'str', - 'roles': 'list[str]' - } - - attribute_map = { - 'default_access': 'defaultAccess', - 'description': 'description', - 'roles': 'roles' - } - - description: InitVar[Optional[str]] = None - roles: InitVar[Optional[List[str]]] = None - default_access: InitVar[Optional[Dict[str, List[str]]]] = None - - _description: Optional[str] = field(default=None, init=False, repr=False) - _roles: Optional[List[str]] = field(default=None, init=False, repr=False) - _default_access: Optional[Dict[str, List[str]]] = field(default=None, init=False, repr=False) - - def __init__(self, description=None, roles=None, default_access=None): # noqa: E501 - """UpsertGroupRequest - a model defined in Swagger""" # noqa: E501 - self._description = None - self._roles = None - self._default_access = None - self.discriminator = None - self.description = description - if roles is not None: - self.roles = roles - if default_access is not None: - self.default_access = default_access - - def __post_init__(self, description, roles, default_access): - self.description = description - if roles is not None: - self.roles = roles - if default_access is not None: - self.default_access = default_access - - @property - def description(self): - """Gets the description of this UpsertGroupRequest. # noqa: E501 - - A general description of the group # noqa: E501 - - :return: The description of this UpsertGroupRequest. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this UpsertGroupRequest. - - A general description of the group # noqa: E501 - - :param description: The description of this UpsertGroupRequest. # noqa: E501 - :type: str - """ - self._description = description - - @property - def roles(self): - """Gets the roles of this UpsertGroupRequest. # noqa: E501 - - - :return: The roles of this UpsertGroupRequest. # noqa: E501 - :rtype: list[str] - """ - return self._roles - - @roles.setter - def roles(self, roles): - """Sets the roles of this UpsertGroupRequest. - - - :param roles: The roles of this UpsertGroupRequest. # noqa: E501 - :type: list[str] - """ - allowed_values = ["ADMIN", "USER", "WORKER", "METADATA_MANAGER", "WORKFLOW_MANAGER"] # noqa: E501 - if not set(roles).issubset(set(allowed_values)): - raise ValueError( - "Invalid values for `roles` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(roles) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._roles = roles - - @property - def default_access(self): - """Gets the default_access of this UpsertGroupRequest. # noqa: E501 - - A default Map> to share permissions, allowed target types: WORKFLOW_DEF, TASK_DEF # noqa: E501 - - :return: The default_access of this UpsertGroupRequest. # noqa: E501 - :rtype: dict(str, list[str]) - """ - return self._default_access - - @default_access.setter - def default_access(self, default_access): - """Sets the default_access of this UpsertGroupRequest. - - A default Map> to share permissions, allowed target types: WORKFLOW_DEF, TASK_DEF # noqa: E501 - - :param default_access: The default_access of this UpsertGroupRequest. # noqa: E501 - :type: dict(str, list[str]) - """ - self._default_access = default_access - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(UpsertGroupRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, UpsertGroupRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["UpsertGroupRequest"] diff --git a/src/conductor/client/http/models/upsert_user_request.py b/src/conductor/client/http/models/upsert_user_request.py index 9d455be0..5b334d80 100644 --- a/src/conductor/client/http/models/upsert_user_request.py +++ b/src/conductor/client/http/models/upsert_user_request.py @@ -1,186 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import List, Optional -from enum import Enum +from conductor.client.adapters.models.upsert_user_request_adapter import ( + RolesEnum, UpsertUserRequestAdapter) +UpsertUserRequest = UpsertUserRequestAdapter -class RolesEnum(str, Enum): - ADMIN = "ADMIN" - USER = "USER" - WORKER = "WORKER" - METADATA_MANAGER = "METADATA_MANAGER" - WORKFLOW_MANAGER = "WORKFLOW_MANAGER" - - -@dataclass -class UpsertUserRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - name: InitVar[Optional[str]] = None - roles: InitVar[Optional[List[str]]] = None - groups: InitVar[Optional[List[str]]] = None - - _name: str = field(default=None, init=False) - _roles: List[str] = field(default=None, init=False) - _groups: List[str] = field(default=None, init=False) - - swagger_types = { - 'name': 'str', - 'roles': 'list[str]', - 'groups': 'list[str]' - } - - attribute_map = { - 'name': 'name', - 'roles': 'roles', - 'groups': 'groups' - } - - def __init__(self, name=None, roles=None, groups=None): # noqa: E501 - """UpsertUserRequest - a model defined in Swagger""" # noqa: E501 - self._name = None - self._roles = None - self._groups = None - self.discriminator = None - self.name = name - if roles is not None: - self.roles = roles - if groups is not None: - self.groups = groups - - def __post_init__(self, name, roles, groups): - self.name = name - if roles is not None: - self.roles = roles - if groups is not None: - self.groups = groups - - @property - def name(self): - """Gets the name of this UpsertUserRequest. # noqa: E501 - - User's full name # noqa: E501 - - :return: The name of this UpsertUserRequest. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this UpsertUserRequest. - - User's full name # noqa: E501 - - :param name: The name of this UpsertUserRequest. # noqa: E501 - :type: str - """ - self._name = name - - @property - def roles(self): - """Gets the roles of this UpsertUserRequest. # noqa: E501 - - - :return: The roles of this UpsertUserRequest. # noqa: E501 - :rtype: list[str] - """ - return self._roles - - @roles.setter - def roles(self, roles): - """Sets the roles of this UpsertUserRequest. - - - :param roles: The roles of this UpsertUserRequest. # noqa: E501 - :type: list[str] - """ - allowed_values = ["ADMIN", "USER", "WORKER", "METADATA_MANAGER", "WORKFLOW_MANAGER"] # noqa: E501 - if not set(roles).issubset(set(allowed_values)): - raise ValueError( - "Invalid values for `roles` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(roles) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._roles = roles - - @property - def groups(self): - """Gets the groups of this UpsertUserRequest. # noqa: E501 - - Ids of the groups this user belongs to # noqa: E501 - - :return: The groups of this UpsertUserRequest. # noqa: E501 - :rtype: list[str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this UpsertUserRequest. - - Ids of the groups this user belongs to # noqa: E501 - - :param groups: The groups of this UpsertUserRequest. # noqa: E501 - :type: list[str] - """ - - self._groups = groups - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(UpsertUserRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, UpsertUserRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["UpsertUserRequest", "RolesEnum"] diff --git a/src/conductor/client/http/models/webhook_config.py b/src/conductor/client/http/models/webhook_config.py new file mode 100644 index 00000000..236a76bb --- /dev/null +++ b/src/conductor/client/http/models/webhook_config.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.webhook_config_adapter import \ + WebhookConfigAdapter + +WebhookConfig = WebhookConfigAdapter + +__all__ = ["WebhookConfig"] diff --git a/src/conductor/client/http/models/webhook_execution_history.py b/src/conductor/client/http/models/webhook_execution_history.py new file mode 100644 index 00000000..a7dee736 --- /dev/null +++ b/src/conductor/client/http/models/webhook_execution_history.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.webhook_execution_history_adapter import \ + WebhookExecutionHistoryAdapter + +WebhookExecutionHistory = WebhookExecutionHistoryAdapter + +__all__ = ["WebhookExecutionHistory"] diff --git a/src/conductor/client/http/models/workflow.py b/src/conductor/client/http/models/workflow.py index 6365774a..3dea834a 100644 --- a/src/conductor/client/http/models/workflow.py +++ b/src/conductor/client/http/models/workflow.py @@ -1,1111 +1,5 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, List, Optional, Set, Any, Union -from deprecated import deprecated +from conductor.client.adapters.models.workflow_adapter import WorkflowAdapter -from conductor.client.http.models import Task -from conductor.client.http.models.workflow_run import terminal_status, successful_status, running_status +Workflow = WorkflowAdapter - -@dataclass -class Workflow: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - owner_app: Optional[str] = field(default=None) - create_time: Optional[int] = field(default=None) - update_time: Optional[int] = field(default=None) - created_by: Optional[str] = field(default=None) - updated_by: Optional[str] = field(default=None) - status: Optional[str] = field(default=None) - end_time: Optional[int] = field(default=None) - workflow_id: Optional[str] = field(default=None) - parent_workflow_id: Optional[str] = field(default=None) - parent_workflow_task_id: Optional[str] = field(default=None) - tasks: Optional[List['Task']] = field(default=None) - input: Optional[Dict[str, Any]] = field(default=None) - output: Optional[Dict[str, Any]] = field(default=None) - correlation_id: Optional[str] = field(default=None) - re_run_from_workflow_id: Optional[str] = field(default=None) - reason_for_incompletion: Optional[str] = field(default=None) - event: Optional[str] = field(default=None) - task_to_domain: Optional[Dict[str, str]] = field(default=None) - failed_reference_task_names: Optional[Set[str]] = field(default=None) - workflow_definition: Optional['WorkflowDef'] = field(default=None) - external_input_payload_storage_path: Optional[str] = field(default=None) - external_output_payload_storage_path: Optional[str] = field(default=None) - priority: Optional[int] = field(default=None) - variables: Optional[Dict[str, Any]] = field(default=None) - last_retried_time: Optional[int] = field(default=None) - failed_task_names: Optional[Set[str]] = field(default=None) - history: Optional[List['Workflow']] = field(default=None) - idempotency_key: Optional[str] = field(default=None) - rate_limit_key: Optional[str] = field(default=None) - rate_limited: Optional[bool] = field(default=None) - - # Fields not in Java POJO but in Python model - start_time: Optional[int] = field(default=None) - workflow_name: Optional[str] = field(default=None) - workflow_version: Optional[int] = field(default=None) - - # Private backing fields for properties - _owner_app: Optional[str] = field(init=False, repr=False, default=None) - _create_time: Optional[int] = field(init=False, repr=False, default=None) - _update_time: Optional[int] = field(init=False, repr=False, default=None) - _created_by: Optional[str] = field(init=False, repr=False, default=None) - _updated_by: Optional[str] = field(init=False, repr=False, default=None) - _status: Optional[str] = field(init=False, repr=False, default=None) - _end_time: Optional[int] = field(init=False, repr=False, default=None) - _workflow_id: Optional[str] = field(init=False, repr=False, default=None) - _parent_workflow_id: Optional[str] = field(init=False, repr=False, default=None) - _parent_workflow_task_id: Optional[str] = field(init=False, repr=False, default=None) - _tasks: Optional[List['Task']] = field(init=False, repr=False, default=None) - _input: Optional[Dict[str, Any]] = field(init=False, repr=False, default=None) - _output: Optional[Dict[str, Any]] = field(init=False, repr=False, default=None) - _correlation_id: Optional[str] = field(init=False, repr=False, default=None) - _re_run_from_workflow_id: Optional[str] = field(init=False, repr=False, default=None) - _reason_for_incompletion: Optional[str] = field(init=False, repr=False, default=None) - _event: Optional[str] = field(init=False, repr=False, default=None) - _task_to_domain: Optional[Dict[str, str]] = field(init=False, repr=False, default=None) - _failed_reference_task_names: Optional[Set[str]] = field(init=False, repr=False, default=None) - _workflow_definition: Optional['WorkflowDef'] = field(init=False, repr=False, default=None) - _external_input_payload_storage_path: Optional[str] = field(init=False, repr=False, default=None) - _external_output_payload_storage_path: Optional[str] = field(init=False, repr=False, default=None) - _priority: Optional[int] = field(init=False, repr=False, default=None) - _variables: Optional[Dict[str, Any]] = field(init=False, repr=False, default=None) - _last_retried_time: Optional[int] = field(init=False, repr=False, default=None) - _failed_task_names: Optional[Set[str]] = field(init=False, repr=False, default=None) - _history: Optional[List['Workflow']] = field(init=False, repr=False, default=None) - _idempotency_key: Optional[str] = field(init=False, repr=False, default=None) - _rate_limit_key: Optional[str] = field(init=False, repr=False, default=None) - _rate_limited: Optional[bool] = field(init=False, repr=False, default=None) - _start_time: Optional[int] = field(init=False, repr=False, default=None) - _workflow_name: Optional[str] = field(init=False, repr=False, default=None) - _workflow_version: Optional[int] = field(init=False, repr=False, default=None) - - swagger_types = { - 'owner_app': 'str', - 'create_time': 'int', - 'update_time': 'int', - 'created_by': 'str', - 'updated_by': 'str', - 'status': 'str', - 'end_time': 'int', - 'workflow_id': 'str', - 'parent_workflow_id': 'str', - 'parent_workflow_task_id': 'str', - 'tasks': 'list[Task]', - 'input': 'dict(str, object)', - 'output': 'dict(str, object)', - 'correlation_id': 'str', - 're_run_from_workflow_id': 'str', - 'reason_for_incompletion': 'str', - 'event': 'str', - 'task_to_domain': 'dict(str, str)', - 'failed_reference_task_names': 'set[str]', - 'workflow_definition': 'WorkflowDef', - 'external_input_payload_storage_path': 'str', - 'external_output_payload_storage_path': 'str', - 'priority': 'int', - 'variables': 'dict(str, object)', - 'last_retried_time': 'int', - 'failed_task_names': 'set[str]', - 'history': 'list[Workflow]', - 'idempotency_key': 'str', - 'rate_limit_key': 'str', - 'rate_limited': 'bool', - 'start_time': 'int', - 'workflow_name': 'str', - 'workflow_version': 'int' - } - - attribute_map = { - 'owner_app': 'ownerApp', - 'create_time': 'createTime', - 'update_time': 'updateTime', - 'created_by': 'createdBy', - 'updated_by': 'updatedBy', - 'status': 'status', - 'end_time': 'endTime', - 'workflow_id': 'workflowId', - 'parent_workflow_id': 'parentWorkflowId', - 'parent_workflow_task_id': 'parentWorkflowTaskId', - 'tasks': 'tasks', - 'input': 'input', - 'output': 'output', - 'correlation_id': 'correlationId', - 're_run_from_workflow_id': 'reRunFromWorkflowId', - 'reason_for_incompletion': 'reasonForIncompletion', - 'event': 'event', - 'task_to_domain': 'taskToDomain', - 'failed_reference_task_names': 'failedReferenceTaskNames', - 'workflow_definition': 'workflowDefinition', - 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', - 'external_output_payload_storage_path': 'externalOutputPayloadStoragePath', - 'priority': 'priority', - 'variables': 'variables', - 'last_retried_time': 'lastRetriedTime', - 'failed_task_names': 'failedTaskNames', - 'history': 'history', - 'idempotency_key': 'idempotencyKey', - 'rate_limit_key': 'rateLimitKey', - 'rate_limited': 'rateLimited', - 'start_time': 'startTime', - 'workflow_name': 'workflowName', - 'workflow_version': 'workflowVersion' - } - - def __init__(self, owner_app=None, create_time=None, update_time=None, created_by=None, updated_by=None, - status=None, end_time=None, workflow_id=None, parent_workflow_id=None, parent_workflow_task_id=None, - tasks=None, input=None, output=None, correlation_id=None, re_run_from_workflow_id=None, - reason_for_incompletion=None, event=None, task_to_domain=None, failed_reference_task_names=None, - workflow_definition=None, external_input_payload_storage_path=None, - external_output_payload_storage_path=None, priority=None, variables=None, last_retried_time=None, - start_time=None, workflow_name=None, workflow_version=None, failed_task_names=None, history=None, - idempotency_key=None, rate_limit_key=None, rate_limited=None): # noqa: E501 - """Workflow - a model defined in Swagger""" # noqa: E501 - self._owner_app = None - self._create_time = None - self._update_time = None - self._created_by = None - self._updated_by = None - self._status = None - self._end_time = None - self._workflow_id = None - self._parent_workflow_id = None - self._parent_workflow_task_id = None - self._tasks = None - self._input = None - self._output = None - self._correlation_id = None - self._re_run_from_workflow_id = None - self._reason_for_incompletion = None - self._event = None - self._task_to_domain = None - self._failed_reference_task_names = None - self._workflow_definition = None - self._external_input_payload_storage_path = None - self._external_output_payload_storage_path = None - self._priority = None - self._variables = None - self._last_retried_time = None - self._failed_task_names = None - self._history = None - self._idempotency_key = None - self._rate_limit_key = None - self._rate_limited = None - self._start_time = None - self._workflow_name = None - self._workflow_version = None - self.discriminator = None - if owner_app is not None: - self.owner_app = owner_app - if create_time is not None: - self.create_time = create_time - if update_time is not None: - self.update_time = update_time - if created_by is not None: - self.created_by = created_by - if updated_by is not None: - self.updated_by = updated_by - if status is not None: - self.status = status - if end_time is not None: - self.end_time = end_time - if workflow_id is not None: - self.workflow_id = workflow_id - if parent_workflow_id is not None: - self.parent_workflow_id = parent_workflow_id - if parent_workflow_task_id is not None: - self.parent_workflow_task_id = parent_workflow_task_id - if tasks is not None: - self.tasks = tasks - if input is not None: - self.input = input - if output is not None: - self.output = output - if correlation_id is not None: - self.correlation_id = correlation_id - if re_run_from_workflow_id is not None: - self.re_run_from_workflow_id = re_run_from_workflow_id - if reason_for_incompletion is not None: - self.reason_for_incompletion = reason_for_incompletion - if event is not None: - self.event = event - if task_to_domain is not None: - self.task_to_domain = task_to_domain - if failed_reference_task_names is not None: - self.failed_reference_task_names = failed_reference_task_names - if workflow_definition is not None: - self.workflow_definition = workflow_definition - if external_input_payload_storage_path is not None: - self.external_input_payload_storage_path = external_input_payload_storage_path - if external_output_payload_storage_path is not None: - self.external_output_payload_storage_path = external_output_payload_storage_path - if priority is not None: - self.priority = priority - if variables is not None: - self.variables = variables - if last_retried_time is not None: - self.last_retried_time = last_retried_time - if failed_task_names is not None: - self.failed_task_names = failed_task_names - if history is not None: - self.history = history - if idempotency_key is not None: - self.idempotency_key = idempotency_key - if rate_limit_key is not None: - self.rate_limit_key = rate_limit_key - if rate_limited is not None: - self.rate_limited = rate_limited - if start_time is not None: - self.start_time = start_time - if workflow_name is not None: - self.workflow_name = workflow_name - if workflow_version is not None: - self.workflow_version = workflow_version - - def __post_init__(self): - """Initialize fields after dataclass initialization""" - if self.owner_app is not None: - self._owner_app = self.owner_app - if self.create_time is not None: - self._create_time = self.create_time - if self.update_time is not None: - self._update_time = self.update_time - if self.created_by is not None: - self._created_by = self.created_by - if self.updated_by is not None: - self._updated_by = self.updated_by - if self.status is not None: - self._status = self.status - if self.end_time is not None: - self._end_time = self.end_time - if self.workflow_id is not None: - self._workflow_id = self.workflow_id - if self.parent_workflow_id is not None: - self._parent_workflow_id = self.parent_workflow_id - if self.parent_workflow_task_id is not None: - self._parent_workflow_task_id = self.parent_workflow_task_id - if self.tasks is not None: - self._tasks = self.tasks - if self.input is not None: - self._input = self.input - if self.output is not None: - self._output = self.output - if self.correlation_id is not None: - self._correlation_id = self.correlation_id - if self.re_run_from_workflow_id is not None: - self._re_run_from_workflow_id = self.re_run_from_workflow_id - if self.reason_for_incompletion is not None: - self._reason_for_incompletion = self.reason_for_incompletion - if self.event is not None: - self._event = self.event - if self.task_to_domain is not None: - self._task_to_domain = self.task_to_domain - if self.failed_reference_task_names is not None: - self._failed_reference_task_names = self.failed_reference_task_names - if self.workflow_definition is not None: - self._workflow_definition = self.workflow_definition - if self.external_input_payload_storage_path is not None: - self._external_input_payload_storage_path = self.external_input_payload_storage_path - if self.external_output_payload_storage_path is not None: - self._external_output_payload_storage_path = self.external_output_payload_storage_path - if self.priority is not None: - self._priority = self.priority - if self.variables is not None: - self._variables = self.variables - if self.last_retried_time is not None: - self._last_retried_time = self.last_retried_time - if self.failed_task_names is not None: - self._failed_task_names = self.failed_task_names - if self.history is not None: - self._history = self.history - if self.idempotency_key is not None: - self._idempotency_key = self.idempotency_key - if self.rate_limit_key is not None: - self._rate_limit_key = self.rate_limit_key - if self.rate_limited is not None: - self._rate_limited = self.rate_limited - if self.start_time is not None: - self._start_time = self.start_time - if self.workflow_name is not None: - self._workflow_name = self.workflow_name - if self.workflow_version is not None: - self._workflow_version = self.workflow_version - - @property - def owner_app(self): - """Gets the owner_app of this Workflow. # noqa: E501 - - - :return: The owner_app of this Workflow. # noqa: E501 - :rtype: str - """ - return self._owner_app - - @owner_app.setter - def owner_app(self, owner_app): - """Sets the owner_app of this Workflow. - - - :param owner_app: The owner_app of this Workflow. # noqa: E501 - :type: str - """ - - self._owner_app = owner_app - - @property - def create_time(self): - """Gets the create_time of this Workflow. # noqa: E501 - - - :return: The create_time of this Workflow. # noqa: E501 - :rtype: int - """ - return self._create_time - - @create_time.setter - def create_time(self, create_time): - """Sets the create_time of this Workflow. - - - :param create_time: The create_time of this Workflow. # noqa: E501 - :type: int - """ - - self._create_time = create_time - - @property - def update_time(self): - """Gets the update_time of this Workflow. # noqa: E501 - - - :return: The update_time of this Workflow. # noqa: E501 - :rtype: int - """ - return self._update_time - - @update_time.setter - def update_time(self, update_time): - """Sets the update_time of this Workflow. - - - :param update_time: The update_time of this Workflow. # noqa: E501 - :type: int - """ - - self._update_time = update_time - - @property - def created_by(self): - """Gets the created_by of this Workflow. # noqa: E501 - - - :return: The created_by of this Workflow. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this Workflow. - - - :param created_by: The created_by of this Workflow. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - def updated_by(self): - """Gets the updated_by of this Workflow. # noqa: E501 - - - :return: The updated_by of this Workflow. # noqa: E501 - :rtype: str - """ - return self._updated_by - - @updated_by.setter - def updated_by(self, updated_by): - """Sets the updated_by of this Workflow. - - - :param updated_by: The updated_by of this Workflow. # noqa: E501 - :type: str - """ - - self._updated_by = updated_by - - @property - def status(self) -> str: - """Gets the status of this Workflow. # noqa: E501 - - - :return: The status of this Workflow. # noqa: E501 - :rtype: str - """ - return self._status - - def is_completed(self) -> bool: - """Checks if the workflow has completed - :return: True if the workflow status is COMPLETED, FAILED or TERMINATED - """ - return self.status in terminal_status - - def is_successful(self) -> bool: - """Checks if the workflow has completed in successful state (ie COMPLETED) - :return: True if the workflow status is COMPLETED - """ - return self._status in successful_status - - def is_running(self) -> bool: - return self.status in running_status - - @status.setter - def status(self, status): - """Sets the status of this Workflow. - - - :param status: The status of this Workflow. # noqa: E501 - :type: str - """ - allowed_values = ["RUNNING", "COMPLETED", "FAILED", "TIMED_OUT", "TERMINATED", "PAUSED"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def end_time(self): - """Gets the end_time of this Workflow. # noqa: E501 - - - :return: The end_time of this Workflow. # noqa: E501 - :rtype: int - """ - return self._end_time - - @end_time.setter - def end_time(self, end_time): - """Sets the end_time of this Workflow. - - - :param end_time: The end_time of this Workflow. # noqa: E501 - :type: int - """ - - self._end_time = end_time - - @property - def workflow_id(self): - """Gets the workflow_id of this Workflow. # noqa: E501 - - - :return: The workflow_id of this Workflow. # noqa: E501 - :rtype: str - """ - return self._workflow_id - - @workflow_id.setter - def workflow_id(self, workflow_id): - """Sets the workflow_id of this Workflow. - - - :param workflow_id: The workflow_id of this Workflow. # noqa: E501 - :type: str - """ - - self._workflow_id = workflow_id - - @property - def parent_workflow_id(self): - """Gets the parent_workflow_id of this Workflow. # noqa: E501 - - - :return: The parent_workflow_id of this Workflow. # noqa: E501 - :rtype: str - """ - return self._parent_workflow_id - - @parent_workflow_id.setter - def parent_workflow_id(self, parent_workflow_id): - """Sets the parent_workflow_id of this Workflow. - - - :param parent_workflow_id: The parent_workflow_id of this Workflow. # noqa: E501 - :type: str - """ - - self._parent_workflow_id = parent_workflow_id - - @property - def parent_workflow_task_id(self): - """Gets the parent_workflow_task_id of this Workflow. # noqa: E501 - - - :return: The parent_workflow_task_id of this Workflow. # noqa: E501 - :rtype: str - """ - return self._parent_workflow_task_id - - @parent_workflow_task_id.setter - def parent_workflow_task_id(self, parent_workflow_task_id): - """Sets the parent_workflow_task_id of this Workflow. - - - :param parent_workflow_task_id: The parent_workflow_task_id of this Workflow. # noqa: E501 - :type: str - """ - - self._parent_workflow_task_id = parent_workflow_task_id - - @property - def tasks(self): - """Gets the tasks of this Workflow. # noqa: E501 - - - :return: The tasks of this Workflow. # noqa: E501 - :rtype: list[Task] - """ - return self._tasks - - @tasks.setter - def tasks(self, tasks): - """Sets the tasks of this Workflow. - - - :param tasks: The tasks of this Workflow. # noqa: E501 - :type: list[Task] - """ - - self._tasks = tasks - - @property - def input(self): - """Gets the input of this Workflow. # noqa: E501 - - - :return: The input of this Workflow. # noqa: E501 - :rtype: dict(str, object) - """ - return self._input - - @input.setter - def input(self, input): - """Sets the input of this Workflow. - - - :param input: The input of this Workflow. # noqa: E501 - :type: dict(str, object) - """ - - self._input = input - - @property - def output(self): - """Gets the output of this Workflow. # noqa: E501 - - - :return: The output of this Workflow. # noqa: E501 - :rtype: dict(str, object) - """ - return self._output - - @output.setter - def output(self, output): - """Sets the output of this Workflow. - - - :param output: The output of this Workflow. # noqa: E501 - :type: dict(str, object) - """ - - self._output = output - - @property - def correlation_id(self): - """Gets the correlation_id of this Workflow. # noqa: E501 - - - :return: The correlation_id of this Workflow. # noqa: E501 - :rtype: str - """ - return self._correlation_id - - @correlation_id.setter - def correlation_id(self, correlation_id): - """Sets the correlation_id of this Workflow. - - - :param correlation_id: The correlation_id of this Workflow. # noqa: E501 - :type: str - """ - - self._correlation_id = correlation_id - - @property - def re_run_from_workflow_id(self): - """Gets the re_run_from_workflow_id of this Workflow. # noqa: E501 - - - :return: The re_run_from_workflow_id of this Workflow. # noqa: E501 - :rtype: str - """ - return self._re_run_from_workflow_id - - @re_run_from_workflow_id.setter - def re_run_from_workflow_id(self, re_run_from_workflow_id): - """Sets the re_run_from_workflow_id of this Workflow. - - - :param re_run_from_workflow_id: The re_run_from_workflow_id of this Workflow. # noqa: E501 - :type: str - """ - - self._re_run_from_workflow_id = re_run_from_workflow_id - - @property - def reason_for_incompletion(self): - """Gets the reason_for_incompletion of this Workflow. # noqa: E501 - - - :return: The reason_for_incompletion of this Workflow. # noqa: E501 - :rtype: str - """ - return self._reason_for_incompletion - - @reason_for_incompletion.setter - def reason_for_incompletion(self, reason_for_incompletion): - """Sets the reason_for_incompletion of this Workflow. - - - :param reason_for_incompletion: The reason_for_incompletion of this Workflow. # noqa: E501 - :type: str - """ - - self._reason_for_incompletion = reason_for_incompletion - - @property - def event(self): - """Gets the event of this Workflow. # noqa: E501 - - - :return: The event of this Workflow. # noqa: E501 - :rtype: str - """ - return self._event - - @event.setter - def event(self, event): - """Sets the event of this Workflow. - - - :param event: The event of this Workflow. # noqa: E501 - :type: str - """ - - self._event = event - - @property - def task_to_domain(self): - """Gets the task_to_domain of this Workflow. # noqa: E501 - - - :return: The task_to_domain of this Workflow. # noqa: E501 - :rtype: dict(str, str) - """ - return self._task_to_domain - - @task_to_domain.setter - def task_to_domain(self, task_to_domain): - """Sets the task_to_domain of this Workflow. - - - :param task_to_domain: The task_to_domain of this Workflow. # noqa: E501 - :type: dict(str, str) - """ - - self._task_to_domain = task_to_domain - - @property - def failed_reference_task_names(self): - """Gets the failed_reference_task_names of this Workflow. # noqa: E501 - - - :return: The failed_reference_task_names of this Workflow. # noqa: E501 - :rtype: set[str] - """ - return self._failed_reference_task_names - - @failed_reference_task_names.setter - def failed_reference_task_names(self, failed_reference_task_names): - """Sets the failed_reference_task_names of this Workflow. - - - :param failed_reference_task_names: The failed_reference_task_names of this Workflow. # noqa: E501 - :type: set[str] - """ - - self._failed_reference_task_names = failed_reference_task_names - - @property - def workflow_definition(self): - """Gets the workflow_definition of this Workflow. # noqa: E501 - - - :return: The workflow_definition of this Workflow. # noqa: E501 - :rtype: WorkflowDef - """ - return self._workflow_definition - - @workflow_definition.setter - def workflow_definition(self, workflow_definition): - """Sets the workflow_definition of this Workflow. - - - :param workflow_definition: The workflow_definition of this Workflow. # noqa: E501 - :type: WorkflowDef - """ - - self._workflow_definition = workflow_definition - - @property - def external_input_payload_storage_path(self): - """Gets the external_input_payload_storage_path of this Workflow. # noqa: E501 - - - :return: The external_input_payload_storage_path of this Workflow. # noqa: E501 - :rtype: str - """ - return self._external_input_payload_storage_path - - @external_input_payload_storage_path.setter - def external_input_payload_storage_path(self, external_input_payload_storage_path): - """Sets the external_input_payload_storage_path of this Workflow. - - - :param external_input_payload_storage_path: The external_input_payload_storage_path of this Workflow. # noqa: E501 - :type: str - """ - - self._external_input_payload_storage_path = external_input_payload_storage_path - - @property - def external_output_payload_storage_path(self): - """Gets the external_output_payload_storage_path of this Workflow. # noqa: E501 - - - :return: The external_output_payload_storage_path of this Workflow. # noqa: E501 - :rtype: str - """ - return self._external_output_payload_storage_path - - @external_output_payload_storage_path.setter - def external_output_payload_storage_path(self, external_output_payload_storage_path): - """Sets the external_output_payload_storage_path of this Workflow. - - - :param external_output_payload_storage_path: The external_output_payload_storage_path of this Workflow. # noqa: E501 - :type: str - """ - - self._external_output_payload_storage_path = external_output_payload_storage_path - - @property - def priority(self): - """Gets the priority of this Workflow. # noqa: E501 - - - :return: The priority of this Workflow. # noqa: E501 - :rtype: int - """ - return self._priority - - @priority.setter - def priority(self, priority): - """Sets the priority of this Workflow. - - - :param priority: The priority of this Workflow. # noqa: E501 - :type: int - """ - - self._priority = priority - - @property - def variables(self): - """Gets the variables of this Workflow. # noqa: E501 - - - :return: The variables of this Workflow. # noqa: E501 - :rtype: dict(str, object) - """ - return self._variables - - @variables.setter - def variables(self, variables): - """Sets the variables of this Workflow. - - - :param variables: The variables of this Workflow. # noqa: E501 - :type: dict(str, object) - """ - - self._variables = variables - - @property - def last_retried_time(self): - """Gets the last_retried_time of this Workflow. # noqa: E501 - - - :return: The last_retried_time of this Workflow. # noqa: E501 - :rtype: int - """ - return self._last_retried_time - - @last_retried_time.setter - def last_retried_time(self, last_retried_time): - """Sets the last_retried_time of this Workflow. - - - :param last_retried_time: The last_retried_time of this Workflow. # noqa: E501 - :type: int - """ - - self._last_retried_time = last_retried_time - - @property - def failed_task_names(self): - """Gets the failed_task_names of this Workflow. # noqa: E501 - - - :return: The failed_task_names of this Workflow. # noqa: E501 - :rtype: set[str] - """ - return self._failed_task_names - - @failed_task_names.setter - def failed_task_names(self, failed_task_names): - """Sets the failed_task_names of this Workflow. - - - :param failed_task_names: The failed_task_names of this Workflow. # noqa: E501 - :type: set[str] - """ - - self._failed_task_names = failed_task_names - - @property - def history(self): - """Gets the history of this Workflow. # noqa: E501 - - - :return: The history of this Workflow. # noqa: E501 - :rtype: list[Workflow] - """ - return self._history - - @history.setter - def history(self, history): - """Sets the history of this Workflow. - - - :param history: The history of this Workflow. # noqa: E501 - :type: list[Workflow] - """ - - self._history = history - - @property - def idempotency_key(self): - """Gets the idempotency_key of this Workflow. # noqa: E501 - - - :return: The idempotency_key of this Workflow. # noqa: E501 - :rtype: str - """ - return self._idempotency_key - - @idempotency_key.setter - def idempotency_key(self, idempotency_key): - """Sets the idempotency_key of this Workflow. - - - :param idempotency_key: The idempotency_key of this Workflow. # noqa: E501 - :type: str - """ - - self._idempotency_key = idempotency_key - - @property - def rate_limit_key(self): - """Gets the rate_limit_key of this Workflow. # noqa: E501 - - - :return: The rate_limit_key of this Workflow. # noqa: E501 - :rtype: str - """ - return self._rate_limit_key - - @rate_limit_key.setter - def rate_limit_key(self, rate_limit_key): - """Sets the rate_limit_key of this Workflow. - - - :param rate_limit_key: The rate_limit_key of this Workflow. # noqa: E501 - :type: str - """ - - self._rate_limit_key = rate_limit_key - - @property - def rate_limited(self): - return self._rate_limited - @rate_limited.setter - def rate_limited(self, rate_limited): - self._rate_limited = rate_limited - - @property - def start_time(self): - """Gets the start_time of this Workflow. # noqa: E501 - - - :return: The start_time of this Workflow. # noqa: E501 - :rtype: int - """ - return self._start_time - - @start_time.setter - def start_time(self, start_time): - """Sets the start_time of this Workflow. - - - :param start_time: The start_time of this Workflow. # noqa: E501 - :type: int - """ - - self._start_time = start_time - - @property - def workflow_name(self): - """Gets the workflow_name of this Workflow. # noqa: E501 - - - :return: The workflow_name of this Workflow. # noqa: E501 - :rtype: str - """ - return self._workflow_name - - @workflow_name.setter - def workflow_name(self, workflow_name): - """Sets the workflow_name of this Workflow. - - - :param workflow_name: The workflow_name of this Workflow. # noqa: E501 - :type: str - """ - - self._workflow_name = workflow_name - - @property - def workflow_version(self): - """Gets the workflow_version of this Workflow. # noqa: E501 - - - :return: The workflow_version of this Workflow. # noqa: E501 - :rtype: int - """ - return self._workflow_version - - @workflow_version.setter - def workflow_version(self, workflow_version): - """Sets the workflow_version of this Workflow. - - - :param workflow_version: The workflow_version of this Workflow. # noqa: E501 - :type: int - """ - - self._workflow_version = workflow_version - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Workflow, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Workflow): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - @property - def current_task(self) -> Task: - current = None - for task in self.tasks: - if task.status == 'SCHEDULED' or task.status == 'IN_PROGRESS': - current = task - return current - - def get_task(self, name: str = None, task_reference_name: str = None) -> Task: - if name is None and task_reference_name is None: - raise Exception('ONLY one of name or task_reference_name MUST be provided. None were provided') - if name is not None and not task_reference_name is None: - raise Exception('ONLY one of name or task_reference_name MUST be provided. both were provided') - - current = None - for task in self.tasks: - if task.task_def_name == name or task.workflow_task.task_reference_name == task_reference_name: - current = task - return current \ No newline at end of file +__all__ = ["Workflow"] diff --git a/src/conductor/client/http/models/workflow_def.py b/src/conductor/client/http/models/workflow_def.py index c974b3f6..aedd3569 100644 --- a/src/conductor/client/http/models/workflow_def.py +++ b/src/conductor/client/http/models/workflow_def.py @@ -1,875 +1,6 @@ -import json -import pprint -import re # noqa: F401 -from dataclasses import dataclass, field, InitVar, fields, Field -from typing import List, Dict, Any, Optional, Union -import dataclasses +from conductor.client.adapters.models.workflow_def_adapter import ( + WorkflowDefAdapter, to_workflow_def) -import six -from deprecated import deprecated +WorkflowDef = WorkflowDefAdapter -from conductor.client.helpers.helper import ObjectMapper -from conductor.client.http.models import WorkflowTask, RateLimit -from conductor.client.http.models.schema_def import SchemaDef # Direct import to break circular dependency - -object_mapper = ObjectMapper() - - -@dataclass -class WorkflowDef: - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _name: str = field(default=None) - _description: str = field(default=None) - _version: int = field(default=None) - _tasks: List[WorkflowTask] = field(default=None) - _input_parameters: List[str] = field(default=None) - _output_parameters: Dict[str, Any] = field(default=None) - _failure_workflow: str = field(default=None) - _schema_version: int = field(default=None) - _restartable: bool = field(default=None) - _workflow_status_listener_enabled: bool = field(default=None) - _workflow_status_listener_sink: str = field(default=None) - _owner_email: str = field(default=None) - _timeout_policy: str = field(default=None) - _timeout_seconds: int = field(default=None) - _variables: Dict[str, Any] = field(default=None) - _input_template: Dict[str, Any] = field(default=None) - _input_schema: SchemaDef = field(default=None) - _output_schema: SchemaDef = field(default=None) - _enforce_schema: bool = field(default=None) - _metadata: Dict[str, Any] = field(default=None) - _rate_limit_config: RateLimit = field(default=None) - - # Deprecated fields - _owner_app: str = field(default=None) - _create_time: int = field(default=None) - _update_time: int = field(default=None) - _created_by: str = field(default=None) - _updated_by: str = field(default=None) - - # For backward compatibility - discriminator: Any = field(default=None) - - # Init parameters - owner_app: InitVar[Optional[str]] = None - create_time: InitVar[Optional[int]] = None - update_time: InitVar[Optional[int]] = None - created_by: InitVar[Optional[str]] = None - updated_by: InitVar[Optional[str]] = None - name: InitVar[Optional[str]] = None - description: InitVar[Optional[str]] = None - version: InitVar[Optional[int]] = None - tasks: InitVar[Optional[List[WorkflowTask]]] = None - input_parameters: InitVar[Optional[List[str]]] = None - output_parameters: InitVar[Optional[Dict[str, Any]]] = None - failure_workflow: InitVar[Optional[str]] = None - schema_version: InitVar[Optional[int]] = None - restartable: InitVar[Optional[bool]] = None - workflow_status_listener_enabled: InitVar[Optional[bool]] = None - workflow_status_listener_sink: InitVar[Optional[str]] = None - owner_email: InitVar[Optional[str]] = None - timeout_policy: InitVar[Optional[str]] = None - timeout_seconds: InitVar[Optional[int]] = None - variables: InitVar[Optional[Dict[str, Any]]] = None - input_template: InitVar[Optional[Dict[str, Any]]] = None - input_schema: InitVar[Optional[SchemaDef]] = None - output_schema: InitVar[Optional[SchemaDef]] = None - enforce_schema: InitVar[Optional[bool]] = False - metadata: InitVar[Optional[Dict[str, Any]]] = None - rate_limit_config: InitVar[Optional[RateLimit]] = None - - swagger_types = { - 'owner_app': 'str', - 'create_time': 'int', - 'update_time': 'int', - 'created_by': 'str', - 'updated_by': 'str', - 'name': 'str', - 'description': 'str', - 'version': 'int', - 'tasks': 'list[WorkflowTask]', - 'input_parameters': 'list[str]', - 'output_parameters': 'dict(str, object)', - 'failure_workflow': 'str', - 'schema_version': 'int', - 'restartable': 'bool', - 'workflow_status_listener_enabled': 'bool', - 'workflow_status_listener_sink': 'str', - 'owner_email': 'str', - 'timeout_policy': 'str', - 'timeout_seconds': 'int', - 'variables': 'dict(str, object)', - 'input_template': 'dict(str, object)', - 'input_schema': 'SchemaDef', - 'output_schema': 'SchemaDef', - 'enforce_schema': 'bool', - 'metadata': 'dict(str, object)', - 'rate_limit_config': 'RateLimitConfig' - } - - attribute_map = { - 'owner_app': 'ownerApp', - 'create_time': 'createTime', - 'update_time': 'updateTime', - 'created_by': 'createdBy', - 'updated_by': 'updatedBy', - 'name': 'name', - 'description': 'description', - 'version': 'version', - 'tasks': 'tasks', - 'input_parameters': 'inputParameters', - 'output_parameters': 'outputParameters', - 'failure_workflow': 'failureWorkflow', - 'schema_version': 'schemaVersion', - 'restartable': 'restartable', - 'workflow_status_listener_enabled': 'workflowStatusListenerEnabled', - 'workflow_status_listener_sink': 'workflowStatusListenerSink', - 'owner_email': 'ownerEmail', - 'timeout_policy': 'timeoutPolicy', - 'timeout_seconds': 'timeoutSeconds', - 'variables': 'variables', - 'input_template': 'inputTemplate', - 'input_schema': 'inputSchema', - 'output_schema': 'outputSchema', - 'enforce_schema': 'enforceSchema', - 'metadata': 'metadata', - 'rate_limit_config': 'rateLimitConfig' - } - - def __init__(self, owner_app=None, create_time=None, update_time=None, created_by=None, updated_by=None, name=None, - description=None, version=None, tasks : List[WorkflowTask] = None, input_parameters=None, output_parameters: dict = {}, - failure_workflow=None, schema_version=None, restartable=None, workflow_status_listener_enabled=None, - workflow_status_listener_sink=None, - owner_email=None, timeout_policy=None, timeout_seconds=None, variables=None, - input_template=None, - input_schema : 'SchemaDef' = None, output_schema : 'SchemaDef' = None, enforce_schema : bool = False, - metadata: Dict[str, Any] = None, rate_limit_config: RateLimit = None): # noqa: E501 - """WorkflowDef - a model defined in Swagger""" # noqa: E501 - self._owner_app = None - self._create_time = None - self._update_time = None - self._created_by = None - self._updated_by = None - self._name = None - self._description = None - self._version = None - self._tasks = tasks - self._input_parameters = None - self._output_parameters = None - self._failure_workflow = None - self._schema_version = None - self._restartable = None - self._workflow_status_listener_enabled = None - self._workflow_status_listener_sink = None - self._owner_email = None - self._timeout_policy = None - self._timeout_seconds = None - self._variables = None - self._input_template = None - self._metadata = None - self._rate_limit_config = None - self.discriminator = None - if owner_app is not None: - self.owner_app = owner_app - if create_time is not None: - self.create_time = create_time - if update_time is not None: - self.update_time = update_time - if created_by is not None: - self.created_by = created_by - if updated_by is not None: - self.updated_by = updated_by - self.name = name - if description is not None: - self.description = description - if version is not None: - self.version = version - self.tasks = tasks - if input_parameters is not None: - self.input_parameters = input_parameters - if output_parameters is not None: - self.output_parameters = output_parameters - if failure_workflow is not None: - self.failure_workflow = failure_workflow - if schema_version is not None: - self.schema_version = schema_version - if restartable is not None: - self.restartable = restartable - if workflow_status_listener_enabled is not None: - self._workflow_status_listener_enabled = workflow_status_listener_enabled - if workflow_status_listener_sink is not None: - self._workflow_status_listener_sink = workflow_status_listener_sink - if owner_email is not None: - self.owner_email = owner_email - if timeout_policy is not None: - self.timeout_policy = timeout_policy - self.timeout_seconds = timeout_seconds - if variables is not None: - self.variables = variables - if input_template is not None: - self.input_template = input_template - self._input_schema = input_schema - self._output_schema = output_schema - self._enforce_schema = enforce_schema - if metadata is not None: - self.metadata = metadata - if rate_limit_config is not None: - self.rate_limit_config = rate_limit_config - - def __post_init__(self, owner_app, create_time, update_time, created_by, updated_by, name, description, version, - tasks, input_parameters, output_parameters, failure_workflow, schema_version, restartable, - workflow_status_listener_enabled, workflow_status_listener_sink, owner_email, timeout_policy, - timeout_seconds, variables, input_template, input_schema, output_schema, enforce_schema, - metadata, rate_limit_config): - if owner_app is not None: - self.owner_app = owner_app - if create_time is not None: - self.create_time = create_time - if update_time is not None: - self.update_time = update_time - if created_by is not None: - self.created_by = created_by - if updated_by is not None: - self.updated_by = updated_by - if name is not None: - self.name = name - if description is not None: - self.description = description - if version is not None: - self.version = version - if tasks is not None: - self.tasks = tasks - if input_parameters is not None: - self.input_parameters = input_parameters - if output_parameters is not None: - self.output_parameters = output_parameters - if failure_workflow is not None: - self.failure_workflow = failure_workflow - if schema_version is not None: - self.schema_version = schema_version - if restartable is not None: - self.restartable = restartable - if workflow_status_listener_enabled is not None: - self.workflow_status_listener_enabled = workflow_status_listener_enabled - if workflow_status_listener_sink is not None: - self.workflow_status_listener_sink = workflow_status_listener_sink - if owner_email is not None: - self.owner_email = owner_email - if timeout_policy is not None: - self.timeout_policy = timeout_policy - if timeout_seconds is not None: - self.timeout_seconds = timeout_seconds - if variables is not None: - self.variables = variables - if input_template is not None: - self.input_template = input_template - if input_schema is not None: - self.input_schema = input_schema - if output_schema is not None: - self.output_schema = output_schema - if enforce_schema is not None: - self.enforce_schema = enforce_schema - if metadata is not None: - self.metadata = metadata - if rate_limit_config is not None: - self.rate_limit_config = rate_limit_config - - @property - @deprecated("This field is deprecated and will be removed in a future version") - def owner_app(self): - """Gets the owner_app of this WorkflowDef. # noqa: E501 - - - :return: The owner_app of this WorkflowDef. # noqa: E501 - :rtype: str - """ - return self._owner_app - - @owner_app.setter - @deprecated("This field is deprecated and will be removed in a future version") - def owner_app(self, owner_app): - """Sets the owner_app of this WorkflowDef. - - - :param owner_app: The owner_app of this WorkflowDef. # noqa: E501 - :type: str - """ - - self._owner_app = owner_app - - @property - @deprecated("This field is deprecated and will be removed in a future version") - def create_time(self): - """Gets the create_time of this WorkflowDef. # noqa: E501 - - - :return: The create_time of this WorkflowDef. # noqa: E501 - :rtype: int - """ - return self._create_time - - @create_time.setter - @deprecated("This field is deprecated and will be removed in a future version") - def create_time(self, create_time): - """Sets the create_time of this WorkflowDef. - - - :param create_time: The create_time of this WorkflowDef. # noqa: E501 - :type: int - """ - - self._create_time = create_time - - @property - @deprecated("This field is deprecated and will be removed in a future version") - def update_time(self): - """Gets the update_time of this WorkflowDef. # noqa: E501 - - - :return: The update_time of this WorkflowDef. # noqa: E501 - :rtype: int - """ - return self._update_time - - @update_time.setter - @deprecated("This field is deprecated and will be removed in a future version") - def update_time(self, update_time): - """Sets the update_time of this WorkflowDef. - - - :param update_time: The update_time of this WorkflowDef. # noqa: E501 - :type: int - """ - - self._update_time = update_time - - @property - @deprecated("This field is deprecated and will be removed in a future version") - def created_by(self): - """Gets the created_by of this WorkflowDef. # noqa: E501 - - - :return: The created_by of this WorkflowDef. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - @deprecated("This field is deprecated and will be removed in a future version") - def created_by(self, created_by): - """Sets the created_by of this WorkflowDef. - - - :param created_by: The created_by of this WorkflowDef. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - @deprecated("This field is deprecated and will be removed in a future version") - def updated_by(self): - """Gets the updated_by of this WorkflowDef. # noqa: E501 - - - :return: The updated_by of this WorkflowDef. # noqa: E501 - :rtype: str - """ - return self._updated_by - - @updated_by.setter - @deprecated("This field is deprecated and will be removed in a future version") - def updated_by(self, updated_by): - """Sets the updated_by of this WorkflowDef. - - - :param updated_by: The updated_by of this WorkflowDef. # noqa: E501 - :type: str - """ - - self._updated_by = updated_by - - @property - def name(self): - """Gets the name of this WorkflowDef. # noqa: E501 - - - :return: The name of this WorkflowDef. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this WorkflowDef. - - - :param name: The name of this WorkflowDef. # noqa: E501 - :type: str - """ - self._name = name - - @property - def description(self): - """Gets the description of this WorkflowDef. # noqa: E501 - - - :return: The description of this WorkflowDef. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this WorkflowDef. - - - :param description: The description of this WorkflowDef. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def version(self): - """Gets the version of this WorkflowDef. # noqa: E501 - - - :return: The version of this WorkflowDef. # noqa: E501 - :rtype: int - """ - return self._version - - @version.setter - def version(self, version): - """Sets the version of this WorkflowDef. - - - :param version: The version of this WorkflowDef. # noqa: E501 - :type: int - """ - - self._version = version - - @property - def tasks(self): - """Gets the tasks of this WorkflowDef. # noqa: E501 - - - :return: The tasks of this WorkflowDef. # noqa: E501 - :rtype: list[WorkflowTask] - """ - if self._tasks is None: - self._tasks = [] - return self._tasks - - @tasks.setter - def tasks(self, tasks: List[WorkflowTask]): - """Sets the tasks of this WorkflowDef. - - - :param tasks: The tasks of this WorkflowDef. # noqa: E501 - :type: list[WorkflowTask] - """ - self._tasks = tasks - - @property - def input_parameters(self): - """Gets the input_parameters of this WorkflowDef. # noqa: E501 - - - :return: The input_parameters of this WorkflowDef. # noqa: E501 - :rtype: list[str] - """ - return self._input_parameters - - @input_parameters.setter - def input_parameters(self, input_parameters): - """Sets the input_parameters of this WorkflowDef. - - - :param input_parameters: The input_parameters of this WorkflowDef. # noqa: E501 - :type: list[str] - """ - - self._input_parameters = input_parameters - - @property - def output_parameters(self): - """Gets the output_parameters of this WorkflowDef. # noqa: E501 - - - :return: The output_parameters of this WorkflowDef. # noqa: E501 - :rtype: dict(str, object) - """ - return self._output_parameters - - @output_parameters.setter - def output_parameters(self, output_parameters): - """Sets the output_parameters of this WorkflowDef. - - - :param output_parameters: The output_parameters of this WorkflowDef. # noqa: E501 - :type: dict(str, object) - """ - - self._output_parameters = output_parameters - - @property - def failure_workflow(self): - """Gets the failure_workflow of this WorkflowDef. # noqa: E501 - - - :return: The failure_workflow of this WorkflowDef. # noqa: E501 - :rtype: str - """ - return self._failure_workflow - - @failure_workflow.setter - def failure_workflow(self, failure_workflow): - """Sets the failure_workflow of this WorkflowDef. - - - :param failure_workflow: The failure_workflow of this WorkflowDef. # noqa: E501 - :type: str - """ - - self._failure_workflow = failure_workflow - - @property - def schema_version(self): - """Gets the schema_version of this WorkflowDef. # noqa: E501 - - - :return: The schema_version of this WorkflowDef. # noqa: E501 - :rtype: int - """ - return self._schema_version - - @schema_version.setter - def schema_version(self, schema_version): - """Sets the schema_version of this WorkflowDef. - - - :param schema_version: The schema_version of this WorkflowDef. # noqa: E501 - :type: int - """ - - self._schema_version = schema_version - - @property - def restartable(self): - """Gets the restartable of this WorkflowDef. # noqa: E501 - - - :return: The restartable of this WorkflowDef. # noqa: E501 - :rtype: bool - """ - return self._restartable - - @restartable.setter - def restartable(self, restartable): - """Sets the restartable of this WorkflowDef. - - - :param restartable: The restartable of this WorkflowDef. # noqa: E501 - :type: bool - """ - - self._restartable = restartable - - @property - def workflow_status_listener_enabled(self): - """Gets the workflow_status_listener_enabled of this WorkflowDef. # noqa: E501 - - - :return: The workflow_status_listener_enabled of this WorkflowDef. # noqa: E501 - :rtype: bool - """ - return self._workflow_status_listener_enabled - - @workflow_status_listener_enabled.setter - def workflow_status_listener_enabled(self, workflow_status_listener_enabled): - """Sets the workflow_status_listener_enabled of this WorkflowDef. - - - :param workflow_status_listener_enabled: The workflow_status_listener_enabled of this WorkflowDef. # noqa: E501 - :type: bool - """ - - self._workflow_status_listener_enabled = workflow_status_listener_enabled - - @property - def workflow_status_listener_sink(self): - """Gets the workflow_status_listener_sink of this WorkflowDef. # noqa: E501 - - - :return: The workflow_status_listener_sink of this WorkflowDef. # noqa: E501 - :rtype: str - """ - return self._workflow_status_listener_sink - - @workflow_status_listener_sink.setter - def workflow_status_listener_sink(self, workflow_status_listener_sink): - """Sets the workflow_status_listener_sink of this WorkflowDef. - - - :param workflow_status_listener_sink: The workflow_status_listener_sink of this WorkflowDef. # noqa: E501 - :type: str - """ - self._workflow_status_listener_sink = workflow_status_listener_sink - - @property - def owner_email(self): - """Gets the owner_email of this WorkflowDef. # noqa: E501 - - - :return: The owner_email of this WorkflowDef. # noqa: E501 - :rtype: str - """ - return self._owner_email - - @owner_email.setter - def owner_email(self, owner_email): - """Sets the owner_email of this WorkflowDef. - - - :param owner_email: The owner_email of this WorkflowDef. # noqa: E501 - :type: str - """ - - self._owner_email = owner_email - - @property - def timeout_policy(self): - """Gets the timeout_policy of this WorkflowDef. # noqa: E501 - - - :return: The timeout_policy of this WorkflowDef. # noqa: E501 - :rtype: str - """ - return self._timeout_policy - - @timeout_policy.setter - def timeout_policy(self, timeout_policy): - """Sets the timeout_policy of this WorkflowDef. - - - :param timeout_policy: The timeout_policy of this WorkflowDef. # noqa: E501 - :type: str - """ - allowed_values = ["TIME_OUT_WF", "ALERT_ONLY"] # noqa: E501 - if timeout_policy not in allowed_values: - raise ValueError( - "Invalid value for `timeout_policy` ({0}), must be one of {1}" # noqa: E501 - .format(timeout_policy, allowed_values) - ) - - self._timeout_policy = timeout_policy - - @property - def timeout_seconds(self): - """Gets the timeout_seconds of this WorkflowDef. # noqa: E501 - - - :return: The timeout_seconds of this WorkflowDef. # noqa: E501 - :rtype: int - """ - return self._timeout_seconds - - @timeout_seconds.setter - def timeout_seconds(self, timeout_seconds): - """Sets the timeout_seconds of this WorkflowDef. - - - :param timeout_seconds: The timeout_seconds of this WorkflowDef. # noqa: E501 - :type: int - """ - self._timeout_seconds = timeout_seconds - - @property - def variables(self): - """Gets the variables of this WorkflowDef. # noqa: E501 - - - :return: The variables of this WorkflowDef. # noqa: E501 - :rtype: dict(str, object) - """ - return self._variables - - @variables.setter - def variables(self, variables): - """Sets the variables of this WorkflowDef. - - - :param variables: The variables of this WorkflowDef. # noqa: E501 - :type: dict(str, object) - """ - - self._variables = variables - - @property - def input_template(self): - """Gets the input_template of this WorkflowDef. # noqa: E501 - - - :return: The input_template of this WorkflowDef. # noqa: E501 - :rtype: dict(str, object) - """ - return self._input_template - - @input_template.setter - def input_template(self, input_template): - """Sets the input_template of this WorkflowDef. - - - :param input_template: The input_template of this WorkflowDef. # noqa: E501 - :type: dict(str, object) - """ - - self._input_template = input_template - - @property - def input_schema(self) -> 'SchemaDef': - """Schema for the workflow input. - If enforce_schema is set then the input given to start this workflow MUST conform to this schema - If the validation fails, the start request will fail - """ - return self._input_schema - - @input_schema.setter - def input_schema(self, input_schema: 'SchemaDef'): - """Schema for the workflow input. - If enforce_schema is set then the input given to start this workflow MUST conform to this schema - If the validation fails, the start request will fail - """ - self._input_schema = input_schema - - @property - def output_schema(self) -> 'SchemaDef': - """Schema for the workflow output. - Note: The output is documentation purpose and not enforced given the workflow output can be non-deterministic - based on the branch execution logic (switch tasks etc) - """ - return self._output_schema - - @output_schema.setter - def output_schema(self, output_schema: 'SchemaDef'): - """Schema for the workflow output. - Note: The output is documentation purpose and not enforced given the workflow output can be non-deterministic - based on the branch execution logic (switch tasks etc) - """ - self._output_schema = output_schema - - @property - def enforce_schema(self) -> bool: - """If enforce_schema is set then the input given to start this workflow MUST conform to this schema - If the validation fails, the start request will fail - """ - return self._enforce_schema - - @enforce_schema.setter - def enforce_schema(self, enforce_schema: bool): - """If enforce_schema is set then the input given to start this workflow MUST conform to this schema - If the validation fails, the start request will fail - """ - self._enforce_schema = enforce_schema - - @property - def metadata(self) -> Dict[str, Any]: - """Gets the metadata of this WorkflowDef. # noqa: E501 - - :return: The metadata of this WorkflowDef. # noqa: E501 - :rtype: dict(str, object) - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata: Dict[str, Any]): - """Sets the metadata of this WorkflowDef. # noqa: E501 - - :param metadata: The metadata of this WorkflowDef. # noqa: E501 - :type: dict(str, object) - """ - self._metadata = metadata - - @property - def rate_limit_config(self) -> RateLimit: - """Gets the rate_limit_config of this WorkflowDef. # noqa: E501 - - :return: The rate_limit_config of this WorkflowDef. # noqa: E501 - :rtype: RateLimitConfig - """ - return self._rate_limit_config - - @rate_limit_config.setter - def rate_limit_config(self, rate_limit_config: RateLimit): - """Sets the rate_limit_config of this WorkflowDef. # noqa: E501 - - :param rate_limit_config: The rate_limit_config of this WorkflowDef. # noqa: E501 - :type: RateLimitConfig - """ - self._rate_limit_config = rate_limit_config - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkflowDef, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkflowDef): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def toJSON(self): - return object_mapper.to_json(obj=self) - - -def to_workflow_def(data: str = None, json_data: dict = None) -> WorkflowDef: - if json_data is not None: - return object_mapper.from_json(json_data, WorkflowDef) - if data is not None: - return object_mapper.from_json(json.loads(data), WorkflowDef) - raise Exception('missing data or json_data parameter') \ No newline at end of file +__all__ = ["WorkflowDef", "to_workflow_def"] diff --git a/src/conductor/client/http/models/workflow_run.py b/src/conductor/client/http/models/workflow_run.py index 072305cf..74b46beb 100644 --- a/src/conductor/client/http/models/workflow_run.py +++ b/src/conductor/client/http/models/workflow_run.py @@ -1,506 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, List, Optional, Any -from deprecated import deprecated +from conductor.client.adapters.models.workflow_run_adapter import \ + WorkflowRunAdapter -from conductor.client.http.models import Task +WorkflowRun = WorkflowRunAdapter -terminal_status = ('COMPLETED', 'FAILED', 'TIMED_OUT', 'TERMINATED') -successful_status = ('PAUSED', 'COMPLETED') -running_status = ('RUNNING', 'PAUSED') - - -@dataclass -class WorkflowRun: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _correlation_id: Optional[str] = field(default=None, init=False) - _create_time: Optional[int] = field(default=None, init=False) - _created_by: Optional[str] = field(default=None, init=False) - _input: Optional[Dict[str, Any]] = field(default=None, init=False) - _output: Optional[Dict[str, Any]] = field(default=None, init=False) - _priority: Optional[int] = field(default=None, init=False) - _request_id: Optional[str] = field(default=None, init=False) - _status: Optional[str] = field(default=None, init=False) - _tasks: Optional[List[Task]] = field(default=None, init=False) - _update_time: Optional[int] = field(default=None, init=False) - _variables: Optional[Dict[str, Any]] = field(default=None, init=False) - _workflow_id: Optional[str] = field(default=None, init=False) - _reason_for_incompletion: Optional[str] = field(default=None, init=False) - - correlation_id: InitVar[Optional[str]] = None - create_time: InitVar[Optional[int]] = None - created_by: InitVar[Optional[str]] = None - input: InitVar[Optional[Dict[str, Any]]] = None - output: InitVar[Optional[Dict[str, Any]]] = None - priority: InitVar[Optional[int]] = None - request_id: InitVar[Optional[str]] = None - status: InitVar[Optional[str]] = None - tasks: InitVar[Optional[List[Task]]] = None - update_time: InitVar[Optional[int]] = None - variables: InitVar[Optional[Dict[str, Any]]] = None - workflow_id: InitVar[Optional[str]] = None - reason_for_incompletion: InitVar[Optional[str]] = None - - swagger_types = { - 'correlation_id': 'str', - 'create_time': 'int', - 'created_by': 'str', - 'input': 'dict(str, object)', - 'output': 'dict(str, object)', - 'priority': 'int', - 'request_id': 'str', - 'status': 'str', - 'tasks': 'list[Task]', - 'update_time': 'int', - 'variables': 'dict(str, object)', - 'workflow_id': 'str' - } - - attribute_map = { - 'correlation_id': 'correlationId', - 'create_time': 'createTime', - 'created_by': 'createdBy', - 'input': 'input', - 'output': 'output', - 'priority': 'priority', - 'request_id': 'requestId', - 'status': 'status', - 'tasks': 'tasks', - 'update_time': 'updateTime', - 'variables': 'variables', - 'workflow_id': 'workflowId' - } - - def __init__(self, correlation_id=None, create_time=None, created_by=None, input=None, output=None, priority=None, - request_id=None, status=None, tasks=None, update_time=None, variables=None, workflow_id=None, - reason_for_incompletion: str = None): # noqa: E501 - """WorkflowRun - a model defined in Swagger""" # noqa: E501 - self._correlation_id = None - self._create_time = None - self._created_by = None - self._input = None - self._output = None - self._priority = None - self._request_id = None - self._status = None - self._tasks = None - self._update_time = None - self._variables = None - self._workflow_id = None - self.discriminator = None - if correlation_id is not None: - self.correlation_id = correlation_id - if create_time is not None: - self.create_time = create_time - if created_by is not None: - self.created_by = created_by - if input is not None: - self.input = input - if output is not None: - self.output = output - if priority is not None: - self.priority = priority - if request_id is not None: - self.request_id = request_id - if status is not None: - self.status = status - if tasks is not None: - self.tasks = tasks - if update_time is not None: - self.update_time = update_time - if variables is not None: - self.variables = variables - if workflow_id is not None: - self.workflow_id = workflow_id - self._reason_for_incompletion = reason_for_incompletion - - def __post_init__(self, correlation_id, create_time, created_by, input, output, priority, request_id, status, - tasks, update_time, variables, workflow_id, reason_for_incompletion): - if correlation_id is not None: - self.correlation_id = correlation_id - if create_time is not None: - self.create_time = create_time - if created_by is not None: - self.created_by = created_by - if input is not None: - self.input = input - if output is not None: - self.output = output - if priority is not None: - self.priority = priority - if request_id is not None: - self.request_id = request_id - if status is not None: - self.status = status - if tasks is not None: - self.tasks = tasks - if update_time is not None: - self.update_time = update_time - if variables is not None: - self.variables = variables - if workflow_id is not None: - self.workflow_id = workflow_id - if reason_for_incompletion is not None: - self._reason_for_incompletion = reason_for_incompletion - - @property - def correlation_id(self): - """Gets the correlation_id of this WorkflowRun. # noqa: E501 - - - :return: The correlation_id of this WorkflowRun. # noqa: E501 - :rtype: str - """ - return self._correlation_id - - @correlation_id.setter - def correlation_id(self, correlation_id): - """Sets the correlation_id of this WorkflowRun. - - - :param correlation_id: The correlation_id of this WorkflowRun. # noqa: E501 - :type: str - """ - - self._correlation_id = correlation_id - - @property - def create_time(self): - """Gets the create_time of this WorkflowRun. # noqa: E501 - - - :return: The create_time of this WorkflowRun. # noqa: E501 - :rtype: int - """ - return self._create_time - - @create_time.setter - def create_time(self, create_time): - """Sets the create_time of this WorkflowRun. - - - :param create_time: The create_time of this WorkflowRun. # noqa: E501 - :type: int - """ - - self._create_time = create_time - - @property - def created_by(self): - """Gets the created_by of this WorkflowRun. # noqa: E501 - - - :return: The created_by of this WorkflowRun. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this WorkflowRun. - - - :param created_by: The created_by of this WorkflowRun. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - def input(self): - """Gets the input of this WorkflowRun. # noqa: E501 - - - :return: The input of this WorkflowRun. # noqa: E501 - :rtype: dict(str, object) - """ - return self._input - - @input.setter - def input(self, input): - """Sets the input of this WorkflowRun. - - - :param input: The input of this WorkflowRun. # noqa: E501 - :type: dict(str, object) - """ - - self._input = input - - @property - def output(self): - """Gets the output of this WorkflowRun. # noqa: E501 - - - :return: The output of this WorkflowRun. # noqa: E501 - :rtype: dict(str, object) - """ - return self._output - - @output.setter - def output(self, output): - """Sets the output of this WorkflowRun. - - - :param output: The output of this WorkflowRun. # noqa: E501 - :type: dict(str, object) - """ - - self._output = output - - @property - def priority(self): - """Gets the priority of this WorkflowRun. # noqa: E501 - - - :return: The priority of this WorkflowRun. # noqa: E501 - :rtype: int - """ - return self._priority - - @priority.setter - def priority(self, priority): - """Sets the priority of this WorkflowRun. - - - :param priority: The priority of this WorkflowRun. # noqa: E501 - :type: int - """ - - self._priority = priority - - @property - def request_id(self): - """Gets the request_id of this WorkflowRun. # noqa: E501 - - - :return: The request_id of this WorkflowRun. # noqa: E501 - :rtype: str - """ - return self._request_id - - @request_id.setter - def request_id(self, request_id): - """Sets the request_id of this WorkflowRun. - - - :param request_id: The request_id of this WorkflowRun. # noqa: E501 - :type: str - """ - - self._request_id = request_id - - @property - def status(self): - """Gets the status of this WorkflowRun. # noqa: E501 - - - :return: The status of this WorkflowRun. # noqa: E501 - :rtype: str - """ - return self._status - - def is_completed(self) -> bool: - """Checks if the workflow has completed - :return: True if the workflow status is COMPLETED, FAILED or TERMINATED - """ - return self._status in terminal_status - - def is_successful(self) -> bool: - """Checks if the workflow has completed in successful state (ie COMPLETED) - :return: True if the workflow status is COMPLETED - """ - return self._status in successful_status - - @property - @deprecated - def reason_for_incompletion(self): - return self._reason_for_incompletion - - @status.setter - def status(self, status): - """Sets the status of this WorkflowRun. - - - :param status: The status of this WorkflowRun. # noqa: E501 - :type: str - """ - allowed_values = ["RUNNING", "COMPLETED", "FAILED", "TIMED_OUT", "TERMINATED", "PAUSED"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def is_successful(self) -> bool: - return self.status in successful_status - - def is_completed(self) -> bool: - return self.status in terminal_status - - def is_running(self) -> bool: - return self.status in running_status - - @property - def tasks(self): - """Gets the tasks of this WorkflowRun. # noqa: E501 - - - :return: The tasks of this WorkflowRun. # noqa: E501 - :rtype: list[Task] - """ - return self._tasks - - @tasks.setter - def tasks(self, tasks): - """Sets the tasks of this WorkflowRun. - - - :param tasks: The tasks of this WorkflowRun. # noqa: E501 - :type: list[Task] - """ - - self._tasks = tasks - - def get_task(self, name: str = None, task_reference_name: str = None) -> Task: - if name is None and task_reference_name is None: - raise Exception('ONLY one of name or task_reference_name MUST be provided. None were provided') - if name is not None and not task_reference_name is None: - raise Exception('ONLY one of name or task_reference_name MUST be provided. both were provided') - - current = None - for task in self.tasks: - if task.task_def_name == name or task.workflow_task.task_reference_name == task_reference_name: - current = task - return current - - @property - def update_time(self): - """Gets the update_time of this WorkflowRun. # noqa: E501 - - - :return: The update_time of this WorkflowRun. # noqa: E501 - :rtype: int - """ - return self._update_time - - @update_time.setter - def update_time(self, update_time): - """Sets the update_time of this WorkflowRun. - - - :param update_time: The update_time of this WorkflowRun. # noqa: E501 - :type: int - """ - - self._update_time = update_time - - @property - def variables(self): - """Gets the variables of this WorkflowRun. # noqa: E501 - - - :return: The variables of this WorkflowRun. # noqa: E501 - :rtype: dict(str, object) - """ - return self._variables - - @variables.setter - def variables(self, variables): - """Sets the variables of this WorkflowRun. - - - :param variables: The variables of this WorkflowRun. # noqa: E501 - :type: dict(str, object) - """ - - self._variables = variables - - @property - def workflow_id(self): - """Gets the workflow_id of this WorkflowRun. # noqa: E501 - - - :return: The workflow_id of this WorkflowRun. # noqa: E501 - :rtype: str - """ - return self._workflow_id - - @workflow_id.setter - def workflow_id(self, workflow_id): - """Sets the workflow_id of this WorkflowRun. - - - :param workflow_id: The workflow_id of this WorkflowRun. # noqa: E501 - :type: str - """ - - self._workflow_id = workflow_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkflowRun, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkflowRun): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - @property - def current_task(self) -> Task: - current = None - for task in self.tasks: - if task.status == 'SCHEDULED' or task.status == 'IN_PROGRESS': - current = task - return current \ No newline at end of file +__all__ = ["WorkflowRun"] diff --git a/src/conductor/client/http/models/workflow_schedule.py b/src/conductor/client/http/models/workflow_schedule.py index 0f7fe222..a300e7c4 100644 --- a/src/conductor/client/http/models/workflow_schedule.py +++ b/src/conductor/client/http/models/workflow_schedule.py @@ -1,536 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import List, Optional -from deprecated import deprecated +from conductor.client.adapters.models.workflow_schedule_adapter import \ + WorkflowScheduleAdapter +WorkflowSchedule = WorkflowScheduleAdapter -@dataclass -class WorkflowSchedule: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - name: Optional[str] = field(default=None) - cron_expression: Optional[str] = field(default=None) - run_catchup_schedule_instances: Optional[bool] = field(default=None) - paused: Optional[bool] = field(default=None) - start_workflow_request: Optional['StartWorkflowRequest'] = field(default=None) - schedule_start_time: Optional[int] = field(default=None) - schedule_end_time: Optional[int] = field(default=None) - create_time: Optional[int] = field(default=None) - updated_time: Optional[int] = field(default=None) - created_by: Optional[str] = field(default=None) - updated_by: Optional[str] = field(default=None) - zone_id: Optional[str] = field(default=None) - tags: Optional[List['Tag']] = field(default=None) - paused_reason: Optional[str] = field(default=None) - description: Optional[str] = field(default=None) - - # Private backing fields for properties - _name: Optional[str] = field(init=False, repr=False, default=None) - _cron_expression: Optional[str] = field(init=False, repr=False, default=None) - _run_catchup_schedule_instances: Optional[bool] = field(init=False, repr=False, default=None) - _paused: Optional[bool] = field(init=False, repr=False, default=None) - _start_workflow_request: Optional['StartWorkflowRequest'] = field(init=False, repr=False, default=None) - _schedule_start_time: Optional[int] = field(init=False, repr=False, default=None) - _schedule_end_time: Optional[int] = field(init=False, repr=False, default=None) - _create_time: Optional[int] = field(init=False, repr=False, default=None) - _updated_time: Optional[int] = field(init=False, repr=False, default=None) - _created_by: Optional[str] = field(init=False, repr=False, default=None) - _updated_by: Optional[str] = field(init=False, repr=False, default=None) - _zone_id: Optional[str] = field(init=False, repr=False, default=None) - _tags: Optional[List['Tag']] = field(init=False, repr=False, default=None) - _paused_reason: Optional[str] = field(init=False, repr=False, default=None) - _description: Optional[str] = field(init=False, repr=False, default=None) - - swagger_types = { - 'name': 'str', - 'cron_expression': 'str', - 'run_catchup_schedule_instances': 'bool', - 'paused': 'bool', - 'start_workflow_request': 'StartWorkflowRequest', - 'schedule_start_time': 'int', - 'schedule_end_time': 'int', - 'create_time': 'int', - 'updated_time': 'int', - 'created_by': 'str', - 'updated_by': 'str', - 'zone_id': 'str', - 'tags': 'list[Tag]', - 'paused_reason': 'str', - 'description': 'str' - } - - attribute_map = { - 'name': 'name', - 'cron_expression': 'cronExpression', - 'run_catchup_schedule_instances': 'runCatchupScheduleInstances', - 'paused': 'paused', - 'start_workflow_request': 'startWorkflowRequest', - 'schedule_start_time': 'scheduleStartTime', - 'schedule_end_time': 'scheduleEndTime', - 'create_time': 'createTime', - 'updated_time': 'updatedTime', - 'created_by': 'createdBy', - 'updated_by': 'updatedBy', - 'zone_id': 'zoneId', - 'tags': 'tags', - 'paused_reason': 'pausedReason', - 'description': 'description' - } - - def __init__(self, name=None, cron_expression=None, run_catchup_schedule_instances=None, paused=None, - start_workflow_request=None, schedule_start_time=None, schedule_end_time=None, create_time=None, - updated_time=None, created_by=None, updated_by=None, zone_id=None, tags=None, paused_reason=None, - description=None): # noqa: E501 - """WorkflowSchedule - a model defined in Swagger""" # noqa: E501 - self._name = None - self._cron_expression = None - self._run_catchup_schedule_instances = None - self._paused = None - self._start_workflow_request = None - self._schedule_start_time = None - self._schedule_end_time = None - self._create_time = None - self._updated_time = None - self._created_by = None - self._updated_by = None - self._zone_id = None - self._tags = None - self._paused_reason = None - self._description = None - self.discriminator = None - if name is not None: - self.name = name - if cron_expression is not None: - self.cron_expression = cron_expression - if run_catchup_schedule_instances is not None: - self.run_catchup_schedule_instances = run_catchup_schedule_instances - if paused is not None: - self.paused = paused - if start_workflow_request is not None: - self.start_workflow_request = start_workflow_request - if schedule_start_time is not None: - self.schedule_start_time = schedule_start_time - if schedule_end_time is not None: - self.schedule_end_time = schedule_end_time - if create_time is not None: - self.create_time = create_time - if updated_time is not None: - self.updated_time = updated_time - if created_by is not None: - self.created_by = created_by - if updated_by is not None: - self.updated_by = updated_by - if zone_id is not None: - self.zone_id = zone_id - if tags is not None: - self.tags = tags - if paused_reason is not None: - self.paused_reason = paused_reason - if description is not None: - self.description = description - - def __post_init__(self): - """Post initialization for dataclass""" - # Set the dataclass fields to the property backing fields - if self.name is not None: - self._name = self.name - if self.cron_expression is not None: - self._cron_expression = self.cron_expression - if self.run_catchup_schedule_instances is not None: - self._run_catchup_schedule_instances = self.run_catchup_schedule_instances - if self.paused is not None: - self._paused = self.paused - if self.start_workflow_request is not None: - self._start_workflow_request = self.start_workflow_request - if self.schedule_start_time is not None: - self._schedule_start_time = self.schedule_start_time - if self.schedule_end_time is not None: - self._schedule_end_time = self.schedule_end_time - if self.create_time is not None: - self._create_time = self.create_time - if self.updated_time is not None: - self._updated_time = self.updated_time - if self.created_by is not None: - self._created_by = self.created_by - if self.updated_by is not None: - self._updated_by = self.updated_by - if self.zone_id is not None: - self._zone_id = self.zone_id - if self.tags is not None: - self._tags = self.tags - if self.paused_reason is not None: - self._paused_reason = self.paused_reason - if self.description is not None: - self._description = self.description - - @property - def name(self): - """Gets the name of this WorkflowSchedule. # noqa: E501 - - - :return: The name of this WorkflowSchedule. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this WorkflowSchedule. - - - :param name: The name of this WorkflowSchedule. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def cron_expression(self): - """Gets the cron_expression of this WorkflowSchedule. # noqa: E501 - - - :return: The cron_expression of this WorkflowSchedule. # noqa: E501 - :rtype: str - """ - return self._cron_expression - - @cron_expression.setter - def cron_expression(self, cron_expression): - """Sets the cron_expression of this WorkflowSchedule. - - - :param cron_expression: The cron_expression of this WorkflowSchedule. # noqa: E501 - :type: str - """ - - self._cron_expression = cron_expression - - @property - def run_catchup_schedule_instances(self): - """Gets the run_catchup_schedule_instances of this WorkflowSchedule. # noqa: E501 - - - :return: The run_catchup_schedule_instances of this WorkflowSchedule. # noqa: E501 - :rtype: bool - """ - return self._run_catchup_schedule_instances - - @run_catchup_schedule_instances.setter - def run_catchup_schedule_instances(self, run_catchup_schedule_instances): - """Sets the run_catchup_schedule_instances of this WorkflowSchedule. - - - :param run_catchup_schedule_instances: The run_catchup_schedule_instances of this WorkflowSchedule. # noqa: E501 - :type: bool - """ - - self._run_catchup_schedule_instances = run_catchup_schedule_instances - - @property - def paused(self): - """Gets the paused of this WorkflowSchedule. # noqa: E501 - - - :return: The paused of this WorkflowSchedule. # noqa: E501 - :rtype: bool - """ - return self._paused - - @paused.setter - def paused(self, paused): - """Sets the paused of this WorkflowSchedule. - - - :param paused: The paused of this WorkflowSchedule. # noqa: E501 - :type: bool - """ - - self._paused = paused - - @property - def start_workflow_request(self): - """Gets the start_workflow_request of this WorkflowSchedule. # noqa: E501 - - - :return: The start_workflow_request of this WorkflowSchedule. # noqa: E501 - :rtype: StartWorkflowRequest - """ - return self._start_workflow_request - - @start_workflow_request.setter - def start_workflow_request(self, start_workflow_request): - """Sets the start_workflow_request of this WorkflowSchedule. - - - :param start_workflow_request: The start_workflow_request of this WorkflowSchedule. # noqa: E501 - :type: StartWorkflowRequest - """ - - self._start_workflow_request = start_workflow_request - - @property - def schedule_start_time(self): - """Gets the schedule_start_time of this WorkflowSchedule. # noqa: E501 - - - :return: The schedule_start_time of this WorkflowSchedule. # noqa: E501 - :rtype: int - """ - return self._schedule_start_time - - @schedule_start_time.setter - def schedule_start_time(self, schedule_start_time): - """Sets the schedule_start_time of this WorkflowSchedule. - - - :param schedule_start_time: The schedule_start_time of this WorkflowSchedule. # noqa: E501 - :type: int - """ - - self._schedule_start_time = schedule_start_time - - @property - def schedule_end_time(self): - """Gets the schedule_end_time of this WorkflowSchedule. # noqa: E501 - - - :return: The schedule_end_time of this WorkflowSchedule. # noqa: E501 - :rtype: int - """ - return self._schedule_end_time - - @schedule_end_time.setter - def schedule_end_time(self, schedule_end_time): - """Sets the schedule_end_time of this WorkflowSchedule. - - - :param schedule_end_time: The schedule_end_time of this WorkflowSchedule. # noqa: E501 - :type: int - """ - - self._schedule_end_time = schedule_end_time - - @property - def create_time(self): - """Gets the create_time of this WorkflowSchedule. # noqa: E501 - - - :return: The create_time of this WorkflowSchedule. # noqa: E501 - :rtype: int - """ - return self._create_time - - @create_time.setter - def create_time(self, create_time): - """Sets the create_time of this WorkflowSchedule. - - - :param create_time: The create_time of this WorkflowSchedule. # noqa: E501 - :type: int - """ - - self._create_time = create_time - - @property - def updated_time(self): - """Gets the updated_time of this WorkflowSchedule. # noqa: E501 - - - :return: The updated_time of this WorkflowSchedule. # noqa: E501 - :rtype: int - """ - return self._updated_time - - @updated_time.setter - def updated_time(self, updated_time): - """Sets the updated_time of this WorkflowSchedule. - - - :param updated_time: The updated_time of this WorkflowSchedule. # noqa: E501 - :type: int - """ - - self._updated_time = updated_time - - @property - def created_by(self): - """Gets the created_by of this WorkflowSchedule. # noqa: E501 - - - :return: The created_by of this WorkflowSchedule. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this WorkflowSchedule. - - - :param created_by: The created_by of this WorkflowSchedule. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - def updated_by(self): - """Gets the updated_by of this WorkflowSchedule. # noqa: E501 - - - :return: The updated_by of this WorkflowSchedule. # noqa: E501 - :rtype: str - """ - return self._updated_by - - @updated_by.setter - def updated_by(self, updated_by): - """Sets the updated_by of this WorkflowSchedule. - - - :param updated_by: The updated_by of this WorkflowSchedule. # noqa: E501 - :type: str - """ - - self._updated_by = updated_by - - @property - def zone_id(self): - """Gets the zone_id of this WorkflowSchedule. # noqa: E501 - - - :return: The zone_id of this WorkflowSchedule. # noqa: E501 - :rtype: str - """ - return self._zone_id - - @zone_id.setter - def zone_id(self, zone_id): - """Sets the zone_id of this WorkflowSchedule. - - - :param zone_id: The zone_id of this WorkflowSchedule. # noqa: E501 - :type: str - """ - - self._zone_id = zone_id - - @property - def tags(self): - """Gets the tags of this WorkflowSchedule. # noqa: E501 - - - :return: The tags of this WorkflowSchedule. # noqa: E501 - :rtype: List[Tag] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this WorkflowSchedule. - - - :param tags: The tags of this WorkflowSchedule. # noqa: E501 - :type: List[Tag] - """ - - self._tags = tags - - @property - def paused_reason(self): - """Gets the paused_reason of this WorkflowSchedule. # noqa: E501 - - - :return: The paused_reason of this WorkflowSchedule. # noqa: E501 - :rtype: str - """ - return self._paused_reason - - @paused_reason.setter - def paused_reason(self, paused_reason): - """Sets the paused_reason of this WorkflowSchedule. - - - :param paused_reason: The paused_reason of this WorkflowSchedule. # noqa: E501 - :type: str - """ - - self._paused_reason = paused_reason - - @property - def description(self): - """Gets the description of this WorkflowSchedule. # noqa: E501 - - - :return: The description of this WorkflowSchedule. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this WorkflowSchedule. - - - :param description: The description of this WorkflowSchedule. # noqa: E501 - :type: str - """ - - self._description = description - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkflowSchedule, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkflowSchedule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["WorkflowSchedule"] diff --git a/src/conductor/client/http/models/workflow_schedule_execution_model.py b/src/conductor/client/http/models/workflow_schedule_execution_model.py index 6667bb8d..62280bc8 100644 --- a/src/conductor/client/http/models/workflow_schedule_execution_model.py +++ b/src/conductor/client/http/models/workflow_schedule_execution_model.py @@ -1,441 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Optional, Dict, List, Any -from deprecated import deprecated +from conductor.client.adapters.models.workflow_schedule_execution_model_adapter import \ + WorkflowScheduleExecutionModelAdapter +WorkflowScheduleExecutionModel = WorkflowScheduleExecutionModelAdapter -@dataclass -class WorkflowScheduleExecutionModel: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'execution_id': 'str', - 'schedule_name': 'str', - 'scheduled_time': 'int', - 'execution_time': 'int', - 'workflow_name': 'str', - 'workflow_id': 'str', - 'reason': 'str', - 'stack_trace': 'str', - 'start_workflow_request': 'StartWorkflowRequest', - 'state': 'str', - 'zone_id': 'str', - 'org_id': 'str' - } - - attribute_map = { - 'execution_id': 'executionId', - 'schedule_name': 'scheduleName', - 'scheduled_time': 'scheduledTime', - 'execution_time': 'executionTime', - 'workflow_name': 'workflowName', - 'workflow_id': 'workflowId', - 'reason': 'reason', - 'stack_trace': 'stackTrace', - 'start_workflow_request': 'startWorkflowRequest', - 'state': 'state', - 'zone_id': 'zoneId', - 'org_id': 'orgId' - } - - execution_id: Optional[str] = field(default=None) - schedule_name: Optional[str] = field(default=None) - scheduled_time: Optional[int] = field(default=None) - execution_time: Optional[int] = field(default=None) - workflow_name: Optional[str] = field(default=None) - workflow_id: Optional[str] = field(default=None) - reason: Optional[str] = field(default=None) - stack_trace: Optional[str] = field(default=None) - start_workflow_request: Optional[Any] = field(default=None) - state: Optional[str] = field(default=None) - zone_id: Optional[str] = field(default="UTC") - org_id: Optional[str] = field(default=None) - - # Private backing fields for properties - _execution_id: Optional[str] = field(default=None, init=False, repr=False) - _schedule_name: Optional[str] = field(default=None, init=False, repr=False) - _scheduled_time: Optional[int] = field(default=None, init=False, repr=False) - _execution_time: Optional[int] = field(default=None, init=False, repr=False) - _workflow_name: Optional[str] = field(default=None, init=False, repr=False) - _workflow_id: Optional[str] = field(default=None, init=False, repr=False) - _reason: Optional[str] = field(default=None, init=False, repr=False) - _stack_trace: Optional[str] = field(default=None, init=False, repr=False) - _start_workflow_request: Optional[Any] = field(default=None, init=False, repr=False) - _state: Optional[str] = field(default=None, init=False, repr=False) - _zone_id: Optional[str] = field(default=None, init=False, repr=False) - _org_id: Optional[str] = field(default=None, init=False, repr=False) - - # Keep the original discriminator - discriminator: Optional[str] = field(default=None, init=False, repr=False) - - def __init__(self, execution_id=None, schedule_name=None, scheduled_time=None, execution_time=None, - workflow_name=None, workflow_id=None, reason=None, stack_trace=None, start_workflow_request=None, - state=None, zone_id=None, org_id=None): # noqa: E501 - """WorkflowScheduleExecutionModel - a model defined in Swagger""" # noqa: E501 - self._execution_id = None - self._schedule_name = None - self._scheduled_time = None - self._execution_time = None - self._workflow_name = None - self._workflow_id = None - self._reason = None - self._stack_trace = None - self._start_workflow_request = None - self._state = None - self._zone_id = None - self._org_id = None - self.discriminator = None - if execution_id is not None: - self.execution_id = execution_id - if schedule_name is not None: - self.schedule_name = schedule_name - if scheduled_time is not None: - self.scheduled_time = scheduled_time - if execution_time is not None: - self.execution_time = execution_time - if workflow_name is not None: - self.workflow_name = workflow_name - if workflow_id is not None: - self.workflow_id = workflow_id - if reason is not None: - self.reason = reason - if stack_trace is not None: - self.stack_trace = stack_trace - if start_workflow_request is not None: - self.start_workflow_request = start_workflow_request - if state is not None: - self.state = state - if zone_id is not None: - self.zone_id = zone_id - if org_id is not None: - self.org_id = org_id - - def __post_init__(self): - """Initialize private fields from dataclass fields""" - self._execution_id = self.execution_id - self._schedule_name = self.schedule_name - self._scheduled_time = self.scheduled_time - self._execution_time = self.execution_time - self._workflow_name = self.workflow_name - self._workflow_id = self.workflow_id - self._reason = self.reason - self._stack_trace = self.stack_trace - self._start_workflow_request = self.start_workflow_request - self._state = self.state - self._zone_id = self.zone_id - self._org_id = self.org_id - - @property - def execution_id(self): - """Gets the execution_id of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The execution_id of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: str - """ - return self._execution_id - - @execution_id.setter - def execution_id(self, execution_id): - """Sets the execution_id of this WorkflowScheduleExecutionModel. - - - :param execution_id: The execution_id of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: str - """ - - self._execution_id = execution_id - - @property - def schedule_name(self): - """Gets the schedule_name of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The schedule_name of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: str - """ - return self._schedule_name - - @schedule_name.setter - def schedule_name(self, schedule_name): - """Sets the schedule_name of this WorkflowScheduleExecutionModel. - - - :param schedule_name: The schedule_name of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: str - """ - - self._schedule_name = schedule_name - - @property - def scheduled_time(self): - """Gets the scheduled_time of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The scheduled_time of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: int - """ - return self._scheduled_time - - @scheduled_time.setter - def scheduled_time(self, scheduled_time): - """Sets the scheduled_time of this WorkflowScheduleExecutionModel. - - - :param scheduled_time: The scheduled_time of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: int - """ - - self._scheduled_time = scheduled_time - - @property - def execution_time(self): - """Gets the execution_time of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The execution_time of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: int - """ - return self._execution_time - - @execution_time.setter - def execution_time(self, execution_time): - """Sets the execution_time of this WorkflowScheduleExecutionModel. - - - :param execution_time: The execution_time of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: int - """ - - self._execution_time = execution_time - - @property - def workflow_name(self): - """Gets the workflow_name of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The workflow_name of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: str - """ - return self._workflow_name - - @workflow_name.setter - def workflow_name(self, workflow_name): - """Sets the workflow_name of this WorkflowScheduleExecutionModel. - - - :param workflow_name: The workflow_name of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: str - """ - - self._workflow_name = workflow_name - - @property - def workflow_id(self): - """Gets the workflow_id of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The workflow_id of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: str - """ - return self._workflow_id - - @workflow_id.setter - def workflow_id(self, workflow_id): - """Sets the workflow_id of this WorkflowScheduleExecutionModel. - - - :param workflow_id: The workflow_id of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: str - """ - - self._workflow_id = workflow_id - - @property - def reason(self): - """Gets the reason of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The reason of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: str - """ - return self._reason - - @reason.setter - def reason(self, reason): - """Sets the reason of this WorkflowScheduleExecutionModel. - - - :param reason: The reason of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: str - """ - - self._reason = reason - - @property - def stack_trace(self): - """Gets the stack_trace of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The stack_trace of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: str - """ - return self._stack_trace - - @stack_trace.setter - def stack_trace(self, stack_trace): - """Sets the stack_trace of this WorkflowScheduleExecutionModel. - - - :param stack_trace: The stack_trace of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: str - """ - - self._stack_trace = stack_trace - - @property - def start_workflow_request(self): - """Gets the start_workflow_request of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The start_workflow_request of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: StartWorkflowRequest - """ - return self._start_workflow_request - - @start_workflow_request.setter - def start_workflow_request(self, start_workflow_request): - """Sets the start_workflow_request of this WorkflowScheduleExecutionModel. - - - :param start_workflow_request: The start_workflow_request of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: StartWorkflowRequest - """ - - self._start_workflow_request = start_workflow_request - - @property - def state(self): - """Gets the state of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The state of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: str - """ - return self._state - - @state.setter - def state(self, state): - """Sets the state of this WorkflowScheduleExecutionModel. - - - :param state: The state of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: str - """ - allowed_values = ["POLLED", "FAILED", "EXECUTED"] # noqa: E501 - if state not in allowed_values: - raise ValueError( - "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 - .format(state, allowed_values) - ) - - self._state = state - - @property - def zone_id(self): - """Gets the zone_id of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The zone_id of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: str - """ - return self._zone_id - - @zone_id.setter - def zone_id(self, zone_id): - """Sets the zone_id of this WorkflowScheduleExecutionModel. - - - :param zone_id: The zone_id of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: str - """ - - self._zone_id = zone_id - - @property - def org_id(self): - """Gets the org_id of this WorkflowScheduleExecutionModel. # noqa: E501 - - - :return: The org_id of this WorkflowScheduleExecutionModel. # noqa: E501 - :rtype: str - """ - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Sets the org_id of this WorkflowScheduleExecutionModel. - - - :param org_id: The org_id of this WorkflowScheduleExecutionModel. # noqa: E501 - :type: str - """ - - self._org_id = org_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkflowScheduleExecutionModel, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkflowScheduleExecutionModel): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["WorkflowScheduleExecutionModel"] diff --git a/src/conductor/client/http/models/workflow_schedule_model.py b/src/conductor/client/http/models/workflow_schedule_model.py new file mode 100644 index 00000000..b61b78be --- /dev/null +++ b/src/conductor/client/http/models/workflow_schedule_model.py @@ -0,0 +1,6 @@ +from conductor.client.adapters.models.workflow_schedule_model_adapter import \ + WorkflowScheduleModelAdapter + +WorkflowScheduleModel = WorkflowScheduleModelAdapter + +__all__ = ["WorkflowScheduleModel"] diff --git a/src/conductor/client/http/models/workflow_state_update.py b/src/conductor/client/http/models/workflow_state_update.py index 27486470..635d7424 100644 --- a/src/conductor/client/http/models/workflow_state_update.py +++ b/src/conductor/client/http/models/workflow_state_update.py @@ -1,168 +1,6 @@ -from dataclasses import dataclass, field, InitVar -from typing import Dict, Optional -import pprint -import re # noqa: F401 -import six -from deprecated import deprecated +from conductor.client.adapters.models.workflow_state_update_adapter import \ + WorkflowStateUpdateAdapter -from conductor.client.http.models import TaskResult +WorkflowStateUpdate = WorkflowStateUpdateAdapter - -@dataclass -class WorkflowStateUpdate: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'task_reference_name': 'str', - 'task_result': 'TaskResult', - 'variables': 'dict(str, object)' - } - - attribute_map = { - 'task_reference_name': 'taskReferenceName', - 'task_result': 'taskResult', - 'variables': 'variables' - } - - task_reference_name: Optional[str] = field(default=None) - task_result: Optional[TaskResult] = field(default=None) - variables: Optional[Dict[str, object]] = field(default=None) - - _task_reference_name: Optional[str] = field(default=None, init=False, repr=False) - _task_result: Optional[TaskResult] = field(default=None, init=False, repr=False) - _variables: Optional[Dict[str, object]] = field(default=None, init=False, repr=False) - - def __init__(self, task_reference_name: str = None, task_result: TaskResult = None, - variables: Dict[str, object] = None): # noqa: E501 - """WorkflowStateUpdate - a model defined in Swagger""" # noqa: E501 - self._task_reference_name = None - self._task_result = None - self._variables = None - if task_reference_name is not None: - self.task_reference_name = task_reference_name - if task_result is not None: - self.task_result = task_result - if variables is not None: - self.variables = variables - - def __post_init__(self): - """Initialize private fields after dataclass initialization""" - pass - - @property - def task_reference_name(self) -> str: - """Gets the task_reference_name of this WorkflowStateUpdate. # noqa: E501 - - - :return: The task_reference_name of this WorkflowStateUpdate. # noqa: E501 - :rtype: str - """ - return self._task_reference_name - - @task_reference_name.setter - def task_reference_name(self, task_reference_name: str): - """Sets the task_reference_name of this WorkflowStateUpdate. - - - :param task_reference_name: The task_reference_name of this WorkflowStateUpdate. # noqa: E501 - :type: str - """ - - self._task_reference_name = task_reference_name - - @property - def task_result(self) -> TaskResult: - """Gets the task_result of this WorkflowStateUpdate. # noqa: E501 - - - :return: The task_result of this WorkflowStateUpdate. # noqa: E501 - :rtype: TaskResult - """ - return self._task_result - - @task_result.setter - def task_result(self, task_result: TaskResult): - """Sets the task_result of this WorkflowStateUpdate. - - - :param task_result: The task_result of this WorkflowStateUpdate. # noqa: E501 - :type: TaskResult - """ - - self._task_result = task_result - - @property - def variables(self) -> Dict[str, object]: - """Gets the variables of this WorkflowStateUpdate. # noqa: E501 - - - :return: The variables of this WorkflowStateUpdate. # noqa: E501 - :rtype: dict(str, object) - """ - return self._variables - - @variables.setter - def variables(self, variables: Dict[str, object]): - """Sets the variables of this WorkflowStateUpdate. - - - :param variables: The variables of this WorkflowStateUpdate. # noqa: E501 - :type: dict(str, object) - """ - - self._variables = variables - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkflowStateUpdate, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkflowStateUpdate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["WorkflowStateUpdate"] diff --git a/src/conductor/client/http/models/workflow_status.py b/src/conductor/client/http/models/workflow_status.py index 10a9bbde..b07f202f 100644 --- a/src/conductor/client/http/models/workflow_status.py +++ b/src/conductor/client/http/models/workflow_status.py @@ -1,258 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Dict, Any, Optional +from conductor.client.adapters.models.workflow_status_adapter import \ + WorkflowStatusAdapter -terminal_status = ('COMPLETED', 'FAILED', 'TIMED_OUT', 'TERMINATED') -successful_status = ('PAUSED', 'COMPLETED') -running_status = ('RUNNING', 'PAUSED') +WorkflowStatus = WorkflowStatusAdapter -@dataclass -class WorkflowStatus: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - workflow_id: Optional[str] = field(default=None) - correlation_id: Optional[str] = field(default=None) - output: Optional[Dict[str, Any]] = field(default=None) - variables: Optional[Dict[str, Any]] = field(default=None) - status: Optional[str] = field(default=None) - - # Private backing fields - _workflow_id: Optional[str] = field(init=False, repr=False, default=None) - _correlation_id: Optional[str] = field(init=False, repr=False, default=None) - _output: Optional[Dict[str, Any]] = field(init=False, repr=False, default=None) - _variables: Optional[Dict[str, Any]] = field(init=False, repr=False, default=None) - _status: Optional[str] = field(init=False, repr=False, default=None) - - # For backward compatibility - swagger_types = { - 'workflow_id': 'str', - 'correlation_id': 'str', - 'output': 'dict(str, object)', - 'variables': 'dict(str, object)', - 'status': 'str' - } - - attribute_map = { - 'workflow_id': 'workflowId', - 'correlation_id': 'correlationId', - 'output': 'output', - 'variables': 'variables', - 'status': 'status' - } - - discriminator = None - - def __init__(self, workflow_id=None, correlation_id=None, output=None, variables=None, status=None): # noqa: E501 - """WorkflowStatus - a model defined in Swagger""" # noqa: E501 - self._workflow_id = None - self._correlation_id = None - self._output = None - self._variables = None - self._status = None - self.discriminator = None - if workflow_id is not None: - self.workflow_id = workflow_id - if correlation_id is not None: - self.correlation_id = correlation_id - if output is not None: - self.output = output - if variables is not None: - self.variables = variables - if status is not None: - self.status = status - - def __post_init__(self): - # Initialize private fields from dataclass fields if __init__ wasn't called directly - if self._workflow_id is None and self.workflow_id is not None: - self._workflow_id = self.workflow_id - if self._correlation_id is None and self.correlation_id is not None: - self._correlation_id = self.correlation_id - if self._output is None and self.output is not None: - self._output = self.output - if self._variables is None and self.variables is not None: - self._variables = self.variables - if self._status is None and self.status is not None: - self._status = self.status - - @property - def workflow_id(self): - """Gets the workflow_id of this WorkflowStatus. # noqa: E501 - - - :return: The workflow_id of this WorkflowStatus. # noqa: E501 - :rtype: str - """ - return self._workflow_id - - @workflow_id.setter - def workflow_id(self, workflow_id): - """Sets the workflow_id of this WorkflowStatus. - - - :param workflow_id: The workflow_id of this WorkflowStatus. # noqa: E501 - :type: str - """ - - self._workflow_id = workflow_id - - @property - def correlation_id(self): - """Gets the correlation_id of this WorkflowStatus. # noqa: E501 - - - :return: The correlation_id of this WorkflowStatus. # noqa: E501 - :rtype: str - """ - return self._correlation_id - - @correlation_id.setter - def correlation_id(self, correlation_id): - """Sets the correlation_id of this WorkflowStatus. - - - :param correlation_id: The correlation_id of this WorkflowStatus. # noqa: E501 - :type: str - """ - - self._correlation_id = correlation_id - - @property - def output(self): - """Gets the output of this WorkflowStatus. # noqa: E501 - - - :return: The output of this WorkflowStatus. # noqa: E501 - :rtype: dict(str, object) - """ - return self._output - - @output.setter - def output(self, output): - """Sets the output of this WorkflowStatus. - - - :param output: The output of this WorkflowStatus. # noqa: E501 - :type: dict(str, object) - """ - - self._output = output - - @property - def variables(self): - """Gets the variables of this WorkflowStatus. # noqa: E501 - - - :return: The variables of this WorkflowStatus. # noqa: E501 - :rtype: dict(str, object) - """ - return self._variables - - @variables.setter - def variables(self, variables): - """Sets the variables of this WorkflowStatus. - - - :param variables: The variables of this WorkflowStatus. # noqa: E501 - :type: dict(str, object) - """ - - self._variables = variables - - @property - def status(self): - """Gets the status of this WorkflowStatus. # noqa: E501 - - - :return: The status of this WorkflowStatus. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this WorkflowStatus. - - - :param status: The status of this WorkflowStatus. # noqa: E501 - :type: str - """ - allowed_values = ["RUNNING", "COMPLETED", "FAILED", "TIMED_OUT", "TERMINATED", "PAUSED"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkflowStatus, dict): - for key, value in self.items(): - result[key] = value - - return result - - def is_completed(self) -> bool: - """Checks if the workflow has completed - :return: True if the workflow status is COMPLETED, FAILED or TERMINATED - """ - return self._status in terminal_status - - def is_successful(self) -> bool: - """Checks if the workflow has completed in successful state (ie COMPLETED) - :return: True if the workflow status is COMPLETED - """ - return self._status in successful_status - - def is_running(self) -> bool: - return self.status in running_status - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkflowStatus): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["WorkflowStatus"] diff --git a/src/conductor/client/http/models/workflow_summary.py b/src/conductor/client/http/models/workflow_summary.py index 632c5478..c208c708 100644 --- a/src/conductor/client/http/models/workflow_summary.py +++ b/src/conductor/client/http/models/workflow_summary.py @@ -1,708 +1,6 @@ -import pprint -import re # noqa: F401 -import six -from dataclasses import dataclass, field, InitVar -from typing import Set, Optional, Dict, List, Any -from deprecated import deprecated +from conductor.client.adapters.models.workflow_summary_adapter import \ + WorkflowSummaryAdapter +WorkflowSummary = WorkflowSummaryAdapter -@dataclass -class WorkflowSummary: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - workflow_type: Optional[str] = field(default=None) - version: Optional[int] = field(default=None) - workflow_id: Optional[str] = field(default=None) - correlation_id: Optional[str] = field(default=None) - start_time: Optional[str] = field(default=None) - update_time: Optional[str] = field(default=None) - end_time: Optional[str] = field(default=None) - status: Optional[str] = field(default=None) - input: Optional[str] = field(default=None) - output: Optional[str] = field(default=None) - reason_for_incompletion: Optional[str] = field(default=None) - execution_time: Optional[int] = field(default=None) - event: Optional[str] = field(default=None) - failed_reference_task_names: Optional[str] = field(default="") - external_input_payload_storage_path: Optional[str] = field(default=None) - external_output_payload_storage_path: Optional[str] = field(default=None) - priority: Optional[int] = field(default=None) - failed_task_names: Set[str] = field(default_factory=set) - created_by: Optional[str] = field(default=None) - - # Fields present in Python but not in Java - mark as deprecated - output_size: Optional[int] = field(default=None) - input_size: Optional[int] = field(default=None) - - # Private backing fields for properties - _workflow_type: Optional[str] = field(init=False, repr=False, default=None) - _version: Optional[int] = field(init=False, repr=False, default=None) - _workflow_id: Optional[str] = field(init=False, repr=False, default=None) - _correlation_id: Optional[str] = field(init=False, repr=False, default=None) - _start_time: Optional[str] = field(init=False, repr=False, default=None) - _update_time: Optional[str] = field(init=False, repr=False, default=None) - _end_time: Optional[str] = field(init=False, repr=False, default=None) - _status: Optional[str] = field(init=False, repr=False, default=None) - _input: Optional[str] = field(init=False, repr=False, default=None) - _output: Optional[str] = field(init=False, repr=False, default=None) - _reason_for_incompletion: Optional[str] = field(init=False, repr=False, default=None) - _execution_time: Optional[int] = field(init=False, repr=False, default=None) - _event: Optional[str] = field(init=False, repr=False, default=None) - _failed_reference_task_names: Optional[str] = field(init=False, repr=False, default="") - _external_input_payload_storage_path: Optional[str] = field(init=False, repr=False, default=None) - _external_output_payload_storage_path: Optional[str] = field(init=False, repr=False, default=None) - _priority: Optional[int] = field(init=False, repr=False, default=None) - _failed_task_names: Set[str] = field(init=False, repr=False, default_factory=set) - _created_by: Optional[str] = field(init=False, repr=False, default=None) - _output_size: Optional[int] = field(init=False, repr=False, default=None) - _input_size: Optional[int] = field(init=False, repr=False, default=None) - - # For backward compatibility - swagger_types = { - 'workflow_type': 'str', - 'version': 'int', - 'workflow_id': 'str', - 'correlation_id': 'str', - 'start_time': 'str', - 'update_time': 'str', - 'end_time': 'str', - 'status': 'str', - 'input': 'str', - 'output': 'str', - 'reason_for_incompletion': 'str', - 'execution_time': 'int', - 'event': 'str', - 'failed_reference_task_names': 'str', - 'external_input_payload_storage_path': 'str', - 'external_output_payload_storage_path': 'str', - 'priority': 'int', - 'failed_task_names': 'Set[str]', - 'created_by': 'str', - 'output_size': 'int', - 'input_size': 'int' - } - - attribute_map = { - 'workflow_type': 'workflowType', - 'version': 'version', - 'workflow_id': 'workflowId', - 'correlation_id': 'correlationId', - 'start_time': 'startTime', - 'update_time': 'updateTime', - 'end_time': 'endTime', - 'status': 'status', - 'input': 'input', - 'output': 'output', - 'reason_for_incompletion': 'reasonForIncompletion', - 'execution_time': 'executionTime', - 'event': 'event', - 'failed_reference_task_names': 'failedReferenceTaskNames', - 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', - 'external_output_payload_storage_path': 'externalOutputPayloadStoragePath', - 'priority': 'priority', - 'failed_task_names': 'failedTaskNames', - 'created_by': 'createdBy', - 'output_size': 'outputSize', - 'input_size': 'inputSize' - } - - discriminator: Optional[str] = field(init=False, repr=False, default=None) - - def __init__(self, workflow_type=None, version=None, workflow_id=None, correlation_id=None, start_time=None, - update_time=None, end_time=None, status=None, input=None, output=None, reason_for_incompletion=None, - execution_time=None, event=None, failed_reference_task_names=None, - external_input_payload_storage_path=None, external_output_payload_storage_path=None, priority=None, - created_by=None, output_size=None, input_size=None, failed_task_names=None): # noqa: E501 - """WorkflowSummary - a model defined in Swagger""" # noqa: E501 - self._workflow_type = None - self._version = None - self._workflow_id = None - self._correlation_id = None - self._start_time = None - self._update_time = None - self._end_time = None - self._status = None - self._input = None - self._output = None - self._reason_for_incompletion = None - self._execution_time = None - self._event = None - self._failed_reference_task_names = None - self._external_input_payload_storage_path = None - self._external_output_payload_storage_path = None - self._priority = None - self._created_by = None - self._output_size = None - self._input_size = None - self._failed_task_names = set() if failed_task_names is None else failed_task_names - self.discriminator = None - if workflow_type is not None: - self.workflow_type = workflow_type - if version is not None: - self.version = version - if workflow_id is not None: - self.workflow_id = workflow_id - if correlation_id is not None: - self.correlation_id = correlation_id - if start_time is not None: - self.start_time = start_time - if update_time is not None: - self.update_time = update_time - if end_time is not None: - self.end_time = end_time - if status is not None: - self.status = status - if input is not None: - self.input = input - if output is not None: - self.output = output - if reason_for_incompletion is not None: - self.reason_for_incompletion = reason_for_incompletion - if execution_time is not None: - self.execution_time = execution_time - if event is not None: - self.event = event - if failed_reference_task_names is not None: - self.failed_reference_task_names = failed_reference_task_names - if external_input_payload_storage_path is not None: - self.external_input_payload_storage_path = external_input_payload_storage_path - if external_output_payload_storage_path is not None: - self.external_output_payload_storage_path = external_output_payload_storage_path - if priority is not None: - self.priority = priority - if created_by is not None: - self.created_by = created_by - if output_size is not None: - self.output_size = output_size - if input_size is not None: - self.input_size = input_size - - def __post_init__(self): - """Initialize private fields from dataclass fields""" - self._workflow_type = self.workflow_type - self._version = self.version - self._workflow_id = self.workflow_id - self._correlation_id = self.correlation_id - self._start_time = self.start_time - self._update_time = self.update_time - self._end_time = self.end_time - self._status = self.status - self._input = self.input - self._output = self.output - self._reason_for_incompletion = self.reason_for_incompletion - self._execution_time = self.execution_time - self._event = self.event - self._failed_reference_task_names = self.failed_reference_task_names - self._external_input_payload_storage_path = self.external_input_payload_storage_path - self._external_output_payload_storage_path = self.external_output_payload_storage_path - self._priority = self.priority - self._failed_task_names = self.failed_task_names - self._created_by = self.created_by - self._output_size = self.output_size - self._input_size = self.input_size - - @property - def workflow_type(self): - """Gets the workflow_type of this WorkflowSummary. # noqa: E501 - - - :return: The workflow_type of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._workflow_type - - @workflow_type.setter - def workflow_type(self, workflow_type): - """Sets the workflow_type of this WorkflowSummary. - - - :param workflow_type: The workflow_type of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._workflow_type = workflow_type - - @property - def version(self): - """Gets the version of this WorkflowSummary. # noqa: E501 - - - :return: The version of this WorkflowSummary. # noqa: E501 - :rtype: int - """ - return self._version - - @version.setter - def version(self, version): - """Sets the version of this WorkflowSummary. - - - :param version: The version of this WorkflowSummary. # noqa: E501 - :type: int - """ - - self._version = version - - @property - def workflow_id(self): - """Gets the workflow_id of this WorkflowSummary. # noqa: E501 - - - :return: The workflow_id of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._workflow_id - - @workflow_id.setter - def workflow_id(self, workflow_id): - """Sets the workflow_id of this WorkflowSummary. - - - :param workflow_id: The workflow_id of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._workflow_id = workflow_id - - @property - def correlation_id(self): - """Gets the correlation_id of this WorkflowSummary. # noqa: E501 - - - :return: The correlation_id of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._correlation_id - - @correlation_id.setter - def correlation_id(self, correlation_id): - """Sets the correlation_id of this WorkflowSummary. - - - :param correlation_id: The correlation_id of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._correlation_id = correlation_id - - @property - def start_time(self): - """Gets the start_time of this WorkflowSummary. # noqa: E501 - - - :return: The start_time of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._start_time - - @start_time.setter - def start_time(self, start_time): - """Sets the start_time of this WorkflowSummary. - - - :param start_time: The start_time of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._start_time = start_time - - @property - def update_time(self): - """Gets the update_time of this WorkflowSummary. # noqa: E501 - - - :return: The update_time of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._update_time - - @update_time.setter - def update_time(self, update_time): - """Sets the update_time of this WorkflowSummary. - - - :param update_time: The update_time of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._update_time = update_time - - @property - def end_time(self): - """Gets the end_time of this WorkflowSummary. # noqa: E501 - - - :return: The end_time of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._end_time - - @end_time.setter - def end_time(self, end_time): - """Sets the end_time of this WorkflowSummary. - - - :param end_time: The end_time of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._end_time = end_time - - @property - def status(self): - """Gets the status of this WorkflowSummary. # noqa: E501 - - - :return: The status of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this WorkflowSummary. - - - :param status: The status of this WorkflowSummary. # noqa: E501 - :type: str - """ - allowed_values = ["RUNNING", "COMPLETED", "FAILED", "TIMED_OUT", "TERMINATED", "PAUSED"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def input(self): - """Gets the input of this WorkflowSummary. # noqa: E501 - - - :return: The input of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._input - - @input.setter - def input(self, input): - """Sets the input of this WorkflowSummary. - - - :param input: The input of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._input = input - - @property - def output(self): - """Gets the output of this WorkflowSummary. # noqa: E501 - - - :return: The output of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._output - - @output.setter - def output(self, output): - """Sets the output of this WorkflowSummary. - - - :param output: The output of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._output = output - - @property - def reason_for_incompletion(self): - """Gets the reason_for_incompletion of this WorkflowSummary. # noqa: E501 - - - :return: The reason_for_incompletion of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._reason_for_incompletion - - @reason_for_incompletion.setter - def reason_for_incompletion(self, reason_for_incompletion): - """Sets the reason_for_incompletion of this WorkflowSummary. - - - :param reason_for_incompletion: The reason_for_incompletion of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._reason_for_incompletion = reason_for_incompletion - - @property - def execution_time(self): - """Gets the execution_time of this WorkflowSummary. # noqa: E501 - - - :return: The execution_time of this WorkflowSummary. # noqa: E501 - :rtype: int - """ - return self._execution_time - - @execution_time.setter - def execution_time(self, execution_time): - """Sets the execution_time of this WorkflowSummary. - - - :param execution_time: The execution_time of this WorkflowSummary. # noqa: E501 - :type: int - """ - - self._execution_time = execution_time - - @property - def event(self): - """Gets the event of this WorkflowSummary. # noqa: E501 - - - :return: The event of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._event - - @event.setter - def event(self, event): - """Sets the event of this WorkflowSummary. - - - :param event: The event of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._event = event - - @property - def failed_reference_task_names(self): - """Gets the failed_reference_task_names of this WorkflowSummary. # noqa: E501 - - - :return: The failed_reference_task_names of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._failed_reference_task_names - - @failed_reference_task_names.setter - def failed_reference_task_names(self, failed_reference_task_names): - """Sets the failed_reference_task_names of this WorkflowSummary. - - - :param failed_reference_task_names: The failed_reference_task_names of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._failed_reference_task_names = failed_reference_task_names - - @property - def external_input_payload_storage_path(self): - """Gets the external_input_payload_storage_path of this WorkflowSummary. # noqa: E501 - - - :return: The external_input_payload_storage_path of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._external_input_payload_storage_path - - @external_input_payload_storage_path.setter - def external_input_payload_storage_path(self, external_input_payload_storage_path): - """Sets the external_input_payload_storage_path of this WorkflowSummary. - - - :param external_input_payload_storage_path: The external_input_payload_storage_path of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._external_input_payload_storage_path = external_input_payload_storage_path - - @property - def external_output_payload_storage_path(self): - """Gets the external_output_payload_storage_path of this WorkflowSummary. # noqa: E501 - - - :return: The external_output_payload_storage_path of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._external_output_payload_storage_path - - @external_output_payload_storage_path.setter - def external_output_payload_storage_path(self, external_output_payload_storage_path): - """Sets the external_output_payload_storage_path of this WorkflowSummary. - - - :param external_output_payload_storage_path: The external_output_payload_storage_path of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._external_output_payload_storage_path = external_output_payload_storage_path - - @property - def priority(self): - """Gets the priority of this WorkflowSummary. # noqa: E501 - - - :return: The priority of this WorkflowSummary. # noqa: E501 - :rtype: int - """ - return self._priority - - @priority.setter - def priority(self, priority): - """Sets the priority of this WorkflowSummary. - - - :param priority: The priority of this WorkflowSummary. # noqa: E501 - :type: int - """ - - self._priority = priority - - @property - def failed_task_names(self): - """Gets the failed_task_names of this WorkflowSummary. # noqa: E501 - - - :return: The failed_task_names of this WorkflowSummary. # noqa: E501 - :rtype: Set[str] - """ - return self._failed_task_names - - @failed_task_names.setter - def failed_task_names(self, failed_task_names): - """Sets the failed_task_names of this WorkflowSummary. - - - :param failed_task_names: The failed_task_names of this WorkflowSummary. # noqa: E501 - :type: Set[str] - """ - - self._failed_task_names = failed_task_names - - @property - def created_by(self): - """Gets the created_by of this WorkflowSummary. # noqa: E501 - - - :return: The created_by of this WorkflowSummary. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this WorkflowSummary. - - - :param created_by: The created_by of this WorkflowSummary. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - @deprecated(reason="This field is not present in the Java POJO") - def output_size(self): - """Gets the output_size of this WorkflowSummary. # noqa: E501 - - - :return: The output_size of this WorkflowSummary. # noqa: E501 - :rtype: int - """ - return self._output_size - - @output_size.setter - @deprecated(reason="This field is not present in the Java POJO") - def output_size(self, output_size): - """Sets the output_size of this WorkflowSummary. - - - :param output_size: The output_size of this WorkflowSummary. # noqa: E501 - :type: int - """ - - self._output_size = output_size - - @property - @deprecated(reason="This field is not present in the Java POJO") - def input_size(self): - """Gets the input_size of this WorkflowSummary. # noqa: E501 - - - :return: The input_size of this WorkflowSummary. # noqa: E501 - :rtype: int - """ - return self._input_size - - @input_size.setter - @deprecated(reason="This field is not present in the Java POJO") - def input_size(self, input_size): - """Sets the input_size of this WorkflowSummary. - - - :param input_size: The input_size of this WorkflowSummary. # noqa: E501 - :type: int - """ - - self._input_size = input_size - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkflowSummary, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkflowSummary): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["WorkflowSummary"] diff --git a/src/conductor/client/http/models/workflow_tag.py b/src/conductor/client/http/models/workflow_tag.py index f8bc1f2f..cd36da30 100644 --- a/src/conductor/client/http/models/workflow_tag.py +++ b/src/conductor/client/http/models/workflow_tag.py @@ -1,99 +1,6 @@ -import pprint -import re # noqa: F401 +from conductor.client.adapters.models.workflow_tag_adapter import \ + WorkflowTagAdapter -import six +WorkflowTag = WorkflowTagAdapter - -class WorkflowTag(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'rate_limit': 'RateLimit' - } - - attribute_map = { - 'rate_limit': 'rateLimit' - } - - def __init__(self, rate_limit=None): # noqa: E501 - """WorkflowTag - a model defined in Swagger""" # noqa: E501 - self._rate_limit = None - self.discriminator = None - if rate_limit is not None: - self.rate_limit = rate_limit - - @property - def rate_limit(self): - """Gets the rate_limit of this WorkflowTag. # noqa: E501 - - - :return: The rate_limit of this WorkflowTag. # noqa: E501 - :rtype: RateLimit - """ - return self._rate_limit - - @rate_limit.setter - def rate_limit(self, rate_limit): - """Sets the rate_limit of this WorkflowTag. - - - :param rate_limit: The rate_limit of this WorkflowTag. # noqa: E501 - :type: RateLimit - """ - - self._rate_limit = rate_limit - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkflowTag, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkflowTag): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other +__all__ = ["WorkflowTag"] diff --git a/src/conductor/client/http/models/workflow_task.py b/src/conductor/client/http/models/workflow_task.py index 6274cdec..4177e1c7 100644 --- a/src/conductor/client/http/models/workflow_task.py +++ b/src/conductor/client/http/models/workflow_task.py @@ -1,1039 +1,6 @@ -import pprint -import re # noqa: F401 -from dataclasses import dataclass, field, InitVar, fields, asdict, is_dataclass -from typing import List, Dict, Optional, Any, Union -import six -from deprecated import deprecated +from conductor.client.adapters.models.workflow_task_adapter import ( + CacheConfig, WorkflowTaskAdapter) -from conductor.client.http.models.state_change_event import StateChangeConfig, StateChangeEventType, StateChangeEvent +WorkflowTask = WorkflowTaskAdapter - -@dataclass -class CacheConfig: - swagger_types = { - 'key': 'str', - 'ttl_in_second': 'int' - } - - attribute_map = { - 'key': 'key', - 'ttl_in_second': 'ttlInSecond' - } - _key: str = field(default=None, repr=False) - _ttl_in_second: int = field(default=None, repr=False) - - def __init__(self, key: str = None, ttl_in_second: int = None): - self._key = key - self._ttl_in_second = ttl_in_second - - @property - def key(self): - return self._key - - @key.setter - def key(self, key): - self._key = key - - @property - def ttl_in_second(self): - return self._ttl_in_second - - @ttl_in_second.setter - def ttl_in_second(self, ttl_in_second): - self._ttl_in_second = ttl_in_second - - -@dataclass -class WorkflowTask: - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - _name: str = field(default=None, repr=False) - _task_reference_name: str = field(default=None, repr=False) - _description: str = field(default=None, repr=False) - _input_parameters: Dict[str, Any] = field(default=None, repr=False) - _type: str = field(default=None, repr=False) - _dynamic_task_name_param: str = field(default=None, repr=False) - _case_value_param: str = field(default=None, repr=False) - _case_expression: str = field(default=None, repr=False) - _script_expression: str = field(default=None, repr=False) - _decision_cases: Dict[str, List['WorkflowTask']] = field(default=None, repr=False) - _dynamic_fork_join_tasks_param: str = field(default=None, repr=False) - _dynamic_fork_tasks_param: str = field(default=None, repr=False) - _dynamic_fork_tasks_input_param_name: str = field(default=None, repr=False) - _default_case: List['WorkflowTask'] = field(default=None, repr=False) - _fork_tasks: List[List['WorkflowTask']] = field(default=None, repr=False) - _start_delay: int = field(default=None, repr=False) - _sub_workflow_param: Any = field(default=None, repr=False) - _join_on: List[str] = field(default=None, repr=False) - _sink: str = field(default=None, repr=False) - _optional: bool = field(default=None, repr=False) - _task_definition: Any = field(default=None, repr=False) - _rate_limited: bool = field(default=None, repr=False) - _default_exclusive_join_task: List[str] = field(default=None, repr=False) - _async_complete: bool = field(default=None, repr=False) - _loop_condition: str = field(default=None, repr=False) - _loop_over: List['WorkflowTask'] = field(default=None, repr=False) - _retry_count: int = field(default=None, repr=False) - _evaluator_type: str = field(default=None, repr=False) - _expression: str = field(default=None, repr=False) - _workflow_task_type: str = field(default=None, repr=False) - _on_state_change: Dict[str, List[StateChangeEvent]] = field(default=None, repr=False) - _cache_config: CacheConfig = field(default=None, repr=False) - _join_status: str = field(default=None, repr=False) - _permissive: bool = field(default=None, repr=False) - - swagger_types = { - 'name': 'str', - 'task_reference_name': 'str', - 'description': 'str', - 'input_parameters': 'dict(str, object)', - 'type': 'str', - 'dynamic_task_name_param': 'str', - 'case_value_param': 'str', - 'case_expression': 'str', - 'script_expression': 'str', - 'decision_cases': 'dict(str, list[WorkflowTask])', - 'dynamic_fork_join_tasks_param': 'str', - 'dynamic_fork_tasks_param': 'str', - 'dynamic_fork_tasks_input_param_name': 'str', - 'default_case': 'list[WorkflowTask]', - 'fork_tasks': 'list[list[WorkflowTask]]', - 'start_delay': 'int', - 'sub_workflow_param': 'SubWorkflowParams', - 'join_on': 'list[str]', - 'sink': 'str', - 'optional': 'bool', - 'task_definition': 'TaskDef', - 'rate_limited': 'bool', - 'default_exclusive_join_task': 'list[str]', - 'async_complete': 'bool', - 'loop_condition': 'str', - 'loop_over': 'list[WorkflowTask]', - 'retry_count': 'int', - 'evaluator_type': 'str', - 'expression': 'str', - 'workflow_task_type': 'str', - 'on_state_change': 'dict(str, StateChangeConfig)', - 'cache_config': 'CacheConfig', - 'join_status': 'str', - 'permissive': 'bool' - } - - attribute_map = { - 'name': 'name', - 'task_reference_name': 'taskReferenceName', - 'description': 'description', - 'input_parameters': 'inputParameters', - 'type': 'type', - 'dynamic_task_name_param': 'dynamicTaskNameParam', - 'case_value_param': 'caseValueParam', - 'case_expression': 'caseExpression', - 'script_expression': 'scriptExpression', - 'decision_cases': 'decisionCases', - 'dynamic_fork_join_tasks_param': 'dynamicForkJoinTasksParam', - 'dynamic_fork_tasks_param': 'dynamicForkTasksParam', - 'dynamic_fork_tasks_input_param_name': 'dynamicForkTasksInputParamName', - 'default_case': 'defaultCase', - 'fork_tasks': 'forkTasks', - 'start_delay': 'startDelay', - 'sub_workflow_param': 'subWorkflowParam', - 'join_on': 'joinOn', - 'sink': 'sink', - 'optional': 'optional', - 'task_definition': 'taskDefinition', - 'rate_limited': 'rateLimited', - 'default_exclusive_join_task': 'defaultExclusiveJoinTask', - 'async_complete': 'asyncComplete', - 'loop_condition': 'loopCondition', - 'loop_over': 'loopOver', - 'retry_count': 'retryCount', - 'evaluator_type': 'evaluatorType', - 'expression': 'expression', - 'workflow_task_type': 'workflowTaskType', - 'on_state_change': 'onStateChange', - 'cache_config': 'cacheConfig', - 'join_status': 'joinStatus', - 'permissive': 'permissive' - } - - def __init__(self, name=None, task_reference_name=None, description=None, input_parameters=None, type=None, - dynamic_task_name_param=None, case_value_param=None, case_expression=None, script_expression=None, - decision_cases=None, dynamic_fork_join_tasks_param=None, dynamic_fork_tasks_param=None, - dynamic_fork_tasks_input_param_name=None, default_case=None, fork_tasks=None, start_delay=None, - sub_workflow_param=None, join_on=None, sink=None, optional=None, task_definition : 'TaskDef' =None, - rate_limited=None, default_exclusive_join_task=None, async_complete=None, loop_condition=None, - loop_over=None, retry_count=None, evaluator_type=None, expression=None, - workflow_task_type=None, on_state_change: Dict[str, StateChangeConfig] = None, - cache_config: CacheConfig = None, join_status=None, permissive=None): # noqa: E501 - """WorkflowTask - a model defined in Swagger""" # noqa: E501 - self._name = None - self._task_reference_name = None - self._description = None - self._input_parameters = None - self._type = None - self._dynamic_task_name_param = None - self._case_value_param = None - self._case_expression = None - self._script_expression = None - self._decision_cases = None - self._dynamic_fork_join_tasks_param = None - self._dynamic_fork_tasks_param = None - self._dynamic_fork_tasks_input_param_name = None - self._default_case = None - self._fork_tasks = None - self._start_delay = None - self._sub_workflow_param = None - self._join_on = None - self._sink = None - self._optional = None - self._task_definition = None - self._rate_limited = None - self._default_exclusive_join_task = None - self._async_complete = None - self._loop_condition = None - self._loop_over = None - self._retry_count = None - self._evaluator_type = None - self._expression = None - self._workflow_task_type = None - self.discriminator = None - self._on_state_change = None - self._cache_config = None - self._join_status = None - self._permissive = None - self.name = name - self.task_reference_name = task_reference_name - if description is not None: - self.description = description - if input_parameters is not None: - self.input_parameters = input_parameters - if type is not None: - self.type = type - if dynamic_task_name_param is not None: - self.dynamic_task_name_param = dynamic_task_name_param - if case_value_param is not None: - self.case_value_param = case_value_param - if case_expression is not None: - self.case_expression = case_expression - if script_expression is not None: - self.script_expression = script_expression - if decision_cases is not None: - self.decision_cases = decision_cases - if dynamic_fork_join_tasks_param is not None: - self.dynamic_fork_join_tasks_param = dynamic_fork_join_tasks_param - if dynamic_fork_tasks_param is not None: - self.dynamic_fork_tasks_param = dynamic_fork_tasks_param - if dynamic_fork_tasks_input_param_name is not None: - self.dynamic_fork_tasks_input_param_name = dynamic_fork_tasks_input_param_name - if default_case is not None: - self.default_case = default_case - if fork_tasks is not None: - self.fork_tasks = fork_tasks - if start_delay is not None: - self.start_delay = start_delay - if sub_workflow_param is not None: - self.sub_workflow_param = sub_workflow_param - if join_on is not None: - self.join_on = join_on - if sink is not None: - self.sink = sink - if optional is not None: - self.optional = optional - if task_definition is not None: - self.task_definition = task_definition - if rate_limited is not None: - self.rate_limited = rate_limited - if default_exclusive_join_task is not None: - self.default_exclusive_join_task = default_exclusive_join_task - if async_complete is not None: - self.async_complete = async_complete - if loop_condition is not None: - self.loop_condition = loop_condition - if loop_over is not None: - self.loop_over = loop_over - if retry_count is not None: - self.retry_count = retry_count - if evaluator_type is not None: - self.evaluator_type = evaluator_type - if expression is not None: - self.expression = expression - if workflow_task_type is not None: - self.workflow_task_type = workflow_task_type - if on_state_change is not None: - self._on_state_change = on_state_change - self._cache_config = cache_config - if join_status is not None: - self.join_status = join_status - if permissive is not None: - self.permissive = permissive - - def __post_init__(self): - pass - - @property - def name(self): - """Gets the name of this WorkflowTask. # noqa: E501 - - - :return: The name of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this WorkflowTask. - - - :param name: The name of this WorkflowTask. # noqa: E501 - :type: str - """ - self._name = name - - @property - def task_reference_name(self): - """Gets the task_reference_name of this WorkflowTask. # noqa: E501 - - - :return: The task_reference_name of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._task_reference_name - - @task_reference_name.setter - def task_reference_name(self, task_reference_name): - """Sets the task_reference_name of this WorkflowTask. - - - :param task_reference_name: The task_reference_name of this WorkflowTask. # noqa: E501 - :type: str - """ - self._task_reference_name = task_reference_name - - @property - def description(self): - """Gets the description of this WorkflowTask. # noqa: E501 - - - :return: The description of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this WorkflowTask. - - - :param description: The description of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def input_parameters(self): - """Gets the input_parameters of this WorkflowTask. # noqa: E501 - - - :return: The input_parameters of this WorkflowTask. # noqa: E501 - :rtype: dict(str, object) - """ - return self._input_parameters - - @input_parameters.setter - def input_parameters(self, input_parameters): - """Sets the input_parameters of this WorkflowTask. - - - :param input_parameters: The input_parameters of this WorkflowTask. # noqa: E501 - :type: dict(str, object) - """ - - self._input_parameters = input_parameters - - @property - def type(self): - """Gets the type of this WorkflowTask. # noqa: E501 - - - :return: The type of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this WorkflowTask. - - - :param type: The type of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._type = type - - @property - def dynamic_task_name_param(self): - """Gets the dynamic_task_name_param of this WorkflowTask. # noqa: E501 - - - :return: The dynamic_task_name_param of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._dynamic_task_name_param - - @dynamic_task_name_param.setter - def dynamic_task_name_param(self, dynamic_task_name_param): - """Sets the dynamic_task_name_param of this WorkflowTask. - - - :param dynamic_task_name_param: The dynamic_task_name_param of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._dynamic_task_name_param = dynamic_task_name_param - - @property - @deprecated - def case_value_param(self): - """Gets the case_value_param of this WorkflowTask. # noqa: E501 - - - :return: The case_value_param of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._case_value_param - - @case_value_param.setter - @deprecated - def case_value_param(self, case_value_param): - """Sets the case_value_param of this WorkflowTask. - - - :param case_value_param: The case_value_param of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._case_value_param = case_value_param - - @property - @deprecated - def case_expression(self): - """Gets the case_expression of this WorkflowTask. # noqa: E501 - - - :return: The case_expression of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._case_expression - - @case_expression.setter - @deprecated - def case_expression(self, case_expression): - """Sets the case_expression of this WorkflowTask. - - - :param case_expression: The case_expression of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._case_expression = case_expression - - @property - def script_expression(self): - """Gets the script_expression of this WorkflowTask. # noqa: E501 - - - :return: The script_expression of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._script_expression - - @script_expression.setter - def script_expression(self, script_expression): - """Sets the script_expression of this WorkflowTask. - - - :param script_expression: The script_expression of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._script_expression = script_expression - - @property - def decision_cases(self): - """Gets the decision_cases of this WorkflowTask. # noqa: E501 - - - :return: The decision_cases of this WorkflowTask. # noqa: E501 - :rtype: dict(str, list[WorkflowTask]) - """ - return self._decision_cases - - @decision_cases.setter - def decision_cases(self, decision_cases): - """Sets the decision_cases of this WorkflowTask. - - - :param decision_cases: The decision_cases of this WorkflowTask. # noqa: E501 - :type: dict(str, list[WorkflowTask]) - """ - - self._decision_cases = decision_cases - - @property - @deprecated - def dynamic_fork_join_tasks_param(self): - """Gets the dynamic_fork_join_tasks_param of this WorkflowTask. # noqa: E501 - - - :return: The dynamic_fork_join_tasks_param of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._dynamic_fork_join_tasks_param - - @dynamic_fork_join_tasks_param.setter - @deprecated - def dynamic_fork_join_tasks_param(self, dynamic_fork_join_tasks_param): - """Sets the dynamic_fork_join_tasks_param of this WorkflowTask. - - - :param dynamic_fork_join_tasks_param: The dynamic_fork_join_tasks_param of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._dynamic_fork_join_tasks_param = dynamic_fork_join_tasks_param - - @property - def dynamic_fork_tasks_param(self): - """Gets the dynamic_fork_tasks_param of this WorkflowTask. # noqa: E501 - - - :return: The dynamic_fork_tasks_param of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._dynamic_fork_tasks_param - - @dynamic_fork_tasks_param.setter - def dynamic_fork_tasks_param(self, dynamic_fork_tasks_param): - """Sets the dynamic_fork_tasks_param of this WorkflowTask. - - - :param dynamic_fork_tasks_param: The dynamic_fork_tasks_param of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._dynamic_fork_tasks_param = dynamic_fork_tasks_param - - @property - def dynamic_fork_tasks_input_param_name(self): - """Gets the dynamic_fork_tasks_input_param_name of this WorkflowTask. # noqa: E501 - - - :return: The dynamic_fork_tasks_input_param_name of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._dynamic_fork_tasks_input_param_name - - @dynamic_fork_tasks_input_param_name.setter - def dynamic_fork_tasks_input_param_name(self, dynamic_fork_tasks_input_param_name): - """Sets the dynamic_fork_tasks_input_param_name of this WorkflowTask. - - - :param dynamic_fork_tasks_input_param_name: The dynamic_fork_tasks_input_param_name of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._dynamic_fork_tasks_input_param_name = dynamic_fork_tasks_input_param_name - - @property - def default_case(self): - """Gets the default_case of this WorkflowTask. # noqa: E501 - - - :return: The default_case of this WorkflowTask. # noqa: E501 - :rtype: list[WorkflowTask] - """ - return self._default_case - - @default_case.setter - def default_case(self, default_case): - """Sets the default_case of this WorkflowTask. - - - :param default_case: The default_case of this WorkflowTask. # noqa: E501 - :type: list[WorkflowTask] - """ - - self._default_case = default_case - - @property - def fork_tasks(self): - """Gets the fork_tasks of this WorkflowTask. # noqa: E501 - - - :return: The fork_tasks of this WorkflowTask. # noqa: E501 - :rtype: list[list[WorkflowTask]] - """ - return self._fork_tasks - - @fork_tasks.setter - def fork_tasks(self, fork_tasks): - """Sets the fork_tasks of this WorkflowTask. - - - :param fork_tasks: The fork_tasks of this WorkflowTask. # noqa: E501 - :type: list[list[WorkflowTask]] - """ - - self._fork_tasks = fork_tasks - - @property - def start_delay(self): - """Gets the start_delay of this WorkflowTask. # noqa: E501 - - - :return: The start_delay of this WorkflowTask. # noqa: E501 - :rtype: int - """ - return self._start_delay - - @start_delay.setter - def start_delay(self, start_delay): - """Sets the start_delay of this WorkflowTask. - - - :param start_delay: The start_delay of this WorkflowTask. # noqa: E501 - :type: int - """ - - self._start_delay = start_delay - - @property - def sub_workflow_param(self): - """Gets the sub_workflow_param of this WorkflowTask. # noqa: E501 - - - :return: The sub_workflow_param of this WorkflowTask. # noqa: E501 - :rtype: SubWorkflowParams - """ - return self._sub_workflow_param - - @sub_workflow_param.setter - def sub_workflow_param(self, sub_workflow_param): - """Sets the sub_workflow_param of this WorkflowTask. - - - :param sub_workflow_param: The sub_workflow_param of this WorkflowTask. # noqa: E501 - :type: SubWorkflowParams - """ - - self._sub_workflow_param = sub_workflow_param - - @property - def join_on(self): - """Gets the join_on of this WorkflowTask. # noqa: E501 - - - :return: The join_on of this WorkflowTask. # noqa: E501 - :rtype: list[str] - """ - return self._join_on - - @join_on.setter - def join_on(self, join_on): - """Sets the join_on of this WorkflowTask. - - - :param join_on: The join_on of this WorkflowTask. # noqa: E501 - :type: list[str] - """ - - self._join_on = join_on - - @property - def sink(self): - """Gets the sink of this WorkflowTask. # noqa: E501 - - - :return: The sink of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._sink - - @sink.setter - def sink(self, sink): - """Sets the sink of this WorkflowTask. - - - :param sink: The sink of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._sink = sink - - @property - def optional(self): - """Gets the optional of this WorkflowTask. # noqa: E501 - - - :return: The optional of this WorkflowTask. # noqa: E501 - :rtype: bool - """ - return self._optional - - @optional.setter - def optional(self, optional): - """Sets the optional of this WorkflowTask. - - - :param optional: The optional of this WorkflowTask. # noqa: E501 - :type: bool - """ - - self._optional = optional - - @property - def task_definition(self): - """Gets the task_definition of this WorkflowTask. # noqa: E501 - - - :return: The task_definition of this WorkflowTask. # noqa: E501 - :rtype: TaskDef - """ - return self._task_definition - - @task_definition.setter - def task_definition(self, task_definition): - """Sets the task_definition of this WorkflowTask. - - - :param task_definition: The task_definition of this WorkflowTask. # noqa: E501 - :type: TaskDef - """ - - self._task_definition = task_definition - - @property - def rate_limited(self): - """Gets the rate_limited of this WorkflowTask. # noqa: E501 - - - :return: The rate_limited of this WorkflowTask. # noqa: E501 - :rtype: bool - """ - return self._rate_limited - - @rate_limited.setter - def rate_limited(self, rate_limited): - """Sets the rate_limited of this WorkflowTask. - - - :param rate_limited: The rate_limited of this WorkflowTask. # noqa: E501 - :type: bool - """ - - self._rate_limited = rate_limited - - @property - def default_exclusive_join_task(self): - """Gets the default_exclusive_join_task of this WorkflowTask. # noqa: E501 - - - :return: The default_exclusive_join_task of this WorkflowTask. # noqa: E501 - :rtype: list[str] - """ - return self._default_exclusive_join_task - - @default_exclusive_join_task.setter - def default_exclusive_join_task(self, default_exclusive_join_task): - """Sets the default_exclusive_join_task of this WorkflowTask. - - - :param default_exclusive_join_task: The default_exclusive_join_task of this WorkflowTask. # noqa: E501 - :type: list[str] - """ - - self._default_exclusive_join_task = default_exclusive_join_task - - @property - def async_complete(self): - """Gets the async_complete of this WorkflowTask. # noqa: E501 - - - :return: The async_complete of this WorkflowTask. # noqa: E501 - :rtype: bool - """ - return self._async_complete - - @async_complete.setter - def async_complete(self, async_complete): - """Sets the async_complete of this WorkflowTask. - - - :param async_complete: The async_complete of this WorkflowTask. # noqa: E501 - :type: bool - """ - - self._async_complete = async_complete - - @property - def loop_condition(self): - """Gets the loop_condition of this WorkflowTask. # noqa: E501 - - - :return: The loop_condition of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._loop_condition - - @loop_condition.setter - def loop_condition(self, loop_condition): - """Sets the loop_condition of this WorkflowTask. - - - :param loop_condition: The loop_condition of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._loop_condition = loop_condition - - @property - def loop_over(self): - """Gets the loop_over of this WorkflowTask. # noqa: E501 - - - :return: The loop_over of this WorkflowTask. # noqa: E501 - :rtype: list[WorkflowTask] - """ - return self._loop_over - - @loop_over.setter - def loop_over(self, loop_over): - """Sets the loop_over of this WorkflowTask. - - - :param loop_over: The loop_over of this WorkflowTask. # noqa: E501 - :type: list[WorkflowTask] - """ - - self._loop_over = loop_over - - @property - def retry_count(self): - """Gets the retry_count of this WorkflowTask. # noqa: E501 - - - :return: The retry_count of this WorkflowTask. # noqa: E501 - :rtype: int - """ - return self._retry_count - - @retry_count.setter - def retry_count(self, retry_count): - """Sets the retry_count of this WorkflowTask. - - - :param retry_count: The retry_count of this WorkflowTask. # noqa: E501 - :type: int - """ - - self._retry_count = retry_count - - @property - def evaluator_type(self): - """Gets the evaluator_type of this WorkflowTask. # noqa: E501 - - - :return: The evaluator_type of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._evaluator_type - - @evaluator_type.setter - def evaluator_type(self, evaluator_type): - """Sets the evaluator_type of this WorkflowTask. - - - :param evaluator_type: The evaluator_type of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._evaluator_type = evaluator_type - - @property - def expression(self): - """Gets the expression of this WorkflowTask. # noqa: E501 - - - :return: The expression of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._expression - - @expression.setter - def expression(self, expression): - """Sets the expression of this WorkflowTask. - - - :param expression: The expression of this WorkflowTask. # noqa: E501 - :type: str - """ - - self._expression = expression - - @property - @deprecated - def workflow_task_type(self): - """Gets the workflow_task_type of this WorkflowTask. # noqa: E501 - - - :return: The workflow_task_type of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._workflow_task_type - - @workflow_task_type.setter - @deprecated - def workflow_task_type(self, workflow_task_type): - """Sets the workflow_task_type of this WorkflowTask. - - - :param workflow_task_type: The workflow_task_type of this WorkflowTask. # noqa: E501 - :type: str - """ - self._workflow_task_type = workflow_task_type - - @property - def on_state_change(self) -> Dict[str, List[StateChangeEvent]]: - """Gets the on_state_change of this WorkflowTask. # noqa: E501 - - - :return: The on_state_change of this WorkflowTask. # noqa: E501 - :rtype: Dict[str, List[StateChangeEvent]] - """ - return self._on_state_change - - @on_state_change.setter - def on_state_change(self, state_change: StateChangeConfig): - """Sets the on_state_change of this WorkflowTask. - - - :param state_change: The on_state_change of this WorkflowTask. # noqa: E501 - :type: StateChangeConfig - """ - self._on_state_change = { - state_change.type: state_change.events - } - - @property - def cache_config(self) -> CacheConfig: - """Gets the cache_config of this WorkflowTask. # noqa: E501 - - - :return: The cache_config of this WorkflowTask. # noqa: E501 - :rtype: CacheConfig - """ - return self._cache_config - - @cache_config.setter - def cache_config(self, cache_config: CacheConfig): - """Sets the cache_config of this WorkflowTask. - - - :param cache_config: The cache_config of this WorkflowTask. # noqa: E501 - :type: CacheConfig - """ - self._cache_config = cache_config - - @property - def join_status(self): - """Gets the join_status of this WorkflowTask. # noqa: E501 - - - :return: The join_status of this WorkflowTask. # noqa: E501 - :rtype: str - """ - return self._join_status - - @join_status.setter - def join_status(self, join_status): - """Sets the join_status of this WorkflowTask. - - - :param join_status: The join_status of this WorkflowTask. # noqa: E501 - :type: str - """ - self._join_status = join_status - - @property - def permissive(self): - """Gets the permissive of this WorkflowTask. # noqa: E501 - - - :return: The permissive of this WorkflowTask. # noqa: E501 - :rtype: bool - """ - return self._permissive - - @permissive.setter - def permissive(self, permissive): - """Sets the permissive of this WorkflowTask. - - - :param permissive: The permissive of this WorkflowTask. # noqa: E501 - :type: bool - """ - self._permissive = permissive - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkflowTask, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkflowTask): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["WorkflowTask", "CacheConfig"] diff --git a/src/conductor/client/http/models/workflow_test_request.py b/src/conductor/client/http/models/workflow_test_request.py index 82b524fc..b178d2f1 100644 --- a/src/conductor/client/http/models/workflow_test_request.py +++ b/src/conductor/client/http/models/workflow_test_request.py @@ -1,562 +1,6 @@ -# coding: utf-8 +from conductor.client.adapters.models.workflow_test_request_adapter import \ + WorkflowTestRequestAdapter -import pprint -import re # noqa: F401 -from dataclasses import dataclass, field, InitVar -from typing import Dict, List, Optional, Any -import six -from deprecated import deprecated +WorkflowTestRequest = WorkflowTestRequestAdapter - -@dataclass -class WorkflowTestRequest: - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'correlation_id': 'str', - 'created_by': 'str', - 'external_input_payload_storage_path': 'str', - 'input': 'dict(str, object)', - 'name': 'str', - 'priority': 'int', - 'sub_workflow_test_request': 'dict(str, WorkflowTestRequest)', - 'task_ref_to_mock_output': 'dict(str, list[TaskMock])', - 'task_to_domain': 'dict(str, str)', - 'version': 'int', - 'workflow_def': 'WorkflowDef' - } - - attribute_map = { - 'correlation_id': 'correlationId', - 'created_by': 'createdBy', - 'external_input_payload_storage_path': 'externalInputPayloadStoragePath', - 'input': 'input', - 'name': 'name', - 'priority': 'priority', - 'sub_workflow_test_request': 'subWorkflowTestRequest', - 'task_ref_to_mock_output': 'taskRefToMockOutput', - 'task_to_domain': 'taskToDomain', - 'version': 'version', - 'workflow_def': 'workflowDef' - } - - _correlation_id: Optional[str] = field(default=None) - _created_by: Optional[str] = field(default=None) - _external_input_payload_storage_path: Optional[str] = field(default=None) - _input: Optional[Dict[str, Any]] = field(default=None) - _name: Optional[str] = field(default=None) - _priority: Optional[int] = field(default=None) - _sub_workflow_test_request: Optional[Dict[str, 'WorkflowTestRequest']] = field(default=None) - _task_ref_to_mock_output: Optional[Dict[str, List['TaskMock']]] = field(default=None) - _task_to_domain: Optional[Dict[str, str]] = field(default=None) - _version: Optional[int] = field(default=None) - _workflow_def: Optional[Any] = field(default=None) - - # InitVars for constructor parameters - correlation_id: InitVar[Optional[str]] = None - created_by: InitVar[Optional[str]] = None - external_input_payload_storage_path: InitVar[Optional[str]] = None - input: InitVar[Optional[Dict[str, Any]]] = None - name: InitVar[Optional[str]] = None - priority: InitVar[Optional[int]] = None - sub_workflow_test_request: InitVar[Optional[Dict[str, 'WorkflowTestRequest']]] = None - task_ref_to_mock_output: InitVar[Optional[Dict[str, List['TaskMock']]]] = None - task_to_domain: InitVar[Optional[Dict[str, str]]] = None - version: InitVar[Optional[int]] = None - workflow_def: InitVar[Optional[Any]] = None - - discriminator: Optional[str] = field(default=None, init=False) - - def __init__(self, correlation_id=None, created_by=None, external_input_payload_storage_path=None, input=None, - name=None, priority=None, sub_workflow_test_request=None, task_ref_to_mock_output=None, - task_to_domain=None, version=None, workflow_def=None): # noqa: E501 - """WorkflowTestRequest - a model defined in Swagger""" # noqa: E501 - self._correlation_id = None - self._created_by = None - self._external_input_payload_storage_path = None - self._input = None - self._name = None - self._priority = None - self._sub_workflow_test_request = None - self._task_ref_to_mock_output = None - self._task_to_domain = None - self._version = None - self._workflow_def = None - self.discriminator = None - if correlation_id is not None: - self.correlation_id = correlation_id - if created_by is not None: - self.created_by = created_by - if external_input_payload_storage_path is not None: - self.external_input_payload_storage_path = external_input_payload_storage_path - if input is not None: - self.input = input - self.name = name - if priority is not None: - self.priority = priority - if sub_workflow_test_request is not None: - self.sub_workflow_test_request = sub_workflow_test_request - if task_ref_to_mock_output is not None: - self.task_ref_to_mock_output = task_ref_to_mock_output - if task_to_domain is not None: - self.task_to_domain = task_to_domain - if version is not None: - self.version = version - if workflow_def is not None: - self.workflow_def = workflow_def - - def __post_init__(self, correlation_id, created_by, external_input_payload_storage_path, input, - name, priority, sub_workflow_test_request, task_ref_to_mock_output, - task_to_domain, version, workflow_def): - if correlation_id is not None: - self.correlation_id = correlation_id - if created_by is not None: - self.created_by = created_by - if external_input_payload_storage_path is not None: - self.external_input_payload_storage_path = external_input_payload_storage_path - if input is not None: - self.input = input - if name is not None: - self.name = name - if priority is not None: - self.priority = priority - if sub_workflow_test_request is not None: - self.sub_workflow_test_request = sub_workflow_test_request - if task_ref_to_mock_output is not None: - self.task_ref_to_mock_output = task_ref_to_mock_output - if task_to_domain is not None: - self.task_to_domain = task_to_domain - if version is not None: - self.version = version - if workflow_def is not None: - self.workflow_def = workflow_def - - @property - def correlation_id(self): - """Gets the correlation_id of this WorkflowTestRequest. # noqa: E501 - - - :return: The correlation_id of this WorkflowTestRequest. # noqa: E501 - :rtype: str - """ - return self._correlation_id - - @correlation_id.setter - def correlation_id(self, correlation_id): - """Sets the correlation_id of this WorkflowTestRequest. - - - :param correlation_id: The correlation_id of this WorkflowTestRequest. # noqa: E501 - :type: str - """ - - self._correlation_id = correlation_id - - @property - def created_by(self): - """Gets the created_by of this WorkflowTestRequest. # noqa: E501 - - - :return: The created_by of this WorkflowTestRequest. # noqa: E501 - :rtype: str - """ - return self._created_by - - @created_by.setter - def created_by(self, created_by): - """Sets the created_by of this WorkflowTestRequest. - - - :param created_by: The created_by of this WorkflowTestRequest. # noqa: E501 - :type: str - """ - - self._created_by = created_by - - @property - def external_input_payload_storage_path(self): - """Gets the external_input_payload_storage_path of this WorkflowTestRequest. # noqa: E501 - - - :return: The external_input_payload_storage_path of this WorkflowTestRequest. # noqa: E501 - :rtype: str - """ - return self._external_input_payload_storage_path - - @external_input_payload_storage_path.setter - def external_input_payload_storage_path(self, external_input_payload_storage_path): - """Sets the external_input_payload_storage_path of this WorkflowTestRequest. - - - :param external_input_payload_storage_path: The external_input_payload_storage_path of this WorkflowTestRequest. # noqa: E501 - :type: str - """ - - self._external_input_payload_storage_path = external_input_payload_storage_path - - @property - def input(self): - """Gets the input of this WorkflowTestRequest. # noqa: E501 - - - :return: The input of this WorkflowTestRequest. # noqa: E501 - :rtype: dict(str, object) - """ - return self._input - - @input.setter - def input(self, input): - """Sets the input of this WorkflowTestRequest. - - - :param input: The input of this WorkflowTestRequest. # noqa: E501 - :type: dict(str, object) - """ - - self._input = input - - @property - def name(self): - """Gets the name of this WorkflowTestRequest. # noqa: E501 - - - :return: The name of this WorkflowTestRequest. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this WorkflowTestRequest. - - - :param name: The name of this WorkflowTestRequest. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def priority(self): - """Gets the priority of this WorkflowTestRequest. # noqa: E501 - - - :return: The priority of this WorkflowTestRequest. # noqa: E501 - :rtype: int - """ - return self._priority - - @priority.setter - def priority(self, priority): - """Sets the priority of this WorkflowTestRequest. - - - :param priority: The priority of this WorkflowTestRequest. # noqa: E501 - :type: int - """ - - self._priority = priority - - @property - def sub_workflow_test_request(self): - """Gets the sub_workflow_test_request of this WorkflowTestRequest. # noqa: E501 - - - :return: The sub_workflow_test_request of this WorkflowTestRequest. # noqa: E501 - :rtype: dict(str, WorkflowTestRequest) - """ - return self._sub_workflow_test_request - - @sub_workflow_test_request.setter - def sub_workflow_test_request(self, sub_workflow_test_request): - """Sets the sub_workflow_test_request of this WorkflowTestRequest. - - - :param sub_workflow_test_request: The sub_workflow_test_request of this WorkflowTestRequest. # noqa: E501 - :type: dict(str, WorkflowTestRequest) - """ - - self._sub_workflow_test_request = sub_workflow_test_request - - @property - def task_ref_to_mock_output(self): - """Gets the task_ref_to_mock_output of this WorkflowTestRequest. # noqa: E501 - - - :return: The task_ref_to_mock_output of this WorkflowTestRequest. # noqa: E501 - :rtype: dict(str, list[TaskMock]) - """ - return self._task_ref_to_mock_output - - @task_ref_to_mock_output.setter - def task_ref_to_mock_output(self, task_ref_to_mock_output): - """Sets the task_ref_to_mock_output of this WorkflowTestRequest. - - - :param task_ref_to_mock_output: The task_ref_to_mock_output of this WorkflowTestRequest. # noqa: E501 - :type: dict(str, list[TaskMock]) - """ - - self._task_ref_to_mock_output = task_ref_to_mock_output - - @property - def task_to_domain(self): - """Gets the task_to_domain of this WorkflowTestRequest. # noqa: E501 - - - :return: The task_to_domain of this WorkflowTestRequest. # noqa: E501 - :rtype: dict(str, str) - """ - return self._task_to_domain - - @task_to_domain.setter - def task_to_domain(self, task_to_domain): - """Sets the task_to_domain of this WorkflowTestRequest. - - - :param task_to_domain: The task_to_domain of this WorkflowTestRequest. # noqa: E501 - :type: dict(str, str) - """ - - self._task_to_domain = task_to_domain - - @property - def version(self): - """Gets the version of this WorkflowTestRequest. # noqa: E501 - - - :return: The version of this WorkflowTestRequest. # noqa: E501 - :rtype: int - """ - return self._version - - @version.setter - def version(self, version): - """Sets the version of this WorkflowTestRequest. - - - :param version: The version of this WorkflowTestRequest. # noqa: E501 - :type: int - """ - - self._version = version - - @property - def workflow_def(self): - """Gets the workflow_def of this WorkflowTestRequest. # noqa: E501 - - - :return: The workflow_def of this WorkflowTestRequest. # noqa: E501 - :rtype: WorkflowDef - """ - return self._workflow_def - - @workflow_def.setter - def workflow_def(self, workflow_def): - """Sets the workflow_def of this WorkflowTestRequest. - - - :param workflow_def: The workflow_def of this WorkflowTestRequest. # noqa: E501 - :type: WorkflowDef - """ - - self._workflow_def = workflow_def - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkflowTestRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkflowTestRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - -@dataclass -class TaskMock: - """Task mock for workflow testing""" - - _status: str = field(default="COMPLETED") - _output: Optional[Dict[str, Any]] = field(default=None) - _execution_time: int = field(default=0) - _queue_wait_time: int = field(default=0) - - # InitVars for constructor parameters - status: InitVar[Optional[str]] = "COMPLETED" - output: InitVar[Optional[Dict[str, Any]]] = None - execution_time: InitVar[Optional[int]] = 0 - queue_wait_time: InitVar[Optional[int]] = 0 - - def __post_init__(self, status, output, execution_time, queue_wait_time): - if status is not None: - self.status = status - if output is not None: - self.output = output - if execution_time is not None: - self.execution_time = execution_time - if queue_wait_time is not None: - self.queue_wait_time = queue_wait_time - - @property - def status(self): - """Gets the status of this TaskMock. - - :return: The status of this TaskMock. - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this TaskMock. - - :param status: The status of this TaskMock. - :type: str - """ - self._status = status - - @property - def output(self): - """Gets the output of this TaskMock. - - :return: The output of this TaskMock. - :rtype: Dict[str, Any] - """ - return self._output - - @output.setter - def output(self, output): - """Sets the output of this TaskMock. - - :param output: The output of this TaskMock. - :type: Dict[str, Any] - """ - self._output = output - - @property - def execution_time(self): - """Gets the execution time of this TaskMock. - Time in millis for the execution of the task. - - :return: The execution_time of this TaskMock. - :rtype: int - """ - return self._execution_time - - @execution_time.setter - def execution_time(self, execution_time): - """Sets the execution time of this TaskMock. - Time in millis for the execution of the task. - - :param execution_time: The execution_time of this TaskMock. - :type: int - """ - self._execution_time = execution_time - - @property - def queue_wait_time(self): - """Gets the queue wait time of this TaskMock. - Time in millis for the wait time in the queue. - - :return: The queue_wait_time of this TaskMock. - :rtype: int - """ - return self._queue_wait_time - - @queue_wait_time.setter - def queue_wait_time(self, queue_wait_time): - """Sets the queue wait time of this TaskMock. - Time in millis for the wait time in the queue. - - :param queue_wait_time: The queue_wait_time of this TaskMock. - :type: int - """ - self._queue_wait_time = queue_wait_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - for attr in ['status', 'output', 'execution_time', 'queue_wait_time']: - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TaskMock): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other \ No newline at end of file +__all__ = ["WorkflowTestRequest"] diff --git a/src/conductor/client/orkes/api/tags_api.py b/src/conductor/client/orkes/api/tags_api.py index 36320b3d..91ddb827 100644 --- a/src/conductor/client/orkes/api/tags_api.py +++ b/src/conductor/client/orkes/api/tags_api.py @@ -17,7 +17,7 @@ # python 2 and python 3 compatibility library import six -from conductor.client.http.api_client import ApiClient +from conductor.client.codegen.api_client import ApiClient class TagsApi(object): @@ -41,8 +41,8 @@ def add_task_tag(self, body, task_name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param TagObject body: (required) - :param str task_name: (required) + :param Tag body: (required) + :param object task_name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -63,8 +63,8 @@ def add_task_tag_with_http_info(self, body, task_name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param TagObject body: (required) - :param str task_name: (required) + :param Tag body: (required) + :param object task_name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -146,8 +146,8 @@ def add_workflow_tag(self, body, name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param TagObject body: (required) - :param str name: (required) + :param Tag body: (required) + :param object name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -168,8 +168,8 @@ def add_workflow_tag_with_http_info(self, body, name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param TagObject body: (required) - :param str name: (required) + :param Tag body: (required) + :param object name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -251,8 +251,8 @@ def delete_task_tag(self, body, task_name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param TagString body: (required) - :param str task_name: (required) + :param Tag body: (required) + :param object task_name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -273,8 +273,8 @@ def delete_task_tag_with_http_info(self, body, task_name, **kwargs): # noqa: E5 >>> result = thread.get() :param async_req bool - :param TagString body: (required) - :param str task_name: (required) + :param Tag body: (required) + :param object task_name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -356,8 +356,8 @@ def delete_workflow_tag(self, body, name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param TagObject body: (required) - :param str name: (required) + :param Tag body: (required) + :param object name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -378,8 +378,8 @@ def delete_workflow_tag_with_http_info(self, body, name, **kwargs): # noqa: E50 >>> result = thread.get() :param async_req bool - :param TagObject body: (required) - :param str name: (required) + :param Tag body: (required) + :param object name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -461,7 +461,7 @@ def get_tags1(self, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :return: list[TagObject] + :return: object If the method is called asynchronously, returns the request thread. """ @@ -481,7 +481,7 @@ def get_tags1_with_http_info(self, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :return: list[TagObject] + :return: object If the method is called asynchronously, returns the request thread. """ @@ -529,7 +529,7 @@ def get_tags1_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='list[TagObject]', # noqa: E501 + response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -546,8 +546,8 @@ def get_task_tags(self, task_name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str task_name: (required) - :return: list[TagObject] + :param object task_name: (required) + :return: object If the method is called asynchronously, returns the request thread. """ @@ -567,8 +567,8 @@ def get_task_tags_with_http_info(self, task_name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str task_name: (required) - :return: list[TagObject] + :param object task_name: (required) + :return: object If the method is called asynchronously, returns the request thread. """ @@ -622,7 +622,7 @@ def get_task_tags_with_http_info(self, task_name, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='list[TagObject]', # noqa: E501 + response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -639,8 +639,8 @@ def get_workflow_tags(self, name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str name: (required) - :return: list[TagObject] + :param object name: (required) + :return: object If the method is called asynchronously, returns the request thread. """ @@ -660,8 +660,8 @@ def get_workflow_tags_with_http_info(self, name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str name: (required) - :return: list[TagObject] + :param object name: (required) + :return: object If the method is called asynchronously, returns the request thread. """ @@ -715,7 +715,7 @@ def get_workflow_tags_with_http_info(self, name, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='list[TagObject]', # noqa: E501 + response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -724,7 +724,7 @@ def get_workflow_tags_with_http_info(self, name, **kwargs): # noqa: E501 collection_formats=collection_formats) def set_task_tags(self, body, task_name, **kwargs): # noqa: E501 - """Adds the tag to the task # noqa: E501 + """Sets (replaces existing) the tags to the task # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -732,8 +732,8 @@ def set_task_tags(self, body, task_name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param list[TagObject] body: (required) - :param str task_name: (required) + :param object body: (required) + :param object task_name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -746,7 +746,7 @@ def set_task_tags(self, body, task_name, **kwargs): # noqa: E501 return data def set_task_tags_with_http_info(self, body, task_name, **kwargs): # noqa: E501 - """Adds the tag to the task # noqa: E501 + """Sets (replaces existing) the tags to the task # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -754,8 +754,8 @@ def set_task_tags_with_http_info(self, body, task_name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param list[TagObject] body: (required) - :param str task_name: (required) + :param object body: (required) + :param object task_name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -829,7 +829,7 @@ def set_task_tags_with_http_info(self, body, task_name, **kwargs): # noqa: E501 collection_formats=collection_formats) def set_workflow_tags(self, body, name, **kwargs): # noqa: E501 - """Set the tags of the workflow # noqa: E501 + """Set (replaces all existing) the tags of the workflow # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -837,8 +837,8 @@ def set_workflow_tags(self, body, name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) + :param object body: (required) + :param object name: (required) :return: object If the method is called asynchronously, returns the request thread. @@ -851,7 +851,7 @@ def set_workflow_tags(self, body, name, **kwargs): # noqa: E501 return data def set_workflow_tags_with_http_info(self, body, name, **kwargs): # noqa: E501 - """Set the tags of the workflow # noqa: E501 + """Set (replaces all existing) the tags of the workflow # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -859,8 +859,8 @@ def set_workflow_tags_with_http_info(self, body, name, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param list[TagObject] body: (required) - :param str name: (required) + :param object body: (required) + :param object name: (required) :return: object If the method is called asynchronously, returns the request thread. diff --git a/src/conductor/client/orkes/orkes_authorization_client.py b/src/conductor/client/orkes/orkes_authorization_client.py index e3c4601e..1da93bd5 100644 --- a/src/conductor/client/orkes/orkes_authorization_client.py +++ b/src/conductor/client/orkes/orkes_authorization_client.py @@ -59,13 +59,13 @@ def remove_role_from_application_user(self, application_id: str, role: str): self.applicationResourceApi.remove_role_from_application_user(application_id, role) def set_application_tags(self, tags: List[MetadataTag], application_id: str): - self.applicationResourceApi.put_tags_for_application(tags, application_id) + self.applicationResourceApi.put_tag_for_application(tags, application_id) def get_application_tags(self, application_id: str) -> List[MetadataTag]: return self.applicationResourceApi.get_tags_for_application(application_id) def delete_application_tags(self, tags: List[MetadataTag], application_id: str): - self.applicationResourceApi.delete_tags_for_application(tags, application_id) + self.applicationResourceApi.put_tag_for_application(tags, application_id) def create_access_key(self, application_id: str) -> CreatedAccessKey: key_obj = self.applicationResourceApi.create_access_key(application_id) @@ -147,16 +147,17 @@ def get_permissions(self, target: TargetRef) -> Dict[str, List[SubjectRef]]: resp_obj = self.authorizationResourceApi.get_permissions(target.type.name, target.id) permissions = {} for access_type, subjects in resp_obj.items(): - subject_list = [SubjectRef(sub["type"], sub["id"]) for sub in subjects] + subject_list = [SubjectRef(sub["id"], sub["type"]) for sub in subjects] permissions[access_type] = subject_list return permissions def get_granted_permissions_for_group(self, group_id: str) -> List[GrantedPermission]: granted_access_obj = self.groupResourceApi.get_granted_permissions1(group_id) granted_permissions = [] - for ga in granted_access_obj["grantedAccess"]: - target = TargetRef(ga["target"]["type"], ga["target"]["id"]) - access = ga["access"] + + for ga in granted_access_obj.granted_access: + target = TargetRef(ga.target.id, ga.target.type) + access = ga.access granted_permissions.append(GrantedPermission(target, access)) return granted_permissions @@ -164,7 +165,7 @@ def get_granted_permissions_for_user(self, user_id: str) -> List[GrantedPermissi granted_access_obj = self.userResourceApi.get_granted_permissions(user_id) granted_permissions = [] for ga in granted_access_obj["grantedAccess"]: - target = TargetRef(ga["target"]["type"], ga["target"]["id"]) + target = TargetRef(ga["target"]["id"], ga["target"]["type"]) access = ga["access"] granted_permissions.append(GrantedPermission(target, access)) return granted_permissions diff --git a/src/conductor/client/orkes/orkes_base_client.py b/src/conductor/client/orkes/orkes_base_client.py index 6f8a6f0b..02cc78c3 100644 --- a/src/conductor/client/orkes/orkes_base_client.py +++ b/src/conductor/client/orkes/orkes_base_client.py @@ -15,7 +15,7 @@ from conductor.client.http.api.user_resource_api import UserResourceApi from conductor.client.http.api.workflow_resource_api import WorkflowResourceApi from conductor.client.http.api_client import ApiClient -from conductor.client.orkes.api.tags_api import TagsApi +from conductor.client.http.api.tags_api import TagsApi class OrkesBaseClient(object): diff --git a/src/conductor/client/orkes/orkes_integration_client.py b/src/conductor/client/orkes/orkes_integration_client.py index 0c67ab2f..9709ff72 100644 --- a/src/conductor/client/orkes/orkes_integration_client.py +++ b/src/conductor/client/orkes/orkes_integration_client.py @@ -1,14 +1,27 @@ from __future__ import absolute_import -from typing import List +from typing import List, Optional, Dict from conductor.client.configuration.configuration import Configuration -from conductor.client.http.models.integration import Integration -from conductor.client.http.models.integration_api import IntegrationApi -from conductor.client.http.models.integration_api_update import IntegrationApiUpdate -from conductor.client.http.models.integration_update import IntegrationUpdate -from conductor.client.http.models.prompt_template import PromptTemplate -from conductor.client.http.rest import ApiException +from conductor.client.http.models.integration import ( + Integration +) +from conductor.client.http.models.integration_api import ( + IntegrationApi +) +from conductor.client.http.models.integration_api_update import ( + IntegrationApiUpdate +) +from conductor.client.http.models.integration_update import ( + IntegrationUpdate +) +from conductor.client.http.models.integration_def import ( + IntegrationDef +) +from conductor.client.http.models.prompt_template import ( + PromptTemplate +) +from conductor.client.codegen.rest import ApiException from conductor.client.integration_client import IntegrationClient from conductor.client.orkes.orkes_base_client import OrkesBaseClient @@ -18,8 +31,12 @@ class OrkesIntegrationClient(OrkesBaseClient, IntegrationClient): def __init__(self, configuration: Configuration): super(OrkesIntegrationClient, self).__init__(configuration) - def associate_prompt_with_integration(self, ai_integration: str, model_name: str, prompt_name: str): - self.integrationApi.associate_prompt_with_integration(ai_integration, model_name, prompt_name) + def associate_prompt_with_integration( + self, ai_integration: str, model_name: str, prompt_name: str + ): + self.integrationApi.associate_prompt_with_integration( + ai_integration, model_name, prompt_name + ) def delete_integration_api(self, api_name: str, integration_name: str): self.integrationApi.delete_integration_api(api_name, integration_name) @@ -27,7 +44,9 @@ def delete_integration_api(self, api_name: str, integration_name: str): def delete_integration(self, integration_name: str): self.integrationApi.delete_integration_provider(integration_name) - def get_integration_api(self, api_name: str, integration_name: str) -> IntegrationApi: + def get_integration_api( + self, api_name: str, integration_name: str + ) -> IntegrationApi: try: return self.integrationApi.get_integration_api(api_name, integration_name) except ApiException as e: @@ -49,40 +68,128 @@ def get_integration(self, integration_name: str) -> Integration: def get_integrations(self) -> List[Integration]: return self.integrationApi.get_integration_providers() - def get_prompts_with_integration(self, ai_integration: str, model_name: str) -> List[PromptTemplate]: - return self.integrationApi.get_prompts_with_integration(ai_integration, model_name) - - def save_integration_api(self, integration_name, api_name, api_details: IntegrationApiUpdate): - self.integrationApi.save_integration_api(api_details, integration_name, api_name) + def get_integration_provider(self, name: str) -> IntegrationDef: + """Get integration provider by name""" + try: + return self.integrationApi.get_integration_provider(name) + except ApiException as e: + if e.is_not_found(): + return None + raise e - def save_integration(self, integration_name, integration_details: IntegrationUpdate): - self.integrationApi.save_integration_provider(integration_details, integration_name) + def get_integration_providers( + self, category: Optional[str] = None, active_only: Optional[bool] = None + ) -> List[IntegrationDef]: + """Get all integration providers with optional filtering""" + kwargs = {} + if category is not None: + kwargs["category"] = category + if active_only is not None: + kwargs["active_only"] = active_only + return self.integrationApi.get_integration_providers(**kwargs) + + def get_integration_provider_defs(self) -> List[IntegrationDef]: + """Get integration provider definitions""" + return self.integrationApi.get_integration_provider_defs() + + def get_prompts_with_integration( + self, ai_integration: str, model_name: str + ) -> List[PromptTemplate]: + return self.integrationApi.get_prompts_with_integration( + ai_integration, model_name + ) + + def save_integration_api( + self, integration_name, api_name, api_details: IntegrationApiUpdate + ): + print(f"Saving integration API: {api_name} for integration: {integration_name}") + self.integrationApi.save_integration_api( + body=api_details, name=api_name, integration_name=integration_name + ) + + def save_integration( + self, integration_name, integration_details: IntegrationUpdate + ): + self.integrationApi.save_integration_provider( + integration_details, integration_name + ) + + def save_integration_provider( + self, name: str, integration_details: IntegrationUpdate + ) -> None: + """Create or update an integration provider""" + self.integrationApi.save_integration_provider(integration_details, name) def get_token_usage_for_integration(self, name, integration_name) -> int: - return self.integrationApi.get_token_usage_for_integration(name, integration_name) + return self.integrationApi.get_token_usage_for_integration( + name, integration_name + ) def get_token_usage_for_integration_provider(self, name) -> dict: return self.integrationApi.get_token_usage_for_integration_provider(name) def register_token_usage(self, body, name, integration_name): - ... + return self.integrationApi.register_token_usage(body, name, integration_name) # Tags def delete_tag_for_integration(self, body, tag_name, integration_name): - """Delete an integration""" + return self.integrationApi.delete_tag_for_integration(body, tag_name, integration_name) def delete_tag_for_integration_provider(self, body, name): - ... + return self.integrationApi.delete_tag_for_integration_provider(body, name) def put_tag_for_integration(self, body, name, integration_name): - ... + return self.integrationApi.put_tag_for_integration(body, name, integration_name) def put_tag_for_integration_provider(self, body, name): - ... + return self.integrationApi.put_tag_for_integration_provider(body, name) def get_tags_for_integration(self, name, integration_name): - ... + return self.integrationApi.get_tags_for_integration(name, integration_name) def get_tags_for_integration_provider(self, name): - ... + return self.integrationApi.get_tags_for_integration_provider(name) + + # Utility Methods for Integration Provider Management + def get_integration_provider_by_category( + self, category: str, active_only: bool = True + ) -> List[IntegrationDef]: + """Get integration providers filtered by category""" + return self.get_integration_providers( + category=category, active_only=active_only + ) + + def get_active_integration_providers(self) -> List[IntegrationDef]: + """Get only active integration providers""" + return self.get_integration_providers(active_only=True) + + def get_integration_available_apis(self, name: str) -> List[IntegrationApi]: + """Get available APIs for an integration""" + return self.integrationApi.get_integration_available_apis(name) + + def save_all_integrations(self, request_body: List[IntegrationUpdate]) -> None: + """Save all integrations""" + self.integrationApi.save_all_integrations(request_body) + + def get_all_integrations( + self, category: Optional[str] = None, active_only: Optional[bool] = None + ) -> List[Integration]: + """Get all integrations with optional filtering""" + kwargs = {} + if category is not None: + kwargs["category"] = category + if active_only is not None: + kwargs["active_only"] = active_only + return self.integrationApi.get_all_integrations(**kwargs) + + def get_providers_and_integrations( + self, integration_type: Optional[str] = None, active_only: Optional[bool] = None + ) -> Dict[str, object]: + """Get providers and integrations together""" + kwargs = {} + if integration_type is not None: + kwargs["type"] = integration_type + if active_only is not None: + kwargs["active_only"] = active_only + return self.integrationApi.get_providers_and_integrations(**kwargs) diff --git a/src/conductor/client/orkes/orkes_metadata_client.py b/src/conductor/client/orkes/orkes_metadata_client.py index c618bb47..2358a6e0 100644 --- a/src/conductor/client/orkes/orkes_metadata_client.py +++ b/src/conductor/client/orkes/orkes_metadata_client.py @@ -19,7 +19,7 @@ def register_workflow_def(self, workflow_def: WorkflowDef, overwrite: Optional[b self.metadataResourceApi.create(workflow_def, overwrite=overwrite) def update_workflow_def(self, workflow_def: WorkflowDef, overwrite: Optional[bool] = True): - self.metadataResourceApi.update1([workflow_def], overwrite=overwrite) + self.metadataResourceApi.update([workflow_def], overwrite=overwrite) def unregister_workflow_def(self, name: str, version: int): self.metadataResourceApi.unregister_workflow_def(name, version) @@ -27,14 +27,14 @@ def unregister_workflow_def(self, name: str, version: int): def get_workflow_def(self, name: str, version: Optional[int] = None) -> WorkflowDef: workflow = None if version: - workflow = self.metadataResourceApi.get(name, version=version) + workflow = self.metadataResourceApi.get1(name, version=version) else: - workflow = self.metadataResourceApi.get(name) + workflow = self.metadataResourceApi.get1(name) return workflow def get_all_workflow_defs(self) -> List[WorkflowDef]: - return self.metadataResourceApi.get_all_workflows() + return self.metadataResourceApi.get_workflow_defs() def register_task_def(self, task_def: TaskDef): self.metadataResourceApi.register_task_def([task_def]) diff --git a/src/conductor/client/orkes/orkes_prompt_client.py b/src/conductor/client/orkes/orkes_prompt_client.py index 46eed51a..2d63cb03 100644 --- a/src/conductor/client/orkes/orkes_prompt_client.py +++ b/src/conductor/client/orkes/orkes_prompt_client.py @@ -4,8 +4,8 @@ from conductor.client.configuration.configuration import Configuration from conductor.client.http.models.prompt_template import PromptTemplate -from conductor.client.http.models.prompt_test_request import PromptTemplateTestRequest -from conductor.client.http.rest import ApiException +from conductor.client.http.models.prompt_template_test_request import PromptTemplateTestRequest +from conductor.client.codegen.rest import ApiException from conductor.client.orkes.models.metadata_tag import MetadataTag from conductor.client.orkes.orkes_base_client import OrkesBaseClient from conductor.client.prompt_client import PromptClient @@ -34,7 +34,7 @@ def delete_prompt(self, prompt_name: str): self.promptApi.delete_message_template(prompt_name) def get_tags_for_prompt_template(self, prompt_name: str) -> List[MetadataTag]: - self.promptApi.get_tags_for_prompt_template(prompt_name) + return self.promptApi.get_tags_for_prompt_template(prompt_name) def update_tag_for_prompt_template(self, prompt_name: str, tags: List[MetadataTag]): self.promptApi.put_tag_for_prompt_template(tags, prompt_name) diff --git a/src/conductor/client/orkes/orkes_scheduler_client.py b/src/conductor/client/orkes/orkes_scheduler_client.py index e9da5989..9da0042f 100644 --- a/src/conductor/client/orkes/orkes_scheduler_client.py +++ b/src/conductor/client/orkes/orkes_scheduler_client.py @@ -73,10 +73,10 @@ def search_schedule_executions(self, if sort: kwargs.update({"sort": sort}) if free_text: - kwargs.update({"freeText": free_text}) + kwargs.update({"free_text": free_text}) if query: kwargs.update({"query": query}) - return self.schedulerResourceApi.search_v21(**kwargs) + return self.schedulerResourceApi.search_v2(**kwargs) def requeue_all_execution_records(self): self.schedulerResourceApi.requeue_all_execution_records() diff --git a/src/conductor/client/orkes/orkes_task_client.py b/src/conductor/client/orkes/orkes_task_client.py index d78e7f53..09348bce 100644 --- a/src/conductor/client/orkes/orkes_task_client.py +++ b/src/conductor/client/orkes/orkes_task_client.py @@ -2,7 +2,7 @@ from typing import Optional, List from conductor.client.configuration.configuration import Configuration -from conductor.client.http.models import PollData +from conductor.client.http.models.poll_data import PollData from conductor.client.http.models.task import Task from conductor.client.http.models.task_exec_log import TaskExecLog from conductor.client.http.models.task_result import TaskResult diff --git a/src/conductor/client/orkes/orkes_workflow_client.py b/src/conductor/client/orkes/orkes_workflow_client.py index bba49765..9a9779b0 100644 --- a/src/conductor/client/orkes/orkes_workflow_client.py +++ b/src/conductor/client/orkes/orkes_workflow_client.py @@ -1,9 +1,12 @@ from __future__ import annotations from typing import Optional, List, Dict +import uuid from conductor.client.configuration.configuration import Configuration -from conductor.client.http.models import SkipTaskRequest, WorkflowStatus, \ - ScrollableSearchResultWorkflowSummary, SignalResponse +from conductor.client.http.models.skip_task_request import SkipTaskRequest +from conductor.client.http.models.workflow_status import WorkflowStatus +from conductor.client.http.models.scrollable_search_result_workflow_summary import ScrollableSearchResultWorkflowSummary +from conductor.client.http.models.signal_response import SignalResponse from conductor.client.http.models.correlation_ids_search_request import CorrelationIdsSearchRequest from conductor.client.http.models.rerun_workflow_request import RerunWorkflowRequest from conductor.client.http.models.start_workflow_request import StartWorkflowRequest @@ -123,7 +126,7 @@ def terminate_workflow(self, workflow_id: str, reason: Optional[str] = None, kwargs["reason"] = reason if trigger_failure_workflow: kwargs["trigger_failure_workflow"] = trigger_failure_workflow - self.workflowResourceApi.terminate(workflow_id, **kwargs) + self.workflowResourceApi.terminate1(workflow_id, **kwargs) def get_workflow(self, workflow_id: str, include_tasks: Optional[bool] = True) -> Workflow: kwargs = {} @@ -141,7 +144,7 @@ def get_workflow_status(self, workflow_id: str, include_output: Optional[bool] = return self.workflowResourceApi.get_workflow_status_summary(workflow_id, **kwargs) def delete_workflow(self, workflow_id: str, archive_workflow: Optional[bool] = True): - self.workflowResourceApi.delete(workflow_id, archive_workflow=archive_workflow) + self.workflowResourceApi.delete1(workflow_id, archive_workflow=archive_workflow) def skip_task_from_workflow(self, workflow_id: str, task_reference_name: str, request: SkipTaskRequest): self.workflowResourceApi.skip_task_from_workflow(workflow_id, task_reference_name, request) @@ -150,13 +153,13 @@ def test_workflow(self, test_request: WorkflowTestRequest) -> Workflow: return self.workflowResourceApi.test_workflow(test_request) def search(self, start: int = 0, size: int = 100, free_text: str = "*", query: Optional[str] = None, - query_id: Optional[str] = None) -> ScrollableSearchResultWorkflowSummary: + query_id: Optional[str] = None, skip_cache: bool = False) -> ScrollableSearchResultWorkflowSummary: args = { "start": start, "size": size, "free_text": free_text, "query": query, - "query_id": query_id + "skip_cache": skip_cache } return self.workflowResourceApi.search(**args) @@ -177,7 +180,7 @@ def get_by_correlation_ids_in_batch( kwargs["include_tasks"] = include_tasks if include_completed: kwargs["include_closed"] = include_completed - return self.workflowResourceApi.get_workflows_by_correlation_id_in_batch(**kwargs) + return self.workflowResourceApi.get_workflows1(**kwargs) def get_by_correlation_ids( self, @@ -200,18 +203,19 @@ def get_by_correlation_ids( ) def remove_workflow(self, workflow_id: str): - self.workflowResourceApi.delete(workflow_id) + self.workflowResourceApi.delete1(workflow_id) def update_variables(self, workflow_id: str, variables: Optional[Dict[str, object]] = None) -> None: variables = variables or {} self.workflowResourceApi.update_workflow_state(variables, workflow_id) - def update_state(self, workflow_id: str, update_requesst: WorkflowStateUpdate, + def update_state(self, workflow_id: str, update_request: WorkflowStateUpdate, wait_until_task_ref_names: Optional[List[str]] = None, wait_for_seconds: Optional[int] = None) -> WorkflowRun: kwargs = {} + request_id=str(uuid.uuid4()) if wait_until_task_ref_names is not None: kwargs["wait_until_task_ref"] = ",".join(wait_until_task_ref_names) if wait_for_seconds is not None: kwargs["wait_for_seconds"] = wait_for_seconds - return self.workflowResourceApi.update_workflow_and_task_state(update_requesst=update_requesst, workflow_id=workflow_id, **kwargs) + return self.workflowResourceApi.update_workflow_and_task_state(body=update_request, workflow_id=workflow_id, request_id=request_id, **kwargs) diff --git a/src/conductor/client/task_client.py b/src/conductor/client/task_client.py index 7eaff207..f96f6350 100644 --- a/src/conductor/client/task_client.py +++ b/src/conductor/client/task_client.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from typing import Optional, List -from conductor.client.http.models import PollData +from conductor.client.http.models.poll_data import PollData from conductor.client.http.models.workflow import Workflow from conductor.client.http.models.task import Task from conductor.client.http.models.task_result import TaskResult diff --git a/src/conductor/client/worker/worker.py b/src/conductor/client/worker/worker.py index 7668ce4d..254ec83c 100644 --- a/src/conductor/client/worker/worker.py +++ b/src/conductor/client/worker/worker.py @@ -13,55 +13,60 @@ from conductor.shared.automator.utils import convert_from_dict_or_list from conductor.client.configuration.configuration import Configuration from conductor.client.http.api_client import ApiClient -from conductor.client.http.models import TaskExecLog +from conductor.client.http.models.task_exec_log import TaskExecLog from conductor.client.http.models.task import Task from conductor.client.http.models.task_result import TaskResult from conductor.shared.http.enums import TaskResultStatus from conductor.shared.worker.exception import NonRetryableException -from conductor.client.worker.worker_interface import WorkerInterface, DEFAULT_POLLING_INTERVAL +from conductor.client.worker.worker_interface import WorkerInterface -ExecuteTaskFunction = Callable[ - [ - Union[Task, object] - ], - Union[TaskResult, object] -] +ExecuteTaskFunction = Callable[[Union[Task, object]], Union[TaskResult, object]] -logger = logging.getLogger( - Configuration.get_logging_formatted_name( - __name__ - ) -) +logger = logging.getLogger(Configuration.get_logging_formatted_name(__name__)) -def is_callable_input_parameter_a_task(callable: ExecuteTaskFunction, object_type: Any) -> bool: +def is_callable_input_parameter_a_task( + callable: ExecuteTaskFunction, object_type: Any +) -> bool: parameters = inspect.signature(callable).parameters if len(parameters) != 1: return False parameter = parameters[next(iter(parameters.keys()))] - return parameter.annotation == object_type or parameter.annotation == parameter.empty or parameter.annotation is object # noqa: PLR1714 + return ( + parameter.annotation == object_type + or parameter.annotation == parameter.empty + or parameter.annotation is object + ) # noqa: PLR1714 -def is_callable_return_value_of_type(callable: ExecuteTaskFunction, object_type: Any) -> bool: +def is_callable_return_value_of_type( + callable: ExecuteTaskFunction, object_type: Any +) -> bool: return_annotation = inspect.signature(callable).return_annotation return return_annotation == object_type class Worker(WorkerInterface): - def __init__(self, - task_definition_name: str, - execute_function: ExecuteTaskFunction, - poll_interval: Optional[float] = None, - domain: Optional[str] = None, - worker_id: Optional[str] = None, - ) -> Self: + def __init__( + self, + task_definition_name: str, + execute_function: ExecuteTaskFunction, + poll_interval: Optional[float] = None, + domain: Optional[str] = None, + worker_id: Optional[str] = None, + ) -> Self: super().__init__(task_definition_name) self.api_client = ApiClient() + self.config = Configuration() + if poll_interval is None: - self.poll_interval = DEFAULT_POLLING_INTERVAL + self.poll_interval = self.config.get_poll_interval() else: self.poll_interval = deepcopy(poll_interval) - self.domain = deepcopy(domain) + if domain is None: + self.domain = self.config.get_domain() + else: + self.domain = deepcopy(domain) if worker_id is None: self.worker_id = deepcopy(super().get_identity()) else: @@ -86,7 +91,9 @@ def execute(self, task: Task) -> TaskResult: if typ in utils.simple_types: task_input[input_name] = task.input_data[input_name] else: - task_input[input_name] = convert_from_dict_or_list(typ, task.input_data[input_name]) + task_input[input_name] = convert_from_dict_or_list( + typ, task.input_data[input_name] + ) elif default_value is not inspect.Parameter.empty: task_input[input_name] = default_value else: @@ -108,14 +115,16 @@ def execute(self, task: Task) -> TaskResult: except Exception as ne: logger.error( - "Error executing task %s with id %s. error = %s", + "Error executing task task_def_name: %s; task_id: %s", task.task_def_name, task.task_id, - traceback.format_exc() ) - task_result.logs = [TaskExecLog( - traceback.format_exc(), task_result.task_id, int(time.time()))] + task_result.logs = [ + TaskExecLog( + traceback.format_exc(), task_result.task_id, int(time.time()) + ) + ] task_result.status = TaskResultStatus.FAILED if len(ne.args) > 0: task_result.reason_for_incompletion = ne.args[0] @@ -126,7 +135,9 @@ def execute(self, task: Task) -> TaskResult: return task_result if not isinstance(task_result.output_data, dict): task_output = task_result.output_data - task_result.output_data = self.api_client.sanitize_for_serialization(task_output) + task_result.output_data = self.api_client.sanitize_for_serialization( + task_output + ) if not isinstance(task_result.output_data, dict): task_result.output_data = {"result": task_result.output_data} @@ -142,11 +153,15 @@ def execute_function(self) -> ExecuteTaskFunction: @execute_function.setter def execute_function(self, execute_function: ExecuteTaskFunction) -> None: self._execute_function = execute_function - self._is_execute_function_input_parameter_a_task = is_callable_input_parameter_a_task( - callable=execute_function, - object_type=Task, + self._is_execute_function_input_parameter_a_task = ( + is_callable_input_parameter_a_task( + callable=execute_function, + object_type=Task, + ) ) - self._is_execute_function_return_value_a_task_result = is_callable_return_value_of_type( - callable=execute_function, - object_type=TaskResult, + self._is_execute_function_return_value_a_task_result = ( + is_callable_return_value_of_type( + callable=execute_function, + object_type=TaskResult, + ) ) diff --git a/src/conductor/client/worker/worker_interface.py b/src/conductor/client/worker/worker_interface.py index acb5f20f..c3a73340 100644 --- a/src/conductor/client/worker/worker_interface.py +++ b/src/conductor/client/worker/worker_interface.py @@ -5,6 +5,7 @@ from conductor.client.http.models.task import Task from conductor.client.http.models.task_result import TaskResult +from conductor.client.configuration.configuration import Configuration DEFAULT_POLLING_INTERVAL = 100 # ms @@ -15,7 +16,7 @@ def __init__(self, task_definition_name: Union[str, list]): self.next_task_index = 0 self._task_definition_name_cache = None self._domain = None - self._poll_interval = DEFAULT_POLLING_INTERVAL + self._poll_interval = Configuration().get_poll_interval() @abc.abstractmethod def execute(self, task: Task) -> TaskResult: @@ -43,7 +44,11 @@ def get_polling_interval_in_seconds(self) -> float: :return: float Default: 100ms """ - return (self.poll_interval if self.poll_interval else DEFAULT_POLLING_INTERVAL) / 1000 + return ( + self.poll_interval + if self.poll_interval + else Configuration().get_poll_interval() + ) / 1000 def get_task_definition_name(self) -> str: """ @@ -72,7 +77,9 @@ def clear_task_definition_name_cache(self): def compute_task_definition_name(self): if isinstance(self.task_definition_name, list): task_definition_name = self.task_definition_name[self.next_task_index] - self.next_task_index = (self.next_task_index + 1) % len(self.task_definition_name) + self.next_task_index = (self.next_task_index + 1) % len( + self.task_definition_name + ) return task_definition_name return self.task_definition_name @@ -86,7 +93,7 @@ def get_task_result_from_task(self, task: Task) -> TaskResult: return TaskResult( task_id=task.task_id, workflow_instance_id=task.workflow_instance_id, - worker_id=self.get_identity() + worker_id=self.get_identity(), ) def get_domain(self) -> str: diff --git a/src/conductor/client/worker/worker_task.py b/src/conductor/client/worker/worker_task.py index 37222e55..4822f309 100644 --- a/src/conductor/client/worker/worker_task.py +++ b/src/conductor/client/worker/worker_task.py @@ -2,24 +2,44 @@ import functools from typing import Optional from conductor.client.automator.task_handler import register_decorated_fn +from conductor.client.configuration.configuration import Configuration from conductor.client.workflow.task.simple_task import SimpleTask -def WorkerTask(task_definition_name: str, poll_interval: int = 100, domain: Optional[str] = None, worker_id: Optional[str] = None, - poll_interval_seconds: int = 0): +def WorkerTask( + task_definition_name: str, + poll_interval: int = 100, + domain: Optional[str] = None, + worker_id: Optional[str] = None, + poll_interval_seconds: int = 0, +): + config = Configuration() + + poll_interval = poll_interval or config.get_poll_interval() + domain = domain or config.get_domain() + poll_interval_seconds = poll_interval_seconds or config.get_poll_interval_seconds() + poll_interval_millis = poll_interval if poll_interval_seconds > 0: poll_interval_millis = 1000 * poll_interval_seconds def worker_task_func(func): - register_decorated_fn(name=task_definition_name, poll_interval=poll_interval_millis, domain=domain, - worker_id=worker_id, func=func) + register_decorated_fn( + name=task_definition_name, + poll_interval=poll_interval_millis, + domain=domain, + worker_id=worker_id, + func=func, + ) @functools.wraps(func) def wrapper_func(*args, **kwargs): if "task_ref_name" in kwargs: - task = SimpleTask(task_def_name=task_definition_name, task_reference_name=kwargs["task_ref_name"]) + task = SimpleTask( + task_def_name=task_definition_name, + task_reference_name=kwargs["task_ref_name"], + ) kwargs.pop("task_ref_name") task.input_parameters.update(kwargs) return task @@ -30,15 +50,33 @@ def wrapper_func(*args, **kwargs): return worker_task_func -def worker_task(task_definition_name: str, poll_interval_millis: int = 100, domain: Optional[str] = None, worker_id: Optional[str] = None): +def worker_task( + task_definition_name: str, + poll_interval_millis: int = 100, + domain: Optional[str] = None, + worker_id: Optional[str] = None, +): + config = Configuration() + + poll_interval_millis = poll_interval_millis or config.get_poll_interval() + domain = domain or config.get_domain() + def worker_task_func(func): - register_decorated_fn(name=task_definition_name, poll_interval=poll_interval_millis, domain=domain, - worker_id=worker_id, func=func) + register_decorated_fn( + name=task_definition_name, + poll_interval=poll_interval_millis, + domain=domain, + worker_id=worker_id, + func=func, + ) @functools.wraps(func) def wrapper_func(*args, **kwargs): if "task_ref_name" in kwargs: - task = SimpleTask(task_def_name=task_definition_name, task_reference_name=kwargs["task_ref_name"]) + task = SimpleTask( + task_def_name=task_definition_name, + task_reference_name=kwargs["task_ref_name"], + ) kwargs.pop("task_ref_name") task.input_parameters.update(kwargs) return task diff --git a/src/conductor/client/workflow/conductor_workflow.py b/src/conductor/client/workflow/conductor_workflow.py index 2c475629..6e0a7962 100644 --- a/src/conductor/client/workflow/conductor_workflow.py +++ b/src/conductor/client/workflow/conductor_workflow.py @@ -5,14 +5,12 @@ from shortuuid import uuid from typing_extensions import Self -from conductor.client.http.models import ( - StartWorkflowRequest, - WorkflowDef, - WorkflowRun, - WorkflowTask, - SubWorkflowParams, -) -from conductor.client.http.models.start_workflow_request import IdempotencyStrategy +from conductor.client.http.models.start_workflow_request import StartWorkflowRequest +from conductor.client.http.models.workflow_def import WorkflowDef +from conductor.client.http.models.workflow_run import WorkflowRun +from conductor.client.http.models.workflow_task import WorkflowTask +from conductor.client.http.models.sub_workflow_params import SubWorkflowParams +from conductor.shared.http.enums import IdempotencyStrategy from conductor.client.workflow.executor.workflow_executor import WorkflowExecutor from conductor.client.workflow.task.fork_task import ForkTask from conductor.client.workflow.task.join_task import JoinTask diff --git a/src/conductor/client/workflow/executor/workflow_executor.py b/src/conductor/client/workflow/executor/workflow_executor.py index ba723e54..4b35f684 100644 --- a/src/conductor/client/workflow/executor/workflow_executor.py +++ b/src/conductor/client/workflow/executor/workflow_executor.py @@ -8,21 +8,17 @@ from conductor.client.http.api.metadata_resource_api import MetadataResourceApi from conductor.client.http.api.task_resource_api import TaskResourceApi from conductor.client.http.api_client import ApiClient -from conductor.client.http.models import ( - TaskResult, - Workflow, - WorkflowDef, - WorkflowRun, - WorkflowStatus, - ScrollableSearchResultWorkflowSummary, - StartWorkflowRequest, - SkipTaskRequest, - RerunWorkflowRequest, - SignalResponse, -) -from conductor.client.http.models.correlation_ids_search_request import ( - CorrelationIdsSearchRequest, -) +from conductor.client.http.models.task_result import TaskResult +from conductor.client.http.models.workflow import Workflow +from conductor.client.http.models.workflow_def import WorkflowDef +from conductor.client.http.models.workflow_run import WorkflowRun +from conductor.client.http.models.workflow_status import WorkflowStatus +from conductor.client.http.models.scrollable_search_result_workflow_summary import ScrollableSearchResultWorkflowSummary +from conductor.client.http.models.start_workflow_request import StartWorkflowRequest +from conductor.client.http.models.skip_task_request import SkipTaskRequest +from conductor.client.http.models.rerun_workflow_request import RerunWorkflowRequest +from conductor.client.http.models.signal_response import SignalResponse +from conductor.client.http.models.correlation_ids_search_request import CorrelationIdsSearchRequest from conductor.client.orkes.orkes_workflow_client import OrkesWorkflowClient @@ -38,7 +34,7 @@ def register_workflow(self, workflow: WorkflowDef, overwrite: Optional[bool] = N kwargs = {} if overwrite is not None: kwargs["overwrite"] = overwrite - return self.metadata_client.update1( + return self.metadata_client.update( body=[workflow], **kwargs ) @@ -179,7 +175,7 @@ def get_by_correlation_ids_and_names(self, batch_request: CorrelationIdsSearchRe also includes workflows that are completed otherwise only running workflows are returned """ return self.workflow_client.get_by_correlation_ids_in_batch(batch_request=batch_request, - include_closed=include_closed, + include_completed=include_closed, include_tasks=include_tasks) def pause(self, workflow_id: str) -> None: diff --git a/src/conductor/client/workflow/task/task.py b/src/conductor/client/workflow/task/task.py index 0d814d77..039c9eea 100644 --- a/src/conductor/client/workflow/task/task.py +++ b/src/conductor/client/workflow/task/task.py @@ -5,7 +5,8 @@ from typing_extensions import Self -from conductor.client.http.models.workflow_task import WorkflowTask, CacheConfig +from conductor.client.http.models.cache_config import CacheConfigAdapter as CacheConfig +from conductor.client.http.models.workflow_task import WorkflowTaskAdapter as WorkflowTask from conductor.client.workflow.task.task_type import TaskType diff --git a/src/conductor/client/workflow_client.py b/src/conductor/client/workflow_client.py index 4e3e61a6..101edf81 100644 --- a/src/conductor/client/workflow_client.py +++ b/src/conductor/client/workflow_client.py @@ -2,8 +2,11 @@ from abc import ABC, abstractmethod from typing import Optional, List, Dict -from conductor.client.http.models import WorkflowRun, SkipTaskRequest, WorkflowStatus, \ - ScrollableSearchResultWorkflowSummary, SignalResponse +from conductor.client.http.models.workflow_run import WorkflowRun +from conductor.client.http.models.skip_task_request import SkipTaskRequest +from conductor.client.http.models.workflow_status import WorkflowStatus +from conductor.client.http.models.scrollable_search_result_workflow_summary import ScrollableSearchResultWorkflowSummary +from conductor.client.http.models.signal_response import SignalResponse from conductor.client.http.models.correlation_ids_search_request import CorrelationIdsSearchRequest from conductor.client.http.models.rerun_workflow_request import RerunWorkflowRequest from conductor.client.http.models.start_workflow_request import StartWorkflowRequest diff --git a/tests/backwardcompatibility/test_bc_event_handler.py b/tests/backwardcompatibility/test_bc_event_handler.py index 2523f862..8320ae79 100644 --- a/tests/backwardcompatibility/test_bc_event_handler.py +++ b/tests/backwardcompatibility/test_bc_event_handler.py @@ -152,6 +152,9 @@ def test_to_dict_method_exists_and_works(): "actions", "active", "evaluator_type", + "org_id", + "tags", + "created_by", "description", } assert set(result.keys()) == expected_keys diff --git a/tests/backwardcompatibility/test_bc_integration.py b/tests/backwardcompatibility/test_bc_integration.py index b79f3501..e6f0cdcb 100644 --- a/tests/backwardcompatibility/test_bc_integration.py +++ b/tests/backwardcompatibility/test_bc_integration.py @@ -161,9 +161,11 @@ def test_swagger_types_mapping_unchanged(): def test_attribute_map_unchanged(): expected_attribute_map = { + "apis": "apis", "category": "category", "configuration": "configuration", "created_by": "createdBy", + "create_time": "createTime", "created_on": "createdOn", "description": "description", "enabled": "enabled", @@ -172,7 +174,9 @@ def test_attribute_map_unchanged(): "tags": "tags", "type": "type", "updated_by": "updatedBy", + "update_time": "updateTime", "updated_on": "updatedOn", + "owner_app": "ownerApp", } for key, expected_json_key in expected_attribute_map.items(): assert key in Integration.attribute_map, f"attribute_map should contain {key}" diff --git a/tests/backwardcompatibility/test_bc_integration_api.py b/tests/backwardcompatibility/test_bc_integration_api.py index 81db9c40..4df99ace 100644 --- a/tests/backwardcompatibility/test_bc_integration_api.py +++ b/tests/backwardcompatibility/test_bc_integration_api.py @@ -181,11 +181,14 @@ def test_swagger_types_structure(): "api": "str", "configuration": "dict(str, object)", "created_by": "str", + "create_time": "int", "created_on": "int", "description": "str", "enabled": "bool", "integration_name": "str", - "tags": "list[TagObject]", + "owner_app": "str", + "tags": "list[Tag]", + "update_time": "int", "updated_by": "str", "updated_on": "int", } @@ -198,14 +201,17 @@ def test_attribute_map_structure(): expected_attribute_map = { "api": "api", "configuration": "configuration", - "created_by": "createdBy", + "create_time": "createTime", "created_on": "createdOn", + "created_by": "createdBy", "description": "description", "enabled": "enabled", "integration_name": "integrationName", + "owner_app": "ownerApp", "tags": "tags", - "updated_by": "updatedBy", + "update_time": "updateTime", "updated_on": "updatedOn", + "updated_by": "updatedBy", } assert IntegrationApi.attribute_map == expected_attribute_map @@ -222,12 +228,15 @@ def test_to_dict_method(valid_data): "configuration", "created_by", "created_on", + "create_time", "description", "enabled", "integration_name", "tags", "updated_by", "updated_on", + "update_time", + "owner_app", } assert set(result_dict.keys()) == expected_keys diff --git a/tests/backwardcompatibility/test_bc_save_schedule_request.py b/tests/backwardcompatibility/test_bc_save_schedule_request.py index 8b94c7b4..5052674b 100644 --- a/tests/backwardcompatibility/test_bc_save_schedule_request.py +++ b/tests/backwardcompatibility/test_bc_save_schedule_request.py @@ -92,6 +92,8 @@ def test_swagger_types_mapping_exists(): "updated_by": "str", "schedule_start_time": "int", "schedule_end_time": "int", + 'zone_id': 'str', + 'description': 'str', } for field, expected_type in expected_swagger_types.items(): diff --git a/tests/backwardcompatibility/test_bc_state_change_event.py b/tests/backwardcompatibility/test_bc_state_change_event.py index 7bbe15ad..cc1ea8bf 100644 --- a/tests/backwardcompatibility/test_bc_state_change_event.py +++ b/tests/backwardcompatibility/test_bc_state_change_event.py @@ -95,7 +95,7 @@ def test_state_change_event_class_attributes(): assert "type" in swagger_types assert "payload" in swagger_types assert swagger_types["type"] == "str" - assert swagger_types["payload"] == "Dict[str, object]" + assert swagger_types["payload"] == "dict(str, object)" # Test attribute_map exists and has correct structure assert hasattr(StateChangeEvent, "attribute_map") diff --git a/tests/backwardcompatibility/test_bc_tag.py b/tests/backwardcompatibility/test_bc_tag.py new file mode 100644 index 00000000..83661fa3 --- /dev/null +++ b/tests/backwardcompatibility/test_bc_tag.py @@ -0,0 +1,181 @@ +import pytest + +from conductor.client.http.models.tag import Tag + + +@pytest.fixture +def valid_type_values(): + """Set up test fixture with valid enum values.""" + return ["METADATA", "RATE_LIMIT"] + + +def test_constructor_with_no_parameters(): + """Test that constructor works with no parameters (current behavior).""" + tag = Tag() + assert tag.key is None + assert tag.type is None + assert tag.value is None + + +def test_constructor_with_all_parameters(): + """Test constructor with all valid parameters.""" + tag = Tag(key="test_key", type="METADATA", value="test_value") + assert tag.key == "test_key" + assert tag.type == "METADATA" + assert tag.value == "test_value" + + +def test_constructor_with_partial_parameters(): + """Test constructor with some parameters.""" + tag = Tag(key="test_key") + assert tag.key == "test_key" + assert tag.type is None + assert tag.value is None + + +def test_required_fields_exist(): + """Test that all expected fields exist and are accessible.""" + tag = Tag() + + # Test field existence via property access + assert hasattr(tag, "key") + assert hasattr(tag, "type") + assert hasattr(tag, "value") + + # Test that properties can be accessed without error + _ = tag.key + _ = tag.type + _ = tag.value + + +def test_field_types_unchanged(): + """Test that field types are still strings as expected.""" + tag = Tag(key="test", type="METADATA", value="test_value") + + assert isinstance(tag.key, str) + assert isinstance(tag.type, str) + assert isinstance(tag.value, str) + + +def test_key_property_behavior(): + """Test key property getter/setter behavior.""" + tag = Tag() + + # Test setter + tag.key = "test_key" + assert tag.key == "test_key" + + # Test that None is allowed + tag.key = None + assert tag.key is None + + +def test_value_property_behavior(): + """Test value property getter/setter behavior.""" + tag = Tag() + + # Test setter + tag.value = "test_value" + assert tag.value == "test_value" + + # Test that None is allowed + tag.value = None + assert tag.value is None + + +def test_type_property_validation_existing_values(valid_type_values): + """Test that existing enum values for type are still accepted.""" + tag = Tag() + + # Test all current valid values + for valid_type in valid_type_values: + tag.type = valid_type + assert tag.type == valid_type + + +def test_swagger_types_structure(): + """Test that swagger_types class attribute structure is unchanged.""" + expected_swagger_types = {"key": "str", "type": "str", "value": "str"} + + assert Tag.swagger_types == expected_swagger_types + + +def test_attribute_map_structure(): + """Test that attribute_map class attribute structure is unchanged.""" + expected_attribute_map = {"key": "key", "type": "type", "value": "value"} + + assert Tag.attribute_map == expected_attribute_map + + +def test_to_dict_method_exists_and_works(): + """Test that to_dict method exists and returns expected structure.""" + tag = Tag(key="test_key", type="METADATA", value="test_value") + result = tag.to_dict() + + assert isinstance(result, dict) + assert result["key"] == "test_key" + assert result["type"] == "METADATA" + assert result["value"] == "test_value" + + +def test_to_dict_with_none_values(): + """Test to_dict behavior with None values.""" + tag = Tag() + result = tag.to_dict() + + assert isinstance(result, dict) + assert "key" in result + assert "type" in result + assert "value" in result + + +def test_to_str_method_exists(): + """Test that to_str method exists and returns string.""" + tag = Tag(key="test", type="METADATA", value="test_value") + result = tag.to_str() + + assert isinstance(result, str) + + +def test_repr_method_exists(): + """Test that __repr__ method works.""" + tag = Tag(key="test", type="METADATA", value="test_value") + result = repr(tag) + + assert isinstance(result, str) + + +def test_equality_comparison(): + """Test that equality comparison works as expected.""" + tag1 = Tag(key="test", type="METADATA", value="value") + tag2 = Tag(key="test", type="METADATA", value="value") + tag3 = Tag(key="different", type="METADATA", value="value") + + assert tag1 == tag2 + assert tag1 != tag3 + assert tag1 != "not_a_tag_string" + + +def test_inequality_comparison(): + """Test that inequality comparison works.""" + tag1 = Tag(key="test", type="METADATA", value="value") + tag2 = Tag(key="different", type="METADATA", value="value") + + assert tag1 != tag2 + + +def test_discriminator_attribute_exists(): + """Test that discriminator attribute exists (swagger generated code).""" + tag = Tag() + assert hasattr(tag, "discriminator") + assert tag.discriminator is None + + +def test_private_attributes_exist(): + """Test that private attributes used by properties exist.""" + tag = Tag() + + # These are implementation details but important for backward compatibility + assert hasattr(tag, "_key") + assert hasattr(tag, "_type") + assert hasattr(tag, "_value") diff --git a/tests/backwardcompatibility/test_bc_task.py b/tests/backwardcompatibility/test_bc_task.py index 37b48b9f..728df88a 100644 --- a/tests/backwardcompatibility/test_bc_task.py +++ b/tests/backwardcompatibility/test_bc_task.py @@ -1,7 +1,7 @@ import pytest from conductor.client.http.models import Task, TaskResult, WorkflowTask -from conductor.shared.http.enums import TaskResultStatus +from conductor.client.http.models.task_result_status import TaskResultStatus @pytest.fixture diff --git a/tests/backwardcompatibility/test_bc_task_result.py b/tests/backwardcompatibility/test_bc_task_result.py index fb1e3ddb..b9765cf7 100644 --- a/tests/backwardcompatibility/test_bc_task_result.py +++ b/tests/backwardcompatibility/test_bc_task_result.py @@ -1,7 +1,7 @@ import pytest from conductor.client.http.models.task_result import TaskResult -from conductor.shared.http.enums import TaskResultStatus +from conductor.client.http.models.task_result_status import TaskResultStatus @pytest.fixture @@ -200,6 +200,7 @@ def test_constructor_with_all_fields(valid_workflow_id, valid_task_id, valid_sta for field, expected_value in test_data.items(): actual_value = getattr(task_result, field) + if field == "status": # Status validation converts string to enum assert actual_value.name == expected_value diff --git a/tests/backwardcompatibility/test_bc_task_result_status.py b/tests/backwardcompatibility/test_bc_task_result_status.py index c0e1361a..d49ca4f1 100644 --- a/tests/backwardcompatibility/test_bc_task_result_status.py +++ b/tests/backwardcompatibility/test_bc_task_result_status.py @@ -2,7 +2,7 @@ import pytest -from conductor.shared.http.enums import TaskResultStatus +from conductor.client.http.models import TaskResultStatus @pytest.fixture diff --git a/tests/backwardcompatibility/test_bc_workflow_schedule.py b/tests/backwardcompatibility/test_bc_workflow_schedule.py index 56ce502c..4f122520 100644 --- a/tests/backwardcompatibility/test_bc_workflow_schedule.py +++ b/tests/backwardcompatibility/test_bc_workflow_schedule.py @@ -26,6 +26,10 @@ def valid_data(mock_start_workflow_request): "updated_time": 1641081600, "created_by": "test_user", "updated_by": "test_user_2", + "description": "Test schedule description", + "paused_reason": "Test pause reason", + "tags": [], + "zone_id": "UTC", } @@ -45,6 +49,10 @@ def test_constructor_with_no_parameters(): assert schedule.updated_time is None assert schedule.created_by is None assert schedule.updated_by is None + assert schedule.description is None + assert schedule.paused_reason is None + assert schedule.tags is None + assert schedule.zone_id is None def test_constructor_with_all_parameters(valid_data, mock_start_workflow_request): @@ -63,6 +71,10 @@ def test_constructor_with_all_parameters(valid_data, mock_start_workflow_request assert schedule.updated_time == 1641081600 assert schedule.created_by == "test_user" assert schedule.updated_by == "test_user_2" + assert schedule.description == "Test schedule description" + assert schedule.paused_reason == "Test pause reason" + assert schedule.tags == [] + assert schedule.zone_id == "UTC" def test_constructor_with_partial_parameters(): @@ -102,6 +114,10 @@ def test_all_required_properties_exist(): "updated_time", "created_by", "updated_by", + "description", + "paused_reason", + "tags", + "zone_id", ] for prop in required_properties: @@ -128,6 +144,15 @@ def test_property_setters_work(mock_start_workflow_request): schedule.updated_by = "setter_user_2" assert schedule.updated_by == "setter_user_2" + schedule.description = "New description" + assert schedule.description == "New description" + + schedule.paused_reason = "New pause reason" + assert schedule.paused_reason == "New pause reason" + + schedule.zone_id = "EST" + assert schedule.zone_id == "EST" + # Test boolean properties schedule.run_catchup_schedule_instances = False assert not schedule.run_catchup_schedule_instances @@ -152,6 +177,10 @@ def test_property_setters_work(mock_start_workflow_request): schedule.start_workflow_request = mock_start_workflow_request assert schedule.start_workflow_request == mock_start_workflow_request + # Test list property + schedule.tags = [{"key": "value"}] + assert schedule.tags == [{"key": "value"}] + def test_property_types_are_preserved(valid_data, mock_start_workflow_request): """Test that property types match expected swagger_types.""" @@ -162,6 +191,9 @@ def test_property_types_are_preserved(valid_data, mock_start_workflow_request): assert isinstance(schedule.cron_expression, str) assert isinstance(schedule.created_by, str) assert isinstance(schedule.updated_by, str) + assert isinstance(schedule.description, str) + assert isinstance(schedule.paused_reason, str) + assert isinstance(schedule.zone_id, str) # Boolean fields assert isinstance(schedule.run_catchup_schedule_instances, bool) @@ -176,6 +208,9 @@ def test_property_types_are_preserved(valid_data, mock_start_workflow_request): # Object field (StartWorkflowRequest) assert schedule.start_workflow_request == mock_start_workflow_request + # List field + assert isinstance(schedule.tags, list) + def test_swagger_types_attribute_exists(): """Test that swagger_types class attribute exists and contains expected fields.""" @@ -194,6 +229,10 @@ def test_swagger_types_attribute_exists(): "updated_time": "int", "created_by": "str", "updated_by": "str", + "description": "str", + "paused_reason": "str", + "tags": "list[Tag]", + "zone_id": "str", } # Check that all expected fields exist with correct types @@ -221,6 +260,10 @@ def test_attribute_map_exists(): "updated_time": "updatedTime", "created_by": "createdBy", "updated_by": "updatedBy", + "description": "description", + "paused_reason": "pausedReason", + "tags": "tags", + "zone_id": "zoneId", } # Check that all expected mappings exist @@ -249,12 +292,20 @@ def test_to_dict_method_exists_and_works(valid_data): assert "run_catchup_schedule_instances" in result assert "paused" in result assert "start_workflow_request" in result + assert "description" in result + assert "paused_reason" in result + assert "tags" in result + assert "zone_id" in result # Values should match assert result["name"] == "test_schedule" assert result["cron_expression"] == "0 0 * * *" assert result["run_catchup_schedule_instances"] assert not result["paused"] + assert result["description"] == "Test schedule description" + assert result["paused_reason"] == "Test pause reason" + assert result["tags"] == [] + assert result["zone_id"] == "UTC" def test_to_str_method_exists_and_works(): @@ -323,6 +374,10 @@ def test_private_attributes_exist(): "_updated_time", "_created_by", "_updated_by", + "_description", + "_paused_reason", + "_tags", + "_zone_id", ] for attr in private_attrs: @@ -348,6 +403,10 @@ def test_none_values_are_handled_correctly(valid_data): schedule.updated_time = None schedule.created_by = None schedule.updated_by = None + schedule.description = None + schedule.paused_reason = None + schedule.tags = None + schedule.zone_id = None # Verify all are None assert schedule.name is None @@ -361,11 +420,15 @@ def test_none_values_are_handled_correctly(valid_data): assert schedule.updated_time is None assert schedule.created_by is None assert schedule.updated_by is None + assert schedule.description is None + assert schedule.paused_reason is None + assert schedule.tags is None + assert schedule.zone_id is None def test_constructor_signature_compatibility(mock_start_workflow_request): """Test that constructor signature remains compatible.""" - # Test positional arguments work (in order) + # Test positional arguments work (in order based on WorkflowSchedule model) schedule = WorkflowSchedule( "test_name", # name "0 0 * * *", # cron_expression diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 00000000..a855814a --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,6 @@ +def pytest_collection_modifyitems(config, items): + for item in items: + if item.get_closest_marker("v5_2_6"): + item.add_marker("v5") + if item.get_closest_marker("v4_1_73"): + item.add_marker("v4") diff --git a/tests/integration/client/orkes/test_orkes_clients.py b/tests/integration/client/orkes/test_orkes_clients.py index 2e2fc7e2..bf2f3395 100644 --- a/tests/integration/client/orkes/test_orkes_clients.py +++ b/tests/integration/client/orkes/test_orkes_clients.py @@ -19,7 +19,7 @@ from conductor.client.http.models.upsert_user_request import UpsertUserRequest from conductor.client.http.models.workflow_def import WorkflowDef from conductor.client.http.models.workflow_test_request import WorkflowTestRequest -from conductor.client.http.rest import ApiException +from conductor.client.codegen.rest import ApiException from conductor.client.orkes.models.access_key_status import AccessKeyStatus from conductor.client.orkes.models.access_type import AccessType from conductor.client.orkes.models.metadata_tag import MetadataTag diff --git a/tests/integration/client/orkes/test_orkes_service_registry_client.py b/tests/integration/client/orkes/test_orkes_service_registry_client.py index c31d978e..e009d4a5 100644 --- a/tests/integration/client/orkes/test_orkes_service_registry_client.py +++ b/tests/integration/client/orkes/test_orkes_service_registry_client.py @@ -11,7 +11,7 @@ from conductor.client.http.models.service_method import ServiceMethod from conductor.client.http.models.proto_registry_entry import ProtoRegistryEntry from conductor.client.orkes.orkes_service_registry_client import OrkesServiceRegistryClient -from conductor.client.http.rest import ApiException +from conductor.client.codegen.rest import ApiException SUFFIX = str(uuid()) HTTP_SERVICE_NAME = 'IntegrationTestServiceRegistryHttp_' + SUFFIX diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py new file mode 100644 index 00000000..f1a6beda --- /dev/null +++ b/tests/integration/conftest.py @@ -0,0 +1,191 @@ +import os +import pytest +import uuid +from typing import Optional + +from conductor.client.configuration.configuration import Configuration +from conductor.client.orkes.orkes_authorization_client import OrkesAuthorizationClient +from conductor.client.http.models.upsert_user_request import ( + UpsertUserRequestAdapter as UpsertUserRequest, +) + + +@pytest.fixture(scope="session") +def conductor_configuration(): + """ + Create a Conductor configuration from environment variables. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_DEBUG: Enable debug logging (default: false) + """ + config = Configuration() + + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + + config.apply_logging_config() + + return config + + +@pytest.fixture(scope="session") +def test_timeout(): + """Get test timeout from environment variable.""" + return int(os.getenv("CONDUCTOR_TEST_TIMEOUT", "30")) + + +@pytest.fixture(scope="session") +def cleanup_enabled(): + """Check if test cleanup is enabled.""" + return os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + + +@pytest.fixture(scope="session") +def skip_performance_tests(): + """Check if performance tests should be skipped.""" + return os.getenv("CONDUCTOR_SKIP_PERFORMANCE_TESTS", "false").lower() == "true" + + +@pytest.fixture(scope="session") +def test_suffix(): + """Generate unique suffix for test resources.""" + return str(uuid.uuid4())[:8] + + +@pytest.fixture(scope="session") +def authorization_client(conductor_configuration): + """Create OrkesAuthorizationClient instance.""" + return OrkesAuthorizationClient(conductor_configuration) + + +@pytest.fixture(scope="function") +def test_user_id(test_suffix): + """Generate test user ID.""" + return f"test_user_{test_suffix}@example.com" + + +@pytest.fixture(scope="function") +def test_user(authorization_client, test_user_id, cleanup_enabled): + """ + Create a test user and clean it up after the test. + + Args: + authorization_client: OrkesAuthorizationClient instance + test_user_id: Unique test user ID + cleanup_enabled: Whether to cleanup test resources + + Yields: + dict: Created user object with id, name, and roles + """ + create_request = UpsertUserRequest(name="Test User", roles=["USER"]) + created_user = authorization_client.upsert_user(create_request, test_user_id) + + user_data = { + "id": created_user.id, + "name": created_user.name, + "roles": ( + [role.name for role in created_user.roles] if created_user.roles else [] + ), + } + + yield user_data + + if cleanup_enabled: + try: + authorization_client.delete_user(test_user_id) + except Exception: + pass + + +@pytest.fixture(scope="function") +def test_user_with_roles(authorization_client, test_user_id, cleanup_enabled): + """ + Create a test user with specific roles and clean it up after the test. + + Args: + authorization_client: OrkesAuthorizationClient instance + test_user_id: Unique test user ID + cleanup_enabled: Whether to cleanup test resources + + Yields: + dict: Created user object with id, name, and roles + """ + create_request = UpsertUserRequest( + name="Test User with Roles", roles=["USER", "ADMIN"] + ) + created_user = authorization_client.upsert_user(create_request, test_user_id) + + user_data = { + "id": created_user.id, + "name": created_user.name, + "roles": ( + [role.name for role in created_user.roles] if created_user.roles else [] + ), + } + + yield user_data + + if cleanup_enabled: + try: + authorization_client.delete_user(test_user_id) + except Exception: + pass + + +@pytest.fixture(scope="function") +def test_user_basic(authorization_client, test_user_id, cleanup_enabled): + """ + Create a basic test user (no roles) and clean it up after the test. + + Args: + authorization_client: OrkesAuthorizationClient instance + test_user_id: Unique test user ID + cleanup_enabled: Whether to cleanup test resources + + Yields: + dict: Created user object with id, name, and roles + """ + create_request = UpsertUserRequest(name="Basic Test User", roles=[]) + created_user = authorization_client.upsert_user(create_request, test_user_id) + + user_data = { + "id": created_user.id, + "name": created_user.name, + "roles": ( + [role.name for role in created_user.roles] if created_user.roles else [] + ), + } + + yield user_data + + if cleanup_enabled: + try: + authorization_client.delete_user(test_user_id) + except Exception: + pass + + +def pytest_configure(config): + """Configure pytest with custom markers.""" + config.addinivalue_line("markers", "integration: mark test as integration test") + config.addinivalue_line("markers", "performance: mark test as performance test") + config.addinivalue_line("markers", "slow: mark test as slow running test") + + +def pytest_collection_modifyitems(config, items): + """Modify test collection to add markers based on test names.""" + for item in items: + if "integration" in item.nodeid.lower(): + item.add_marker(pytest.mark.integration) + + if "performance" in item.nodeid.lower(): + item.add_marker(pytest.mark.performance) + + if any( + keyword in item.nodeid.lower() + for keyword in ["concurrent", "bulk", "performance"] + ): + item.add_marker(pytest.mark.slow) diff --git a/tests/integration/metadata/test_schema_service.py b/tests/integration/metadata/test_schema_service.py index 8448de50..3ecd7d0d 100644 --- a/tests/integration/metadata/test_schema_service.py +++ b/tests/integration/metadata/test_schema_service.py @@ -1,9 +1,7 @@ -import json import logging import unittest from conductor.client.configuration.configuration import Configuration -from conductor.client.http.api.schema_resource_api import SchemaResourceApi -from conductor.client.http.models.schema_def import SchemaDef, SchemaType +from conductor.client.http.models import SchemaDef, SchemaType from conductor.client.orkes.orkes_schema_client import OrkesSchemaClient SCHEMA_NAME = 'ut_schema' diff --git a/tests/integration/metadata/test_task_metadata_service.py b/tests/integration/metadata/test_task_metadata_service.py index 9a72f556..1e215299 100644 --- a/tests/integration/metadata/test_task_metadata_service.py +++ b/tests/integration/metadata/test_task_metadata_service.py @@ -1,12 +1,8 @@ -import json import logging import unittest from conductor.client.configuration.configuration import Configuration -from conductor.client.http.api.schema_resource_api import SchemaResourceApi from conductor.client.http.models import TaskDef, WorkflowDef, WorkflowTask -from conductor.client.http.models.schema_def import SchemaDef, SchemaType from conductor.client.orkes.orkes_metadata_client import OrkesMetadataClient -from conductor.client.orkes.orkes_schema_client import OrkesSchemaClient TASK_NAME = 'task-test-sdk' WORKFLOW_NAME = 'sdk-workflow-test-0' diff --git a/tests/integration/test_conductor_oss_workflow_integration.py b/tests/integration/test_conductor_oss_workflow_integration.py new file mode 100644 index 00000000..4563100d --- /dev/null +++ b/tests/integration/test_conductor_oss_workflow_integration.py @@ -0,0 +1,687 @@ +import os +import time +import uuid + +import pytest + +from conductor.client.http.models.rerun_workflow_request import ( + RerunWorkflowRequestAdapter as RerunWorkflowRequest, +) +from conductor.client.http.models.start_workflow_request import ( + StartWorkflowRequestAdapter as StartWorkflowRequest, +) +from conductor.client.http.models.workflow_def import ( + WorkflowDefAdapter as WorkflowDef, +) +from conductor.client.http.models.workflow_task import ( + WorkflowTaskAdapter as WorkflowTask, +) +from conductor.client.http.models.workflow_test_request import ( + WorkflowTestRequestAdapter as WorkflowTestRequest, +) +from conductor.client.http.models.task_def import TaskDefAdapter as TaskDef +from conductor.client.configuration.configuration import Configuration +from conductor.client.orkes.orkes_metadata_client import OrkesMetadataClient +from conductor.client.orkes.orkes_workflow_client import OrkesWorkflowClient + + +@pytest.mark.v3_21_16 +class TestConductorOssWorkflowIntegration: + """ + Integration tests for Conductor OSS WorkflowClient running on localhost:8080. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + - CONDUCTOR_DEBUG: Enable debug logging (default: false) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + """Create configuration for Conductor OSS.""" + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def workflow_client(self, configuration: Configuration) -> OrkesWorkflowClient: + """Create workflow client for Conductor OSS.""" + return OrkesWorkflowClient(configuration) + + @pytest.fixture(scope="class") + def metadata_client(self, configuration: Configuration) -> OrkesMetadataClient: + """Create metadata client for Conductor OSS.""" + return OrkesMetadataClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + """Generate unique suffix for test resources.""" + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def test_workflow_name(self, test_suffix: str) -> str: + """Generate test workflow name.""" + return f"test_workflow_{test_suffix}" + + @pytest.fixture(scope="class") + def test_task_name(self, test_suffix: str) -> str: + """Generate test task name.""" + return f"test_task_{test_suffix}" + + @pytest.fixture(scope="class") + def simple_task_def(self, test_task_name: str) -> TaskDef: + """Create a simple task definition.""" + return TaskDef( + name=test_task_name, + description="A simple test task for integration testing", + retry_count=3, + retry_logic="FIXED", + retry_delay_seconds=1, + timeout_seconds=60, + poll_timeout_seconds=60, + response_timeout_seconds=60, + concurrent_exec_limit=1, + input_keys=["input_param"], + output_keys=["output_param"], + owner_email="test@example.com", + ) + + @pytest.fixture(scope="class") + def simple_workflow_task(self, test_task_name: str) -> WorkflowTask: + """Create a simple workflow task.""" + return WorkflowTask( + name=test_task_name, + task_reference_name="test_task_ref", + type="SIMPLE", + input_parameters={"input_param": "${workflow.input.input_param}"}, + ) + + @pytest.fixture(scope="class") + def http_poll_workflow_task(self) -> WorkflowTask: + """Create an HTTP poll workflow task for testing.""" + return WorkflowTask( + name="http_poll_task", + task_reference_name="http_poll_task_ref", + type="HTTP_POLL", + input_parameters={ + "http_request": { + "uri": "http://httpbin.org/get", + "method": "GET", + "terminationCondition": "(function(){ return $.output.response.body.randomInt > 10;})();", + "pollingInterval": "20", + "pollingStrategy": "FIXED", + } + }, + ) + + @pytest.fixture(scope="class") + def simple_workflow_def( + self, test_workflow_name: str, simple_workflow_task: WorkflowTask + ) -> WorkflowDef: + """Create a simple workflow definition.""" + return WorkflowDef( + name=test_workflow_name, + version=1, + description="A simple test workflow for integration testing", + tasks=[simple_workflow_task], + timeout_seconds=60, + timeout_policy="TIME_OUT_WF", + restartable=True, + owner_email="test@example.com", + ) + + @pytest.fixture(scope="class") + def http_poll_workflow_def( + self, test_workflow_name: str, http_poll_workflow_task: WorkflowTask + ) -> WorkflowDef: + """Create an HTTP poll workflow definition.""" + return WorkflowDef( + name=f"{test_workflow_name}_http_poll", + version=1, + description="An HTTP poll test workflow for integration testing", + tasks=[http_poll_workflow_task], + timeout_seconds=120, + timeout_policy="TIME_OUT_WF", + restartable=True, + owner_email="test@example.com", + ) + + @pytest.fixture(scope="class") + def simple_workflow_input(self) -> dict: + """Create simple workflow input.""" + return { + "input_param": "test_value", + "param1": "value1", + "param2": "value2", + "number": 42, + "boolean": True, + "array": [1, 2, 3], + "object": {"nested": "value"}, + } + + @pytest.fixture(scope="class") + def complex_workflow_input(self) -> dict: + """Create complex workflow input.""" + return { + "user_id": "user_12345", + "order_data": { + "order_id": "order_67890", + "items": [ + {"product_id": "prod_1", "quantity": 2, "price": 29.99}, + {"product_id": "prod_2", "quantity": 1, "price": 49.99}, + ], + "shipping_address": { + "street": "123 Main St", + "city": "Anytown", + "state": "CA", + "zip": "12345", + }, + }, + "preferences": { + "notifications": True, + "language": "en", + "timezone": "UTC", + }, + "metadata": { + "source": "integration_test", + "timestamp": int(time.time()), + "version": "1.0", + }, + } + + @pytest.fixture(scope="class") + def simple_start_workflow_request( + self, test_workflow_name: str, simple_workflow_input: dict + ) -> StartWorkflowRequest: + """Create simple start workflow request.""" + return StartWorkflowRequest( + name=test_workflow_name, + version=1, + input=simple_workflow_input, + correlation_id=f"test_correlation_{str(uuid.uuid4())[:8]}", + priority=0, + ) + + @pytest.fixture(scope="class") + def complex_start_workflow_request( + self, test_workflow_name: str, complex_workflow_input: dict + ) -> StartWorkflowRequest: + """Create complex start workflow request.""" + return StartWorkflowRequest( + name=test_workflow_name, + version=1, + input=complex_workflow_input, + correlation_id=f"complex_correlation_{str(uuid.uuid4())[:8]}", + priority=1, + created_by="integration_test", + idempotency_key=f"idempotency_{str(uuid.uuid4())[:8]}", + ) + + @pytest.fixture(scope="class", autouse=True) + def setup_test_resources( + self, + metadata_client: OrkesMetadataClient, + simple_task_def: TaskDef, + simple_workflow_def: WorkflowDef, + http_poll_workflow_def: WorkflowDef, + ): + """Setup test resources before running tests.""" + created_resources = {"task_defs": [], "workflow_defs": []} + + try: + # Register task definition + metadata_client.register_task_def(simple_task_def) + created_resources["task_defs"].append(simple_task_def.name) + + # Register workflow definitions + metadata_client.register_workflow_def(simple_workflow_def, overwrite=True) + created_resources["workflow_defs"].append( + (simple_workflow_def.name, simple_workflow_def.version) + ) + + metadata_client.register_workflow_def( + http_poll_workflow_def, overwrite=True + ) + created_resources["workflow_defs"].append( + (http_poll_workflow_def.name, http_poll_workflow_def.version) + ) + + time.sleep(2) # Allow time for registration + yield + finally: + # Cleanup resources + cleanup_enabled = ( + os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + ) + if cleanup_enabled: + for task_name in created_resources["task_defs"]: + try: + metadata_client.unregister_task_def(task_name) + except Exception as e: + print( + f"Warning: Failed to cleanup task definition {task_name}: {str(e)}" + ) + + for workflow_name, version in created_resources["workflow_defs"]: + try: + metadata_client.unregister_workflow_def(workflow_name, version) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow definition {workflow_name}: {str(e)}" + ) + + def test_workflow_start_by_name( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + """Test starting a workflow by name.""" + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + correlationId=f"start_by_name_{str(uuid.uuid4())[:8]}", + priority=0, + ) + + assert workflow_id is not None + assert isinstance(workflow_id, str) + assert len(workflow_id) > 0 + + workflow = workflow_client.get_workflow(workflow_id, include_tasks=True) + assert workflow.workflow_id == workflow_id + assert workflow.workflow_name == test_workflow_name + assert workflow.workflow_version == 1 + + except Exception as e: + print(f"Exception in test_workflow_start_by_name: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print(f"Warning: Failed to cleanup workflow: {str(e)}") + + def test_workflow_start_with_request( + self, + workflow_client: OrkesWorkflowClient, + simple_start_workflow_request: StartWorkflowRequest, + ): + """Test starting a workflow with StartWorkflowRequest.""" + workflow_id = None + try: + workflow_id = workflow_client.start_workflow(simple_start_workflow_request) + + assert workflow_id is not None + assert isinstance(workflow_id, str) + assert len(workflow_id) > 0 + + workflow = workflow_client.get_workflow(workflow_id, include_tasks=True) + assert workflow.workflow_id == workflow_id + assert workflow.workflow_name == simple_start_workflow_request.name + assert workflow.workflow_version == simple_start_workflow_request.version + + except Exception as e: + print(f"Exception in test_workflow_start_with_request: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + def test_workflow_pause_resume( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + """Test pausing and resuming a workflow.""" + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + workflow_client.pause_workflow(workflow_id) + + workflow = workflow_client.get_workflow(workflow_id) + assert workflow.status in ["PAUSED", "RUNNING"] + + workflow_client.resume_workflow(workflow_id) + + workflow_after_resume = workflow_client.get_workflow(workflow_id) + assert workflow_after_resume.status in ["RUNNING", "COMPLETED"] + + except Exception as e: + print(f"Exception in test_workflow_pause_resume: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + def test_workflow_restart( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + """Test restarting a workflow.""" + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + workflow_client.terminate_workflow( + workflow_id, + reason="Integration test termination", + trigger_failure_workflow=False, + ) + workflow = workflow_client.get_workflow(workflow_id) + assert workflow.status == "TERMINATED" + + workflow_client.restart_workflow(workflow_id, use_latest_def=False) + + workflow = workflow_client.get_workflow(workflow_id) + assert workflow.status in ["RUNNING", "COMPLETED"] + + except Exception as e: + print(f"Exception in test_workflow_restart: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + def test_workflow_rerun( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + """Test rerunning a workflow.""" + original_workflow_id = None + rerun_workflow_id = None + try: + original_workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + workflow_client.terminate_workflow( + original_workflow_id, + reason="Integration test termination", + trigger_failure_workflow=False, + ) + workflow = workflow_client.get_workflow(original_workflow_id) + assert workflow.status == "TERMINATED" + + rerun_request = RerunWorkflowRequest( + correlation_id=f"rerun_correlation_{str(uuid.uuid4())[:8]}", + workflow_input={"rerun_param": "rerun_value"}, + ) + + rerun_workflow_id = workflow_client.rerun_workflow( + original_workflow_id, rerun_request + ) + + assert rerun_workflow_id is not None + assert isinstance(rerun_workflow_id, str) + assert rerun_workflow_id == original_workflow_id + + rerun_workflow = workflow_client.get_workflow(rerun_workflow_id) + assert rerun_workflow.workflow_id == rerun_workflow_id + + except Exception as e: + print(f"Exception in test_workflow_rerun: {str(e)}") + raise + finally: + for wf_id in [original_workflow_id, rerun_workflow_id]: + if wf_id: + try: + workflow_client.delete_workflow(wf_id, archive_workflow=True) + except Exception as e: + print(f"Warning: Failed to cleanup workflow {wf_id}: {str(e)}") + + def test_workflow_retry( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + """Test retrying a workflow.""" + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + workflow_client.terminate_workflow( + workflow_id, + reason="Integration test termination", + trigger_failure_workflow=False, + ) + workflow = workflow_client.get_workflow(workflow_id) + assert workflow.status == "TERMINATED" + + workflow_client.retry_workflow(workflow_id, resume_subworkflow_tasks=False) + + workflow = workflow_client.get_workflow(workflow_id) + assert workflow.status in ["RUNNING", "COMPLETED"] + + except Exception as e: + print(f"Exception in test_workflow_retry: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + def test_workflow_terminate( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + """Test terminating a workflow.""" + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + workflow_client.terminate_workflow( + workflow_id, + reason="Integration test termination", + trigger_failure_workflow=False, + ) + + workflow = workflow_client.get_workflow(workflow_id) + assert workflow.status == "TERMINATED" + + except Exception as e: + print(f"Exception in test_workflow_terminate: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + def test_workflow_get_with_tasks( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + """Test getting workflow with and without tasks.""" + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + workflow_with_tasks = workflow_client.get_workflow( + workflow_id, include_tasks=True + ) + assert workflow_with_tasks.workflow_id == workflow_id + assert hasattr(workflow_with_tasks, "tasks") + + workflow_without_tasks = workflow_client.get_workflow( + workflow_id, include_tasks=False + ) + assert workflow_without_tasks.workflow_id == workflow_id + + except Exception as e: + print(f"Exception in test_workflow_get_with_tasks: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + def test_workflow_test( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + """Test workflow testing functionality.""" + try: + test_request = WorkflowTestRequest( + name=test_workflow_name, + version=1, + input=simple_workflow_input, + correlation_id=f"test_correlation_{str(uuid.uuid4())[:8]}", + ) + + test_result = workflow_client.test_workflow(test_request) + + assert test_result is not None + assert hasattr(test_result, "workflow_id") + + except Exception as e: + print(f"Exception in test_workflow_test: {str(e)}") + raise + + def test_workflow_correlation_ids_simple( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + """Test simple correlation IDs search.""" + workflow_ids = [] + correlation_ids = [] + try: + for i in range(2): + correlation_id = f"simple_correlation_{i}_{str(uuid.uuid4())[:8]}" + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + correlationId=correlation_id, + ) + workflow_ids.append(workflow_id) + correlation_ids.append(correlation_id) + + correlation_results = workflow_client.get_by_correlation_ids( + workflow_name=test_workflow_name, + correlation_ids=correlation_ids, + include_completed=False, + include_tasks=False, + ) + + assert correlation_results is not None + assert isinstance(correlation_results, dict) + + except Exception as e: + print(f"Exception in test_workflow_correlation_ids_simple: {str(e)}") + raise + finally: + for workflow_id in workflow_ids: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + def test_http_poll_workflow( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + """Test HTTP poll workflow functionality.""" + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=f"{test_workflow_name}_http_poll", + input=simple_workflow_input, + version=1, + correlationId=f"http_poll_{str(uuid.uuid4())[:8]}", + ) + + assert workflow_id is not None + assert isinstance(workflow_id, str) + assert len(workflow_id) > 0 + + # Wait a bit for the HTTP poll task to execute + time.sleep(5) + + workflow = workflow_client.get_workflow(workflow_id, include_tasks=True) + assert workflow.workflow_id == workflow_id + assert workflow.workflow_name == f"{test_workflow_name}_http_poll" + + except Exception as e: + print(f"Exception in test_http_poll_workflow: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) diff --git a/tests/integration/test_orkes_authorization_client_integration.py b/tests/integration/test_orkes_authorization_client_integration.py new file mode 100644 index 00000000..2a8f4ea8 --- /dev/null +++ b/tests/integration/test_orkes_authorization_client_integration.py @@ -0,0 +1,760 @@ +import os +import uuid + +import pytest + +from conductor.client.http.models.create_or_update_application_request import \ + CreateOrUpdateApplicationRequestAdapter as CreateOrUpdateApplicationRequest +from conductor.client.http.models.subject_ref import \ + SubjectRefAdapter as SubjectRef +from conductor.client.http.models.target_ref import \ + TargetRefAdapter as TargetRef +from conductor.client.http.models.upsert_group_request import \ + UpsertGroupRequestAdapter as UpsertGroupRequest +from conductor.client.http.models.upsert_user_request import \ + UpsertUserRequestAdapter as UpsertUserRequest +from conductor.client.configuration.configuration import Configuration +from conductor.client.codegen.rest import ApiException +from conductor.client.orkes.models.access_key_status import AccessKeyStatus +from conductor.client.orkes.models.access_type import AccessType +from conductor.client.orkes.models.metadata_tag import MetadataTag +from conductor.client.orkes.orkes_authorization_client import \ + OrkesAuthorizationClient +from conductor.shared.http.enums.subject_type import SubjectType +from conductor.shared.http.enums.target_type import TargetType + + +class TestOrkesAuthorizationClientIntegration: + """ + Integration tests for OrkesAuthorizationClient. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + """Create configuration from environment variables.""" + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def auth_client(self, configuration: Configuration) -> OrkesAuthorizationClient: + """Create OrkesAuthorizationClient instance.""" + return OrkesAuthorizationClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + """Generate unique suffix for test resources.""" + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def test_application_name(self, test_suffix: str) -> str: + """Generate test application name.""" + return f"test_app_{test_suffix}" + + @pytest.fixture(scope="class") + def test_user_id(self, test_suffix: str) -> str: + """Generate test user ID.""" + return f"test_user_{test_suffix}@example.com" + + @pytest.fixture(scope="class") + def test_group_id(self, test_suffix: str) -> str: + """Generate test group ID.""" + return f"test_group_{test_suffix}" + + @pytest.fixture(scope="class") + def test_workflow_name(self, test_suffix: str) -> str: + """Generate test workflow name.""" + return f"test_workflow_{test_suffix}" + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_application_lifecycle( + self, auth_client: OrkesAuthorizationClient, test_application_name: str + ): + """Test complete application lifecycle: create, read, update, delete.""" + try: + create_request = CreateOrUpdateApplicationRequest(test_application_name) + created_app = auth_client.create_application(create_request) + + assert created_app.name == test_application_name + assert created_app.id is not None + + retrieved_app = auth_client.get_application(created_app.id) + assert retrieved_app.id == created_app.id + assert retrieved_app.name == test_application_name + + applications = auth_client.list_applications() + app_ids = [app.id for app in applications] + assert created_app.id in app_ids + + updated_name = f"{test_application_name}_updated" + update_request = CreateOrUpdateApplicationRequest(updated_name) + updated_app = auth_client.update_application(update_request, created_app.id) + assert updated_app.name == updated_name + + tags = [ + MetadataTag("environment", "test"), + MetadataTag("owner", "integration_test"), + ] + auth_client.set_application_tags(tags, created_app.id) + retrieved_tags = auth_client.get_application_tags(created_app.id) + assert len(retrieved_tags) == 2 + tag_keys = [tag.key for tag in retrieved_tags] + assert "environment" in tag_keys + assert "owner" in tag_keys + + created_key = auth_client.create_access_key(created_app.id) + assert created_key.id is not None + assert created_key.secret is not None + + access_keys = auth_client.get_access_keys(created_app.id) + assert len(access_keys) >= 1 + key_ids = [key.id for key in access_keys] + assert created_key.id in key_ids + + toggled_key = auth_client.toggle_access_key_status( + created_app.id, created_key.id + ) + assert toggled_key.status == AccessKeyStatus.INACTIVE + + active_key = auth_client.toggle_access_key_status( + created_app.id, created_key.id + ) + assert active_key.status == AccessKeyStatus.ACTIVE + + auth_client.delete_access_key(created_app.id, created_key.id) + + auth_client.add_role_to_application_user(created_app.id, "USER") + app_user_id = f"app:{created_app.id}" + app_user = auth_client.get_user(app_user_id) + user_roles = [role.name for role in app_user.roles] + assert "USER" in user_roles + + auth_client.remove_role_from_application_user(created_app.id, "USER") + app_user = auth_client.get_user(app_user_id) + user_roles = [role.name for role in app_user.roles] + assert "USER" not in user_roles + + finally: + auth_client.delete_application(created_app.id) + + with pytest.raises(ApiException) as exc_info: + auth_client.get_application(created_app.id) + assert exc_info.value.code == 404 + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_user_lifecycle( + self, auth_client: OrkesAuthorizationClient, test_user_id: str + ): + """Test complete user lifecycle: create, read, update, delete.""" + try: + create_request = UpsertUserRequest(name="Test User", roles=["USER"]) + created_user = auth_client.upsert_user(create_request, test_user_id) + + assert created_user.id == test_user_id + assert created_user.name == "Test User" + + retrieved_user = auth_client.get_user(test_user_id) + assert retrieved_user.id == test_user_id + assert retrieved_user.name == "Test User" + + users = auth_client.list_users() + user_ids = [user.id for user in users] + assert test_user_id in user_ids + + update_request = UpsertUserRequest( + name="Updated Test User", roles=["USER", "ADMIN"] + ) + updated_user = auth_client.upsert_user(update_request, test_user_id) + assert updated_user.name == "Updated Test User" + user_roles = [role.name for role in updated_user.roles] + assert "USER" in user_roles + assert "ADMIN" in user_roles + + finally: + auth_client.delete_user(test_user_id) + + with pytest.raises(ApiException) as exc_info: + auth_client.get_user(test_user_id) + assert exc_info.value.code == 404 + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_group_lifecycle( + self, + auth_client: OrkesAuthorizationClient, + test_group_id: str, + test_user_id: str, + ): + """Test complete group lifecycle: create, read, update, delete.""" + try: + user_create_request = UpsertUserRequest(name="Test User", roles=["USER"]) + created_user = auth_client.upsert_user(user_create_request, test_user_id) + assert created_user.id == test_user_id + assert created_user.name == "Test User" + + create_request = UpsertGroupRequest( + description="Test Group", roles=["USER"] + ) + created_group = auth_client.upsert_group(create_request, test_group_id) + + assert created_group.id == test_group_id + assert created_group.description == "Test Group" + + retrieved_group = auth_client.get_group(test_group_id) + assert retrieved_group.id == test_group_id + assert retrieved_group.description == "Test Group" + + groups = auth_client.list_groups() + group_ids = [group.id for group in groups] + assert test_group_id in group_ids + + auth_client.add_user_to_group(test_group_id, test_user_id) + group_users = auth_client.get_users_in_group(test_group_id) + user_ids = [user.id for user in group_users] + assert test_user_id in user_ids + + auth_client.remove_user_from_group(test_group_id, test_user_id) + group_users = auth_client.get_users_in_group(test_group_id) + user_ids = [user.id for user in group_users] + assert test_user_id not in user_ids + + finally: + auth_client.delete_group(test_group_id) + auth_client.delete_user(test_user_id) + + with pytest.raises(ApiException) as exc_info: + auth_client.get_group(test_group_id) + assert exc_info.value.code == 404 + + with pytest.raises(ApiException) as exc_info: + auth_client.get_user(test_user_id) + assert exc_info.value.code == 404 + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_permissions_lifecycle( + self, + auth_client: OrkesAuthorizationClient, + test_user_id: str, + test_group_id: str, + test_workflow_name: str, + ): + """Test permissions lifecycle: grant, retrieve, remove.""" + try: + user_create_request = UpsertUserRequest(name="Test User", roles=["USER"]) + created_user = auth_client.upsert_user(user_create_request, test_user_id) + assert created_user.id == test_user_id + assert created_user.name == "Test User" + + create_request = UpsertGroupRequest( + description="Test Group", roles=["USER"] + ) + created_group = auth_client.upsert_group(create_request, test_group_id) + + assert created_group.id == test_group_id + assert created_group.description == "Test Group" + + target = TargetRef(test_workflow_name, TargetType.WORKFLOW_DEF) + + user_subject = SubjectRef(test_user_id, SubjectType.USER) + group_subject = SubjectRef(test_group_id, SubjectType.GROUP) + + user_access = [AccessType.EXECUTE, AccessType.READ] + auth_client.grant_permissions(user_subject, target, user_access) + + group_access = [AccessType.READ] + auth_client.grant_permissions(group_subject, target, group_access) + + target_permissions = auth_client.get_permissions(target) + + assert AccessType.EXECUTE in target_permissions + assert AccessType.READ in target_permissions + + user_perms = target_permissions[AccessType.EXECUTE] + assert any( + subject.id == test_user_id and subject.type == SubjectType.USER + for subject in user_perms + ) + + read_perms = target_permissions[AccessType.READ] + assert any( + subject.id == test_user_id and subject.type == SubjectType.USER + for subject in read_perms + ) + assert any( + subject.id == test_group_id and subject.type == SubjectType.GROUP + for subject in read_perms + ) + + user_granted_perms = auth_client.get_granted_permissions_for_user( + test_user_id + ) + assert len(user_granted_perms) >= 1 + user_target_perms = [ + perm + for perm in user_granted_perms + if perm.target.id == test_workflow_name + ] + assert len(user_target_perms) >= 1 + assert AccessType.EXECUTE in user_target_perms[0].access + assert AccessType.READ in user_target_perms[0].access + + group_granted_perms = auth_client.get_granted_permissions_for_group( + test_group_id + ) + assert len(group_granted_perms) >= 1 + group_target_perms = [ + perm + for perm in group_granted_perms + if perm.target.id == test_workflow_name + ] + assert len(group_target_perms) >= 1 + assert AccessType.READ in group_target_perms[0].access + + auth_client.remove_permissions(user_subject, target, user_access) + auth_client.remove_permissions(group_subject, target, group_access) + + target_permissions_after = auth_client.get_permissions(target) + if AccessType.EXECUTE in target_permissions_after: + user_perms_after = target_permissions_after[AccessType.EXECUTE] + assert not any( + subject.id == test_user_id and subject.type == SubjectType.USER + for subject in user_perms_after + ) + + if AccessType.READ in target_permissions_after: + read_perms_after = target_permissions_after[AccessType.READ] + assert not any( + subject.id == test_user_id and subject.type == SubjectType.USER + for subject in read_perms_after + ) + assert not any( + subject.id == test_group_id and subject.type == SubjectType.GROUP + for subject in read_perms_after + ) + + finally: + auth_client.delete_group(test_group_id) + auth_client.delete_user(test_user_id) + + with pytest.raises(ApiException) as exc_info: + auth_client.get_group(test_group_id) + assert exc_info.value.code == 404 + + with pytest.raises(ApiException) as exc_info: + auth_client.get_user(test_user_id) + assert exc_info.value.code == 404 + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_error_handling(self, auth_client: OrkesAuthorizationClient): + """Test error handling for non-existent resources.""" + non_existent_id = "non_existent_" + str(uuid.uuid4()) + + with pytest.raises(ApiException) as exc_info: + auth_client.get_application(non_existent_id) + assert exc_info.value.code == 404 + + with pytest.raises(ApiException) as exc_info: + auth_client.get_user(non_existent_id) + assert exc_info.value.code == 404 + + with pytest.raises(ApiException) as exc_info: + auth_client.get_group(non_existent_id) + assert exc_info.value.code == 404 + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_concurrent_operations( + self, auth_client: OrkesAuthorizationClient, test_suffix: str + ): + """Test concurrent operations on multiple resources.""" + try: + import threading + import time + + results = [] + errors = [] + created_apps = [] + cleanup_lock = threading.Lock() + + def create_and_delete_app(app_suffix: str): + app_id = None + try: + app_name = f"concurrent_app_{app_suffix}" + create_request = CreateOrUpdateApplicationRequest(app_name) + created_app = auth_client.create_application(create_request) + app_id = created_app.id + + with cleanup_lock: + created_apps.append(app_id) + + time.sleep(0.1) + + retrieved_app = auth_client.get_application(created_app.id) + assert retrieved_app.name == app_name + + if os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true": + try: + auth_client.delete_application(created_app.id) + with cleanup_lock: + if app_id in created_apps: + created_apps.remove(app_id) + except Exception as cleanup_error: + print( + f"Warning: Failed to cleanup app {app_id} in thread: {str(cleanup_error)}" + ) + + results.append(f"app_{app_suffix}_success") + except Exception as e: + errors.append(f"app_{app_suffix}_error: {str(e)}") + if app_id and app_id not in created_apps: + with cleanup_lock: + created_apps.append(app_id) + + threads = [] + for i in range(3): + thread = threading.Thread( + target=create_and_delete_app, args=(f"{test_suffix}_{i}",) + ) + threads.append(thread) + thread.start() + + for thread in threads: + thread.join() + + assert ( + len(results) == 3 + ), f"Expected 3 successful operations, got {len(results)}. Errors: {errors}" + assert len(errors) == 0, f"Unexpected errors: {errors}" + + finally: + for app_id in created_apps: + try: + auth_client.delete_application(app_id) + except Exception as e: + print(f"Warning: Failed to delete app {app_id}: {str(e)}") + + remaining_apps = [] + for app_id in created_apps: + try: + auth_client.get_application(app_id) + remaining_apps.append(app_id) + except ApiException as e: + if e.code == 404: + pass + else: + remaining_apps.append(app_id) + except Exception: + remaining_apps.append(app_id) + + if remaining_apps: + print( + f"Warning: {len(remaining_apps)} applications could not be verified as deleted: {remaining_apps}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_complex_user_management_flow( + self, auth_client: OrkesAuthorizationClient, test_suffix: str + ): + created_resources = { + "applications": [], + "users": [], + "groups": [], + "access_keys": [], + "permissions": [], + } + + try: + main_app_name = f"main_app_{test_suffix}" + main_app_request = CreateOrUpdateApplicationRequest(main_app_name) + main_app = auth_client.create_application(main_app_request) + created_resources["applications"].append(main_app.id) + + departments = ["engineering", "marketing", "finance", "hr"] + department_apps = {} + + for dept in departments: + dept_app_name = f"{dept}_app_{test_suffix}" + dept_app_request = CreateOrUpdateApplicationRequest(dept_app_name) + dept_app = auth_client.create_application(dept_app_request) + department_apps[dept] = dept_app + created_resources["applications"].append(dept_app.id) + + dept_tags = [ + MetadataTag("department", dept), + MetadataTag("parent_app", main_app.id), + MetadataTag("environment", "test"), + ] + auth_client.set_application_tags(dept_tags, dept_app.id) + + admin_users = {} + admin_roles = ["ADMIN"] + + for role in admin_roles: + admin_id = f"admin_{role.lower()}_{test_suffix}@company.com" + admin_request = UpsertUserRequest(name=f"Admin {role}", roles=[role]) + admin_user = auth_client.upsert_user(admin_request, admin_id) + admin_users[role] = admin_user + created_resources["users"].append(admin_id) + + manager_users = {} + for dept in departments: + manager_id = f"manager_{dept}_{test_suffix}@company.com" + manager_request = UpsertUserRequest( + name=f"Manager {dept.title()}", roles=["METADATA_MANAGER", "USER"] + ) + manager_user = auth_client.upsert_user(manager_request, manager_id) + manager_users[dept] = manager_user + created_resources["users"].append(manager_id) + + employee_users = {} + for dept in departments: + dept_employees = [] + for i in range(3): + emp_id = f"emp_{dept}_{i}_{test_suffix}@company.com" + emp_request = UpsertUserRequest( + name=f"Employee {i} {dept.title()}", roles=["USER"] + ) + emp_user = auth_client.upsert_user(emp_request, emp_id) + dept_employees.append(emp_user) + created_resources["users"].append(emp_id) + employee_users[dept] = dept_employees + + main_groups = {} + group_roles = ["worker", "user", "metadata_manager", "workflow_manager"] + + for role in group_roles: + group_id = f"group_{role}_{test_suffix}" + group_request = UpsertGroupRequest( + description=f"Group {role.title()}", roles=[role.upper()] + ) + group = auth_client.upsert_group(group_request, group_id) + main_groups[role] = group + created_resources["groups"].append(group_id) + + dept_groups = {} + for dept in departments: + dept_group_id = f"group_{dept}_{test_suffix}" + dept_group_request = UpsertGroupRequest( + description=f"Group {dept.title()}", roles=["USER"] + ) + dept_group = auth_client.upsert_group(dept_group_request, dept_group_id) + dept_groups[dept] = dept_group + created_resources["groups"].append(dept_group_id) + + for admin_user in admin_users.values(): + auth_client.add_user_to_group(main_groups["worker"].id, admin_user.id) + + for dept, manager_user in manager_users.items(): + auth_client.add_user_to_group( + main_groups["metadata_manager"].id, manager_user.id + ) + auth_client.add_user_to_group(dept_groups[dept].id, manager_user.id) + + for dept, employees in employee_users.items(): + for emp_user in employees: + auth_client.add_user_to_group(main_groups["user"].id, emp_user.id) + auth_client.add_user_to_group(dept_groups[dept].id, emp_user.id) + + main_app_key = auth_client.create_access_key(main_app.id) + created_resources["access_keys"].append((main_app.id, main_app_key.id)) + + for dept, dept_app in department_apps.items(): + dept_key = auth_client.create_access_key(dept_app.id) + created_resources["access_keys"].append((dept_app.id, dept_key.id)) + + if dept in ["engineering", "marketing"]: + auth_client.toggle_access_key_status(dept_app.id, dept_key.id) + + workflows = { + "main": f"main_workflow_{test_suffix}", + "engineering": f"eng_workflow_{test_suffix}", + "marketing": f"marketing_workflow_{test_suffix}", + "finance": f"finance_workflow_{test_suffix}", + "hr": f"hr_workflow_{test_suffix}", + } + + for workflow_name in workflows.values(): + workflow_target = TargetRef(workflow_name, TargetType.WORKFLOW_DEF) + + exec_subject = SubjectRef(main_groups["worker"].id, SubjectType.GROUP) + auth_client.grant_permissions( + exec_subject, + workflow_target, + [AccessType.EXECUTE, AccessType.READ, AccessType.CREATE], + ) + created_resources["permissions"].append( + ( + exec_subject, + workflow_target, + [AccessType.EXECUTE, AccessType.READ, AccessType.CREATE], + ) + ) + + manager_subject = SubjectRef( + main_groups["metadata_manager"].id, SubjectType.GROUP + ) + auth_client.grant_permissions( + manager_subject, + workflow_target, + [AccessType.EXECUTE, AccessType.READ], + ) + created_resources["permissions"].append( + ( + manager_subject, + workflow_target, + [AccessType.EXECUTE, AccessType.READ], + ) + ) + + emp_subject = SubjectRef(main_groups["user"].id, SubjectType.GROUP) + auth_client.grant_permissions( + emp_subject, workflow_target, [AccessType.READ] + ) + created_resources["permissions"].append( + (emp_subject, workflow_target, [AccessType.READ]) + ) + + for dept in departments: + dept_workflow = workflows[dept] + dept_target = TargetRef(dept_workflow, TargetType.WORKFLOW_DEF) + dept_group_subject = SubjectRef(dept_groups[dept].id, SubjectType.GROUP) + + auth_client.grant_permissions( + dept_group_subject, + dept_target, + [AccessType.CREATE, AccessType.EXECUTE, AccessType.READ], + ) + created_resources["permissions"].append( + ( + dept_group_subject, + dept_target, + [AccessType.CREATE, AccessType.EXECUTE, AccessType.READ], + ) + ) + + all_apps = auth_client.list_applications() + app_ids = [app.id for app in all_apps] + for app_id in created_resources["applications"]: + assert app_id in app_ids, f"Application {app_id} not found in list" + + all_users = auth_client.list_users() + user_ids = [user.id for user in all_users] + for user_id in created_resources["users"]: + assert user_id in user_ids, f"User {user_id} not found in list" + + all_groups = auth_client.list_groups() + group_ids = [group.id for group in all_groups] + for group_id in created_resources["groups"]: + assert group_id in group_ids, f"Group {group_id} not found in list" + + for dept, manager_user in manager_users.items(): + group_users = auth_client.get_users_in_group(dept_groups[dept].id) + group_user_ids = [user.id for user in group_users] + assert ( + manager_user.id in group_user_ids + ), f"Manager {manager_user.id} not in {dept} group" + + for workflow_name in workflows.values(): + workflow_target = TargetRef(workflow_name, TargetType.WORKFLOW_DEF) + permissions = auth_client.get_permissions(workflow_target) + + if AccessType.EXECUTE in permissions: + exec_perms = permissions[AccessType.EXECUTE] + assert any( + subject.id == main_groups["worker"].id + and subject.type == SubjectType.GROUP + for subject in exec_perms + ), f"Worker missing execute permission on {workflow_name}" + + bulk_users = [] + for i in range(5): + bulk_user_id = f"bulk_user_{i}_{test_suffix}@company.com" + bulk_user_request = UpsertUserRequest( + name=f"Bulk User {i}", roles=["USER"] + ) + bulk_user = auth_client.upsert_user(bulk_user_request, bulk_user_id) + bulk_users.append(bulk_user_id) + created_resources["users"].append(bulk_user_id) + + for user_id in bulk_users: + auth_client.add_user_to_group(main_groups["user"].id, user_id) + + group_users = auth_client.get_users_in_group(main_groups["user"].id) + group_user_ids = [user.id for user in group_users] + for user_id in bulk_users: + assert ( + user_id in group_user_ids + ), f"Bulk user {user_id} not in employees group" + + except Exception as e: + print(f"Error during complex flow: {str(e)}") + raise + finally: + self._perform_comprehensive_cleanup(auth_client, created_resources) + + def _perform_comprehensive_cleanup( + self, auth_client: OrkesAuthorizationClient, created_resources: dict + ): + + cleanup_enabled = os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + if not cleanup_enabled: + return + + for subject, target, access_types in created_resources["permissions"]: + try: + auth_client.remove_permissions(subject, target, access_types) + except Exception as e: + print( + f"Warning: Failed to remove permission {subject.id} -> {target.id}: {str(e)}" + ) + + for group_id in created_resources["groups"]: + try: + group_users = auth_client.get_users_in_group(group_id) + for user in group_users: + if user.id in created_resources["users"]: + auth_client.remove_user_from_group(group_id, user.id) + except Exception as e: + print( + f"Warning: Failed to remove users from group {group_id}: {str(e)}" + ) + + for app_id, key_id in created_resources["access_keys"]: + try: + auth_client.delete_access_key(app_id, key_id) + except Exception as e: + print( + f"Warning: Failed to delete access key {key_id} from app {app_id}: {str(e)}" + ) + + for group_id in created_resources["groups"]: + try: + auth_client.delete_group(group_id) + except Exception as e: + print(f"Warning: Failed to delete group {group_id}: {str(e)}") + + for user_id in created_resources["users"]: + try: + auth_client.delete_user(user_id) + except Exception as e: + print(f"Warning: Failed to delete user {user_id}: {str(e)}") + + for app_id in created_resources["applications"]: + try: + auth_client.delete_application(app_id) + except Exception as e: + print(f"Warning: Failed to delete application {app_id}: {str(e)}") diff --git a/tests/integration/test_orkes_integration_client_integration.py b/tests/integration/test_orkes_integration_client_integration.py new file mode 100644 index 00000000..ca7f83d5 --- /dev/null +++ b/tests/integration/test_orkes_integration_client_integration.py @@ -0,0 +1,360 @@ +import os +import pytest +import uuid +import threading +import time + +from conductor.client.configuration.configuration import Configuration +from conductor.client.orkes.orkes_integration_client import OrkesIntegrationClient +from conductor.client.http.models.integration_update import ( + IntegrationUpdateAdapter as IntegrationUpdate, +) +from conductor.client.http.models.integration_api_update import ( + IntegrationApiUpdateAdapter as IntegrationApiUpdate, +) +from conductor.client.orkes.models.metadata_tag import MetadataTag +from conductor.client.codegen.rest import ApiException + + +class TestOrkesIntegrationClientIntegration: + """ + Integration tests for OrkesIntegrationClient covering all endpoints. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def integration_client(self, configuration: Configuration) -> OrkesIntegrationClient: + return OrkesIntegrationClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def simple_integration_config(self) -> dict: + return { + "awsAccountId": "test_account_id", + } + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_save_and_get_integration_provider( + self, + integration_client: OrkesIntegrationClient, + test_suffix: str, + simple_integration_config: dict, + ): + integration_name = f"openai_{test_suffix}" + integration_update = IntegrationUpdate( + category="AI_MODEL", + type="openai", + description="Test integration provider", + enabled=True, + configuration=simple_integration_config, + ) + + try: + integration_client.save_integration_provider(integration_name, integration_update) + retrieved_integration = integration_client.get_integration_provider(integration_name) + + assert retrieved_integration.name == integration_name + assert retrieved_integration.category == integration_update.category + assert retrieved_integration.type == integration_update.type + assert retrieved_integration.description == integration_update.description + assert retrieved_integration.enabled == integration_update.enabled + finally: + self._cleanup_integration(integration_client, integration_name) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_save_and_get_integration( + self, + integration_client: OrkesIntegrationClient, + test_suffix: str, + simple_integration_config: dict, + ): + integration_name = f"test_integration_{test_suffix}" + integration_update = IntegrationUpdate( + category="AI_MODEL", + type="openai", + description="Test integration", + enabled=True, + configuration=simple_integration_config, + ) + + try: + integration_client.save_integration(integration_name, integration_update) + retrieved_integration = integration_client.get_integration(integration_name) + + assert retrieved_integration.name == integration_name + assert retrieved_integration.category == integration_update.category + assert retrieved_integration.type == integration_update.type + assert retrieved_integration.description == integration_update.description + assert retrieved_integration.enabled == integration_update.enabled + finally: + self._cleanup_integration(integration_client, integration_name) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_get_integration_providers( + self, + integration_client: OrkesIntegrationClient, + test_suffix: str, + simple_integration_config: dict, + ): + integration_name = f"test_providers_{test_suffix}" + integration_update = IntegrationUpdate( + category="AI_MODEL", + type="openai", + description="Test integration providers", + enabled=True, + configuration=simple_integration_config, + ) + + try: + integration_client.save_integration_provider(integration_name, integration_update) + + all_providers = integration_client.get_integration_providers() + assert isinstance(all_providers, list) + + provider_names = [provider.name for provider in all_providers] + assert integration_name in provider_names + + ai_providers = integration_client.get_integration_providers(category="AI_MODEL") + assert isinstance(ai_providers, list) + + active_providers = integration_client.get_integration_providers(active_only=True) + assert isinstance(active_providers, list) + finally: + self._cleanup_integration(integration_client, integration_name) + + @pytest.mark.v4_1_73 + def test_get_integration_provider_defs( + self, + integration_client: OrkesIntegrationClient, + ): + provider_defs = integration_client.get_integration_provider_defs() + assert isinstance(provider_defs, list) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_get_all_integrations( + self, + integration_client: OrkesIntegrationClient, + test_suffix: str, + simple_integration_config: dict, + ): + integration_name = f"test_all_integrations_{test_suffix}" + + integration_update = IntegrationUpdate( + category="AI_MODEL", + type="openai", + description="Test integration for all integrations", + enabled=True, + configuration=simple_integration_config, + ) + + try: + integration_client.save_integration_provider(integration_name, integration_update) + + all_integrations = integration_client.get_all_integrations() + assert isinstance(all_integrations, list) + + integration_names = [integration.name for integration in all_integrations] + assert integration_name in integration_names + + ai_integrations = integration_client.get_all_integrations(category="AI_MODEL") + assert isinstance(ai_integrations, list) + + active_integrations = integration_client.get_all_integrations(active_only=True) + assert isinstance(active_integrations, list) + finally: + self._cleanup_integration(integration_client, integration_name) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_get_providers_and_integrations( + self, + integration_client: OrkesIntegrationClient, + test_suffix: str, + simple_integration_config: dict, + ): + integration_name = f"test_providers_and_integrations_{test_suffix}" + + integration_update = IntegrationUpdate( + category="AI_MODEL", + type="openai", + description="Test integration for providers and integrations", + enabled=True, + configuration=simple_integration_config, + ) + + try: + integration_client.save_integration_provider(integration_name, integration_update) + + providers_and_integrations = integration_client.get_providers_and_integrations() + assert isinstance(providers_and_integrations, list) + + openai_providers = integration_client.get_providers_and_integrations(integration_type="openai") + assert isinstance(openai_providers, list) + + active_providers = integration_client.get_providers_and_integrations(active_only=True) + assert isinstance(active_providers, list) + finally: + self._cleanup_integration(integration_client, integration_name) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_integration_provider_tags( + self, + integration_client: OrkesIntegrationClient, + test_suffix: str, + simple_integration_config: dict, + ): + integration_name = f"test_provider_tags_{test_suffix}" + + integration_update = IntegrationUpdate( + category="AI_MODEL", + type="openai", + description="Test integration for provider tags", + enabled=True, + configuration=simple_integration_config, + ) + + try: + integration_client.save_integration_provider(integration_name, integration_update) + + tag = MetadataTag("priority", "high"), + + integration_client.put_tag_for_integration_provider(tag, integration_name) + + retrieved_tags = integration_client.get_tags_for_integration_provider(integration_name) + assert len(retrieved_tags) == 1 + tag_keys = [tag.key for tag in retrieved_tags] + assert "priority" in tag_keys + + tag_to_delete = MetadataTag("priority", "high") + integration_client.delete_tag_for_integration_provider(tag_to_delete, integration_name) + + retrieved_tags_after_delete = integration_client.get_tags_for_integration_provider(integration_name) + remaining_tag_keys = [tag.key for tag in retrieved_tags_after_delete] + assert "priority" not in remaining_tag_keys + finally: + self._cleanup_integration(integration_client, integration_name) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_integration_not_found(self, integration_client: OrkesIntegrationClient): + non_existent_integration = f"non_existent_{str(uuid.uuid4())}" + non_existent_api = f"non_existent_api_{str(uuid.uuid4())}" + + retrieved_integration = integration_client.get_integration(non_existent_integration) + assert retrieved_integration is None + + retrieved_api = integration_client.get_integration_api(non_existent_api, non_existent_integration) + assert retrieved_api is None + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_concurrent_integration_operations( + self, + integration_client: OrkesIntegrationClient, + test_suffix: str, + simple_integration_config: dict, + ): + results = [] + errors = [] + created_integrations = [] + cleanup_lock = threading.Lock() + + def create_and_manage_integration(integration_suffix: str): + integration_name = None + try: + integration_name = f"concurrent_integration_{integration_suffix}" + integration_update = IntegrationUpdate( + category="AI_MODEL", + type="openai", + description="Concurrent test integration", + enabled=True, + configuration=simple_integration_config, + ) + + integration_client.save_integration_provider(integration_name, integration_update) + + with cleanup_lock: + created_integrations.append(integration_name) + + time.sleep(0.1) + + retrieved_integration = integration_client.get_integration_provider(integration_name) + assert retrieved_integration.name == integration_name + + if os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true": + try: + integration_client.delete_integration(integration_name) + with cleanup_lock: + if integration_name in created_integrations: + created_integrations.remove(integration_name) + except Exception as cleanup_error: + print(f"Warning: Failed to cleanup integration {integration_name} in thread: {str(cleanup_error)}") + + results.append(f"integration_{integration_suffix}_success") + except Exception as e: + errors.append(f"integration_{integration_suffix}_error: {str(e)}") + if integration_name and integration_name not in created_integrations: + with cleanup_lock: + created_integrations.append(integration_name) + + threads = [] + for i in range(3): + thread = threading.Thread( + target=create_and_manage_integration, args=(f"{test_suffix}_{i}",) + ) + threads.append(thread) + thread.start() + + for thread in threads: + thread.join() + + assert len(results) == 3, f"Expected 3 successful operations, got {len(results)}. Errors: {errors}" + assert len(errors) == 0, f"Unexpected errors: {errors}" + + for integration_name in created_integrations: + try: + integration_client.delete_integration(integration_name) + except Exception as e: + print(f"Warning: Failed to delete integration {integration_name}: {str(e)}") + + def _cleanup_integration(self, integration_client: OrkesIntegrationClient, integration_name: str): + cleanup_enabled = os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + if not cleanup_enabled: + return + + try: + integration_client.delete_integration(integration_name) + except Exception as e: + print(f"Warning: Failed to cleanup integration {integration_name}: {str(e)}") + + def _cleanup_integration_api(self, integration_client: OrkesIntegrationClient, api_name: str, integration_name: str): + cleanup_enabled = os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + if not cleanup_enabled: + return + + try: + integration_client.delete_integration_api(api_name, integration_name) + except Exception as e: + print(f"Warning: Failed to cleanup integration API {api_name}: {str(e)}") diff --git a/tests/integration/test_orkes_metadata_client_integration.py b/tests/integration/test_orkes_metadata_client_integration.py new file mode 100644 index 00000000..ecd37002 --- /dev/null +++ b/tests/integration/test_orkes_metadata_client_integration.py @@ -0,0 +1,880 @@ +import os +import uuid + +import pytest + +from conductor.client.http.models.task_def import \ + TaskDefAdapter as TaskDef +from conductor.client.http.models.workflow_def import \ + WorkflowDefAdapter as WorkflowDef +from conductor.client.http.models.workflow_task import \ + WorkflowTaskAdapter as WorkflowTask +from conductor.client.configuration.configuration import Configuration +from conductor.client.codegen.rest import ApiException +from conductor.client.orkes.models.metadata_tag import MetadataTag +from conductor.client.orkes.orkes_metadata_client import OrkesMetadataClient + + +class TestOrkesMetadataClientIntegration: + """ + Integration tests for OrkesMetadataClient. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def metadata_client(self, configuration: Configuration) -> OrkesMetadataClient: + return OrkesMetadataClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def test_workflow_name(self, test_suffix: str) -> str: + return f"test_workflow_{test_suffix}" + + @pytest.fixture(scope="class") + def test_task_type(self, test_suffix: str) -> str: + return f"test_task_{test_suffix}" + + @pytest.fixture(scope="class") + def simple_workflow_task(self) -> WorkflowTask: + return WorkflowTask( + name="simple_task", + task_reference_name="simple_task_ref", + type="SIMPLE", + input_parameters={}, + ) + + @pytest.fixture(scope="class") + def simple_workflow_def( + self, test_suffix: str, simple_workflow_task: WorkflowTask + ) -> WorkflowDef: + return WorkflowDef( + name=f"test_workflow_{test_suffix}", + version=1, + description="A simple test workflow", + tasks=[simple_workflow_task], + timeout_seconds=60, + timeout_policy="TIME_OUT_WF", + restartable=True, + owner_email="test@example.com", + ) + + @pytest.fixture(scope="class") + def complex_workflow_def(self, test_suffix: str) -> WorkflowDef: + task1 = WorkflowTask( + name="task1", + task_reference_name="task1_ref", + type="SIMPLE", + input_parameters={"param1": "${workflow.input.value1}"}, + ) + task2 = WorkflowTask( + name="task2", + task_reference_name="task2_ref", + type="SIMPLE", + input_parameters={"param2": "${task1_ref.output.result}"}, + ) + task2.start_delay = 0 + task2.optional = False + + return WorkflowDef( + name=f"test_complex_workflow_{test_suffix}", + version=1, + description="A complex test workflow with multiple tasks", + tasks=[task1, task2], + timeout_seconds=120, + timeout_policy="TIME_OUT_WF", + restartable=True, + owner_email="test@example.com", + input_parameters=["value1", "value2"], + output_parameters={"result": "${task2_ref.output.final_result}"}, + ) + + @pytest.fixture(scope="class") + def simple_task_def(self, test_suffix: str) -> TaskDef: + return TaskDef( + name=f"test_task_{test_suffix}", + description="A simple test task", + timeout_seconds=30, + total_timeout_seconds=60, + retry_count=3, + retry_logic="FIXED", + retry_delay_seconds=5, + timeout_policy="TIME_OUT_WF", + response_timeout_seconds=30, + concurrent_exec_limit=1, + input_keys=["input_param"], + output_keys=["output_param"], + owner_email="test@example.com", + ) + + @pytest.mark.v3_21_16 + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_lifecycle_simple( + self, + metadata_client: OrkesMetadataClient, + simple_workflow_def: WorkflowDef, + ): + try: + metadata_client.register_workflow_def(simple_workflow_def, overwrite=True) + + retrieved_workflow = metadata_client.get_workflow_def( + simple_workflow_def.name + ) + assert retrieved_workflow.name == simple_workflow_def.name + assert retrieved_workflow.version == simple_workflow_def.version + assert retrieved_workflow.description == simple_workflow_def.description + + all_workflows = metadata_client.get_all_workflow_defs() + workflow_names = [wf.name for wf in all_workflows] + assert simple_workflow_def.name in workflow_names + + except Exception as e: + print(f"Exception in test_workflow_lifecycle_simple: {str(e)}") + raise + finally: + try: + metadata_client.unregister_workflow_def( + simple_workflow_def.name, simple_workflow_def.version + ) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {simple_workflow_def.name}: {str(e)}" + ) + + @pytest.mark.v3_21_16 + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_lifecycle_complex( + self, + metadata_client: OrkesMetadataClient, + complex_workflow_def: WorkflowDef, + ): + try: + metadata_client.register_workflow_def(complex_workflow_def, overwrite=True) + + retrieved_workflow = metadata_client.get_workflow_def( + complex_workflow_def.name + ) + assert retrieved_workflow.name == complex_workflow_def.name + assert retrieved_workflow.version == complex_workflow_def.version + assert len(retrieved_workflow.tasks) == 2 + + except Exception as e: + print(f"Exception in test_workflow_lifecycle_complex: {str(e)}") + raise + finally: + try: + metadata_client.unregister_workflow_def( + complex_workflow_def.name, complex_workflow_def.version + ) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {complex_workflow_def.name}: {str(e)}" + ) + + @pytest.mark.v3_21_16 + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_versioning( + self, + metadata_client: OrkesMetadataClient, + test_suffix: str, + simple_workflow_task: WorkflowTask, + ): + workflow_name = f"test_versioned_workflow_{test_suffix}" + try: + workflow_v1 = WorkflowDef( + name=workflow_name, + version=1, + description="Version 1 of the workflow", + tasks=[simple_workflow_task], + timeout_seconds=60, + timeout_policy="TIME_OUT_WF", + owner_email="test@example.com", + ) + + workflow_v2 = WorkflowDef( + name=workflow_name, + version=2, + description="Version 2 of the workflow", + tasks=[simple_workflow_task], + timeout_seconds=120, + timeout_policy="TIME_OUT_WF", + owner_email="test@example.com", + ) + + metadata_client.register_workflow_def(workflow_v1, overwrite=True) + metadata_client.register_workflow_def(workflow_v2, overwrite=True) + + retrieved_v1 = metadata_client.get_workflow_def(workflow_name, version=1) + assert retrieved_v1.version == 1 + assert retrieved_v1.timeout_seconds == 60 + + retrieved_v2 = metadata_client.get_workflow_def(workflow_name, version=2) + assert retrieved_v2.version == 2 + assert retrieved_v2.timeout_seconds == 120 + + except Exception as e: + print(f"Exception in test_workflow_versioning: {str(e)}") + raise + finally: + try: + metadata_client.unregister_workflow_def(workflow_name, 1) + metadata_client.unregister_workflow_def(workflow_name, 2) + except Exception as e: + print(f"Warning: Failed to cleanup workflow {workflow_name}: {str(e)}") + + @pytest.mark.v3_21_16 + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_update( + self, + metadata_client: OrkesMetadataClient, + test_suffix: str, + simple_workflow_task: WorkflowTask, + ): + workflow_name = f"test_workflow_update_{test_suffix}" + try: + initial_workflow = WorkflowDef( + name=workflow_name, + version=1, + description="Initial workflow", + tasks=[simple_workflow_task], + timeout_seconds=60, + timeout_policy="TIME_OUT_WF", + owner_email="test@example.com", + ) + + metadata_client.register_workflow_def(initial_workflow, overwrite=True) + + retrieved_workflow = metadata_client.get_workflow_def(workflow_name) + assert retrieved_workflow.description == "Initial workflow" + + updated_workflow = WorkflowDef( + name=workflow_name, + version=1, + description="Updated workflow", + tasks=[simple_workflow_task], + timeout_seconds=120, + timeout_policy="TIME_OUT_WF", + owner_email="test@example.com", + ) + + metadata_client.update_workflow_def(updated_workflow, overwrite=True) + + updated_retrieved_workflow = metadata_client.get_workflow_def(workflow_name) + assert updated_retrieved_workflow.description == "Updated workflow" + assert updated_retrieved_workflow.timeout_seconds == 120 + + except Exception as e: + print(f"Exception in test_workflow_update: {str(e)}") + raise + finally: + try: + metadata_client.unregister_workflow_def(workflow_name, 1) + except Exception as e: + print(f"Warning: Failed to cleanup workflow {workflow_name}: {str(e)}") + + @pytest.mark.v3_21_16 + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_task_lifecycle( + self, + metadata_client: OrkesMetadataClient, + simple_task_def: TaskDef, + ): + try: + metadata_client.register_task_def(simple_task_def) + + retrieved_task = metadata_client.get_task_def(simple_task_def.name) + assert retrieved_task["name"] == simple_task_def.name + assert retrieved_task["description"] == simple_task_def.description + assert retrieved_task["timeoutSeconds"] == simple_task_def.timeout_seconds + + all_tasks = metadata_client.get_all_task_defs() + task_names = [task.name for task in all_tasks] + assert simple_task_def.name in task_names + + except Exception as e: + print(f"Exception in test_task_lifecycle: {str(e)}") + raise + finally: + try: + metadata_client.unregister_task_def(simple_task_def.name) + except Exception as e: + print( + f"Warning: Failed to cleanup task {simple_task_def.name}: {str(e)}" + ) + + @pytest.mark.v3_21_16 + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_task_update( + self, + metadata_client: OrkesMetadataClient, + test_suffix: str, + ): + task_name = f"test_task_update_{test_suffix}" + try: + initial_task = TaskDef( + name=task_name, + description="Initial task", + timeout_seconds=30, + total_timeout_seconds=60, + retry_count=3, + retry_logic="FIXED", + retry_delay_seconds=5, + timeout_policy="TIME_OUT_WF", + response_timeout_seconds=30, + concurrent_exec_limit=1, + owner_email="test@example.com", + ) + + metadata_client.register_task_def(initial_task) + + retrieved_task = metadata_client.get_task_def(task_name) + assert retrieved_task["description"] == "Initial task" + + updated_task = TaskDef( + name=task_name, + description="Updated task", + timeout_seconds=60, + total_timeout_seconds=120, + retry_count=5, + retry_logic="FIXED", + retry_delay_seconds=10, + timeout_policy="TIME_OUT_WF", + response_timeout_seconds=60, + concurrent_exec_limit=2, + owner_email="test@example.com", + ) + + metadata_client.update_task_def(updated_task) + + updated_retrieved_task = metadata_client.get_task_def(task_name) + assert updated_retrieved_task["description"] == "Updated task" + assert updated_retrieved_task["timeoutSeconds"] == 60 + assert updated_retrieved_task["retryCount"] == 5 + + except Exception as e: + print(f"Exception in test_task_update: {str(e)}") + raise + finally: + try: + metadata_client.unregister_task_def(task_name) + except Exception as e: + print(f"Warning: Failed to cleanup task {task_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_tags( + self, + metadata_client: OrkesMetadataClient, + test_suffix: str, + simple_workflow_task: WorkflowTask, + ): + workflow_name = f"test_workflow_tags_{test_suffix}" + try: + workflow = WorkflowDef( + name=workflow_name, + version=1, + description="Workflow with tags", + tasks=[simple_workflow_task], + timeout_seconds=60, + timeout_policy="TIME_OUT_WF", + ) + + metadata_client.register_workflow_def(workflow, overwrite=True) + + tags = [ + MetadataTag("environment", "test"), + MetadataTag("owner", "integration_test"), + MetadataTag("priority", "high"), + ] + + for tag in tags: + metadata_client.add_workflow_tag(tag, workflow_name) + + retrieved_tags = metadata_client.get_workflow_tags(workflow_name) + assert len(retrieved_tags) >= 3 + tag_keys = [tag["key"] for tag in retrieved_tags] + assert "environment" in tag_keys + assert "owner" in tag_keys + assert "priority" in tag_keys + + tag_to_delete = MetadataTag("priority", "high") + metadata_client.delete_workflow_tag(tag_to_delete, workflow_name) + + retrieved_tags_after_delete = metadata_client.get_workflow_tags( + workflow_name + ) + remaining_tag_keys = [tag["key"] for tag in retrieved_tags_after_delete] + assert "priority" not in remaining_tag_keys + + metadata_client.set_workflow_tags(tags, workflow_name) + + final_tags = metadata_client.get_workflow_tags(workflow_name) + final_tag_keys = [tag["key"] for tag in final_tags] + assert "environment" in final_tag_keys + assert "owner" in final_tag_keys + assert "priority" in final_tag_keys + + except Exception as e: + print(f"Exception in test_workflow_tags: {str(e)}") + raise + finally: + try: + metadata_client.unregister_workflow_def(workflow_name, 1) + except Exception as e: + print(f"Warning: Failed to cleanup workflow {workflow_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_task_tags( + self, + metadata_client: OrkesMetadataClient, + test_suffix: str, + ): + task_name = f"test_task_tags_{test_suffix}" + try: + task = TaskDef( + name=task_name, + description="Task with tags", + timeout_seconds=30, + total_timeout_seconds=60, + retry_count=3, + retry_logic="FIXED", + retry_delay_seconds=5, + timeout_policy="TIME_OUT_WF", + response_timeout_seconds=30, + concurrent_exec_limit=1, + ) + + metadata_client.register_task_def(task) + + tags = [ + MetadataTag("category", "data_processing"), + MetadataTag("team", "backend"), + MetadataTag("criticality", "medium"), + ] + + for tag in tags: + metadata_client.addTaskTag(tag, task_name) + + retrieved_tags = metadata_client.getTaskTags(task_name) + assert len(retrieved_tags) >= 3 + tag_keys = [tag["key"] for tag in retrieved_tags] + assert "category" in tag_keys + assert "team" in tag_keys + assert "criticality" in tag_keys + + tag_to_delete = MetadataTag("criticality", "medium") + metadata_client.deleteTaskTag(tag_to_delete, task_name) + + retrieved_tags_after_delete = metadata_client.getTaskTags(task_name) + remaining_tag_keys = [tag["key"] for tag in retrieved_tags_after_delete] + assert "criticality" not in remaining_tag_keys + + metadata_client.setTaskTags(tags, task_name) + + final_tags = metadata_client.getTaskTags(task_name) + final_tag_keys = [tag["key"] for tag in final_tags] + assert "category" in final_tag_keys + assert "team" in final_tag_keys + assert "criticality" in final_tag_keys + + except Exception as e: + print(f"Exception in test_task_tags: {str(e)}") + raise + finally: + try: + metadata_client.unregister_task_def(task_name) + except Exception as e: + print(f"Warning: Failed to cleanup task {task_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_metadata_not_found(self, metadata_client: OrkesMetadataClient): + non_existent_workflow = f"non_existent_{str(uuid.uuid4())}" + non_existent_task = f"non_existent_{str(uuid.uuid4())}" + + with pytest.raises(ApiException) as exc_info: + metadata_client.get_workflow_def(non_existent_workflow) + assert exc_info.value.code == 404 + + with pytest.raises(ApiException) as exc_info: + metadata_client.unregister_workflow_def(non_existent_workflow, 1) + assert exc_info.value.code == 404 + + with pytest.raises(ApiException) as exc_info: + metadata_client.get_task_def(non_existent_task) + assert exc_info.value.code == 404 + + with pytest.raises(ApiException) as exc_info: + metadata_client.unregister_task_def(non_existent_task) + assert exc_info.value.code == 404 + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_concurrent_metadata_operations( + self, + metadata_client: OrkesMetadataClient, + test_suffix: str, + simple_workflow_task: WorkflowTask, + ): + try: + import threading + import time + + results = [] + errors = [] + created_resources = {"workflows": [], "tasks": []} + cleanup_lock = threading.Lock() + + def create_and_delete_workflow(workflow_suffix: str): + workflow_name = None + try: + workflow_name = f"concurrent_workflow_{workflow_suffix}" + workflow = WorkflowDef( + name=workflow_name, + version=1, + description=f"Concurrent workflow {workflow_suffix}", + tasks=[simple_workflow_task], + timeout_seconds=60, + timeout_policy="TIME_OUT_WF", + ) + + metadata_client.register_workflow_def(workflow, overwrite=True) + + with cleanup_lock: + created_resources["workflows"].append((workflow_name, 1)) + + time.sleep(0.1) + + retrieved_workflow = metadata_client.get_workflow_def(workflow_name) + assert retrieved_workflow.name == workflow_name + + if os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true": + try: + metadata_client.unregister_workflow_def(workflow_name, 1) + with cleanup_lock: + if (workflow_name, 1) in created_resources["workflows"]: + created_resources["workflows"].remove( + (workflow_name, 1) + ) + except Exception as cleanup_error: + print( + f"Warning: Failed to cleanup workflow {workflow_name} in thread: {str(cleanup_error)}" + ) + + results.append(f"workflow_{workflow_suffix}_success") + except Exception as e: + errors.append(f"workflow_{workflow_suffix}_error: {str(e)}") + if ( + workflow_name + and (workflow_name, 1) not in created_resources["workflows"] + ): + with cleanup_lock: + created_resources["workflows"].append((workflow_name, 1)) + + def create_and_delete_task(task_suffix: str): + task_name = None + try: + task_name = f"concurrent_task_{task_suffix}" + task = TaskDef( + name=task_name, + description=f"Concurrent task {task_suffix}", + timeout_seconds=30, + total_timeout_seconds=60, + retry_count=3, + retry_logic="FIXED", + retry_delay_seconds=5, + timeout_policy="TIME_OUT_WF", + response_timeout_seconds=30, + concurrent_exec_limit=1, + ) + + metadata_client.register_task_def(task) + + with cleanup_lock: + created_resources["tasks"].append(task_name) + + time.sleep(0.1) + + retrieved_task = metadata_client.get_task_def(task_name) + assert retrieved_task["name"] == task_name + + if os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true": + try: + metadata_client.unregister_task_def(task_name) + with cleanup_lock: + if task_name in created_resources["tasks"]: + created_resources["tasks"].remove(task_name) + except Exception as cleanup_error: + print( + f"Warning: Failed to cleanup task {task_name} in thread: {str(cleanup_error)}" + ) + + results.append(f"task_{task_suffix}_success") + except Exception as e: + errors.append(f"task_{task_suffix}_error: {str(e)}") + if task_name and task_name not in created_resources["tasks"]: + with cleanup_lock: + created_resources["tasks"].append(task_name) + + threads = [] + for i in range(3): + workflow_thread = threading.Thread( + target=create_and_delete_workflow, args=(f"{test_suffix}_{i}",) + ) + task_thread = threading.Thread( + target=create_and_delete_task, args=(f"{test_suffix}_{i}",) + ) + threads.extend([workflow_thread, task_thread]) + workflow_thread.start() + task_thread.start() + + for thread in threads: + thread.join() + + assert ( + len(results) == 6 + ), f"Expected 6 successful operations, got {len(results)}. Errors: {errors}" + assert len(errors) == 0, f"Unexpected errors: {errors}" + + except Exception as e: + print(f"Exception in test_concurrent_metadata_operations: {str(e)}") + raise + finally: + for workflow_name, version in created_resources["workflows"]: + try: + metadata_client.unregister_workflow_def(workflow_name, version) + except Exception as e: + print( + f"Warning: Failed to delete workflow {workflow_name}: {str(e)}" + ) + + for task_name in created_resources["tasks"]: + try: + metadata_client.unregister_task_def(task_name) + except Exception as e: + print(f"Warning: Failed to delete task {task_name}: {str(e)}") + + remaining_workflows = [] + for workflow_name, version in created_resources["workflows"]: + try: + metadata_client.get_workflow_def(workflow_name, version=version) + remaining_workflows.append((workflow_name, version)) + except ApiException as e: + if e.code == 404: + pass + else: + remaining_workflows.append((workflow_name, version)) + except Exception: + remaining_workflows.append((workflow_name, version)) + + remaining_tasks = [] + for task_name in created_resources["tasks"]: + try: + metadata_client.get_task_def(task_name) + remaining_tasks.append(task_name) + except ApiException as e: + if e.code == 404: + pass + else: + remaining_tasks.append(task_name) + except Exception: + remaining_tasks.append(task_name) + + if remaining_workflows or remaining_tasks: + print( + f"Warning: {len(remaining_workflows)} workflows and {len(remaining_tasks)} tasks could not be verified as deleted: {remaining_workflows}, {remaining_tasks}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_complex_metadata_management_flow( + self, metadata_client: OrkesMetadataClient, test_suffix: str + ): + created_resources = {"workflows": [], "tasks": []} + + try: + workflow_types = { + "data_processing": "Data processing workflow", + "notification": "Notification workflow", + "reporting": "Reporting workflow", + "integration": "Integration workflow", + } + + for workflow_type, description in workflow_types.items(): + workflow_name = f"complex_{workflow_type}_{test_suffix}" + task = WorkflowTask( + name=f"{workflow_type}_task", + task_reference_name=f"{workflow_type}_task_ref", + type="SIMPLE", + input_parameters={}, + ) + + workflow = WorkflowDef( + name=workflow_name, + version=1, + description=description, + tasks=[task], + timeout_seconds=60, + timeout_policy="TIME_OUT_WF", + restartable=True, + owner_email="test@example.com", + ) + + metadata_client.register_workflow_def(workflow, overwrite=True) + created_resources["workflows"].append((workflow_name, 1)) + + tags = [ + MetadataTag("type", workflow_type), + MetadataTag("environment", "test"), + MetadataTag("owner", "integration_test"), + ] + + for tag in tags: + metadata_client.add_workflow_tag(tag, workflow_name) + + task_types = { + "http_task": "HTTP request task", + "email_task": "Email sending task", + "database_task": "Database operation task", + "file_task": "File processing task", + } + + for task_type, description in task_types.items(): + task_name = f"complex_{task_type}_{test_suffix}" + task = TaskDef( + name=task_name, + description=description, + timeout_seconds=30, + total_timeout_seconds=60, + retry_count=3, + retry_logic="FIXED", + retry_delay_seconds=5, + timeout_policy="TIME_OUT_WF", + response_timeout_seconds=30, + concurrent_exec_limit=1, + ) + + metadata_client.register_task_def(task) + created_resources["tasks"].append(task_name) + + tags = [ + MetadataTag("category", task_type), + MetadataTag("team", "backend"), + MetadataTag("criticality", "medium"), + ] + + for tag in tags: + metadata_client.addTaskTag(tag, task_name) + + all_workflows = metadata_client.get_all_workflow_defs() + workflow_names = [wf.name for wf in all_workflows] + for workflow_name, version in created_resources["workflows"]: + assert ( + workflow_name in workflow_names + ), f"Workflow {workflow_name} not found in list" + + all_tasks = metadata_client.get_all_task_defs() + task_names = [task.name for task in all_tasks] + for task_name in created_resources["tasks"]: + assert task_name in task_names, f"Task {task_name} not found in list" + + for workflow_type in workflow_types.keys(): + workflow_name = f"complex_{workflow_type}_{test_suffix}" + retrieved_workflow = metadata_client.get_workflow_def(workflow_name) + assert retrieved_workflow.name == workflow_name + + retrieved_tags = metadata_client.get_workflow_tags(workflow_name) + tag_keys = [tag["key"] for tag in retrieved_tags] + assert "type" in tag_keys + assert "environment" in tag_keys + assert "owner" in tag_keys + + for task_type in task_types.keys(): + task_name = f"complex_{task_type}_{test_suffix}" + retrieved_task = metadata_client.get_task_def(task_name) + assert retrieved_task["name"] == task_name + + retrieved_tags = metadata_client.getTaskTags(task_name) + tag_keys = [tag["key"] for tag in retrieved_tags] + assert "category" in tag_keys + assert "team" in tag_keys + assert "criticality" in tag_keys + + except Exception as e: + print(f"Exception in test_complex_metadata_management_flow: {str(e)}") + raise + finally: + self._perform_comprehensive_cleanup(metadata_client, created_resources) + + def _perform_comprehensive_cleanup( + self, metadata_client: OrkesMetadataClient, created_resources: dict + ): + cleanup_enabled = os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + if not cleanup_enabled: + return + + for workflow_name, version in created_resources["workflows"]: + try: + metadata_client.unregister_workflow_def(workflow_name, version) + except Exception as e: + print(f"Warning: Failed to delete workflow {workflow_name}: {str(e)}") + + for task_name in created_resources["tasks"]: + try: + metadata_client.unregister_task_def(task_name) + except Exception as e: + print(f"Warning: Failed to delete task {task_name}: {str(e)}") + + remaining_workflows = [] + for workflow_name, version in created_resources["workflows"]: + try: + metadata_client.get_workflow_def(workflow_name, version=version) + remaining_workflows.append((workflow_name, version)) + except ApiException as e: + if e.code == 404: + pass + else: + remaining_workflows.append((workflow_name, version)) + except Exception: + remaining_workflows.append((workflow_name, version)) + + remaining_tasks = [] + for task_name in created_resources["tasks"]: + try: + metadata_client.get_task_def(task_name) + remaining_tasks.append(task_name) + except ApiException as e: + if e.code == 404: + pass + else: + remaining_tasks.append(task_name) + except Exception: + remaining_tasks.append(task_name) + + if remaining_workflows or remaining_tasks: + print( + f"Warning: {len(remaining_workflows)} workflows and {len(remaining_tasks)} tasks could not be verified as deleted: {remaining_workflows}, {remaining_tasks}" + ) diff --git a/tests/integration/test_orkes_prompt_client_integration.py b/tests/integration/test_orkes_prompt_client_integration.py new file mode 100644 index 00000000..11d7d201 --- /dev/null +++ b/tests/integration/test_orkes_prompt_client_integration.py @@ -0,0 +1,346 @@ +import os +import uuid + +import pytest + +from conductor.client.configuration.configuration import Configuration +from conductor.client.codegen.rest import ApiException +from conductor.client.orkes.models.metadata_tag import MetadataTag +from conductor.client.orkes.orkes_prompt_client import OrkesPromptClient + + +class TestOrkesPromptClientIntegration: + """ + Integration tests for OrkesPromptClient. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def prompt_client(self, configuration: Configuration) -> OrkesPromptClient: + return OrkesPromptClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def test_prompt_name(self, test_suffix: str) -> str: + return f"test_prompt_{test_suffix}" + + @pytest.fixture(scope="class") + def simple_prompt_template(self) -> str: + return "Hello ${name}, welcome to ${company}!" + + @pytest.fixture(scope="class") + def complex_prompt_template(self) -> str: + return """ + You are a helpful assistant for ${company}. + + Customer Information: + - Name: ${customer_name} + - Email: ${customer_email} + - Issue: ${issue_description} + + Please provide a ${response_type} response to the customer's inquiry. + + Guidelines: + - Be ${tone} in your response + - Include relevant ${company} policies + - Keep the response under ${max_length} words + + Response: + """ + + @pytest.fixture(scope="class") + def simple_variables(self) -> dict: + return {"name": "John", "company": "Acme Corp"} + + @pytest.fixture(scope="class") + def complex_variables(self) -> dict: + return { + "company": "TechCorp", + "customer_name": "Alice Johnson", + "customer_email": "alice@example.com", + "issue_description": "Unable to access the dashboard", + "response_type": "detailed", + "tone": "professional", + "max_length": "200", + } + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_prompt_lifecycle_simple( + self, + prompt_client: OrkesPromptClient, + test_prompt_name: str, + simple_prompt_template: str, + simple_variables: dict, + ): + try: + description = "A simple greeting prompt template" + prompt_client.save_prompt( + test_prompt_name, description, simple_prompt_template + ) + + retrieved_prompt = prompt_client.get_prompt(test_prompt_name) + assert retrieved_prompt.name == test_prompt_name + assert retrieved_prompt.description == description + assert retrieved_prompt.template == simple_prompt_template + assert "name" in retrieved_prompt.variables + assert "company" in retrieved_prompt.variables + + prompts = prompt_client.get_prompts() + prompt_names = [p.name for p in prompts] + assert test_prompt_name in prompt_names + + except Exception as e: + print(f"Exception in test_prompt_lifecycle_simple: {str(e)}") + raise + finally: + try: + prompt_client.delete_prompt(test_prompt_name) + except Exception as e: + print(f"Warning: Failed to cleanup prompt {test_prompt_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_prompt_lifecycle_complex( + self, + prompt_client: OrkesPromptClient, + test_suffix: str, + complex_prompt_template: str, + complex_variables: dict, + ): + prompt_name = f"test_complex_prompt_{test_suffix}" + try: + description = "A complex customer service prompt template" + prompt_client.save_prompt(prompt_name, description, complex_prompt_template) + + retrieved_prompt = prompt_client.get_prompt(prompt_name) + assert retrieved_prompt.name == prompt_name + assert retrieved_prompt.description == description + assert "company" in retrieved_prompt.variables + assert "customer_name" in retrieved_prompt.variables + assert "issue_description" in retrieved_prompt.variables + + except Exception as e: + print(f"Exception in test_prompt_lifecycle_complex: {str(e)}") + raise + finally: + try: + prompt_client.delete_prompt(prompt_name) + except Exception as e: + print(f"Warning: Failed to cleanup prompt {prompt_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_prompt_with_tags( + self, + prompt_client: OrkesPromptClient, + test_suffix: str, + simple_prompt_template: str, + ): + prompt_name = f"test_tagged_prompt_{test_suffix}" + try: + description = "A prompt template with tags" + prompt_client.save_prompt(prompt_name, description, simple_prompt_template) + + tags = [ + MetadataTag("category", "greeting"), + MetadataTag("language", "english"), + MetadataTag("priority", "high"), + ] + prompt_client.update_tag_for_prompt_template(prompt_name, tags) + + retrieved_tags = prompt_client.get_tags_for_prompt_template(prompt_name) + assert len(retrieved_tags) == 3 + tag_keys = [tag.key for tag in retrieved_tags] + assert "category" in tag_keys + assert "language" in tag_keys + assert "priority" in tag_keys + + tags_to_delete = [MetadataTag("priority", "high")] + prompt_client.delete_tag_for_prompt_template(prompt_name, tags_to_delete) + + retrieved_tags_after_delete = prompt_client.get_tags_for_prompt_template( + prompt_name + ) + remaining_tag_keys = [tag.key for tag in retrieved_tags_after_delete] + assert "priority" not in remaining_tag_keys + assert len(retrieved_tags_after_delete) == 2 + + except Exception as e: + print(f"Exception in test_prompt_with_tags: {str(e)}") + raise + finally: + try: + prompt_client.delete_prompt(prompt_name) + except Exception as e: + print(f"Warning: Failed to cleanup prompt {prompt_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_prompt_update( + self, + prompt_client: OrkesPromptClient, + test_suffix: str, + simple_prompt_template: str, + ): + prompt_name = f"test_prompt_update_{test_suffix}" + try: + initial_description = "Initial description" + initial_template = simple_prompt_template + prompt_client.save_prompt( + prompt_name, initial_description, initial_template + ) + + retrieved_prompt = prompt_client.get_prompt(prompt_name) + assert retrieved_prompt.description == initial_description + assert retrieved_prompt.template == initial_template + + updated_description = "Updated description" + updated_template = ( + "Hello ${name}, welcome to ${company}! We're glad to have you here." + ) + prompt_client.save_prompt( + prompt_name, updated_description, updated_template + ) + + updated_prompt = prompt_client.get_prompt(prompt_name) + assert updated_prompt.description == updated_description + assert updated_prompt.template == updated_template + assert "name" in updated_prompt.variables + assert "company" in updated_prompt.variables + + except Exception as e: + print(f"Exception in test_prompt_update: {str(e)}") + raise + finally: + try: + prompt_client.delete_prompt(prompt_name) + except Exception as e: + print(f"Warning: Failed to cleanup prompt {prompt_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_concurrent_prompt_operations( + self, + prompt_client: OrkesPromptClient, + test_suffix: str, + simple_prompt_template: str, + ): + try: + import threading + import time + + results = [] + errors = [] + created_prompts = [] + cleanup_lock = threading.Lock() + + def create_and_delete_prompt(prompt_suffix: str): + prompt_name = None + try: + prompt_name = f"concurrent_prompt_{prompt_suffix}" + description = f"Concurrent prompt {prompt_suffix}" + prompt_client.save_prompt( + prompt_name, description, simple_prompt_template + ) + + with cleanup_lock: + created_prompts.append(prompt_name) + + time.sleep(0.1) + + retrieved_prompt = prompt_client.get_prompt(prompt_name) + assert retrieved_prompt.name == prompt_name + + if os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true": + try: + prompt_client.delete_prompt(prompt_name) + with cleanup_lock: + if prompt_name in created_prompts: + created_prompts.remove(prompt_name) + except Exception as cleanup_error: + print( + f"Warning: Failed to cleanup prompt {prompt_name} in thread: {str(cleanup_error)}" + ) + + results.append(f"prompt_{prompt_suffix}_success") + except Exception as e: + errors.append(f"prompt_{prompt_suffix}_error: {str(e)}") + if prompt_name and prompt_name not in created_prompts: + with cleanup_lock: + created_prompts.append(prompt_name) + + threads = [] + for i in range(3): + thread = threading.Thread( + target=create_and_delete_prompt, args=(f"{test_suffix}_{i}",) + ) + threads.append(thread) + thread.start() + + for thread in threads: + thread.join() + + assert ( + len(results) == 3 + ), f"Expected 3 successful operations, got {len(results)}. Errors: {errors}" + assert len(errors) == 0, f"Unexpected errors: {errors}" + + except Exception as e: + print(f"Exception in test_concurrent_prompt_operations: {str(e)}") + raise + finally: + for prompt_name in created_prompts: + try: + prompt_client.delete_prompt(prompt_name) + except Exception as e: + print(f"Warning: Failed to delete prompt {prompt_name}: {str(e)}") + + def _perform_comprehensive_cleanup( + self, prompt_client: OrkesPromptClient, created_resources: dict + ): + cleanup_enabled = os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + if not cleanup_enabled: + return + + for prompt_name in created_resources["prompts"]: + try: + prompt_client.delete_prompt(prompt_name) + except Exception as e: + print(f"Warning: Failed to delete prompt {prompt_name}: {str(e)}") + + remaining_prompts = [] + for prompt_name in created_resources["prompts"]: + try: + retrieved_prompt = prompt_client.get_prompt(prompt_name) + if retrieved_prompt is not None: + remaining_prompts.append(prompt_name) + except ApiException as e: + if e.code == 404: + pass + else: + remaining_prompts.append(prompt_name) + except Exception: + remaining_prompts.append(prompt_name) + + if remaining_prompts: + print( + f"Warning: {len(remaining_prompts)} prompts could not be verified as deleted: {remaining_prompts}" + ) diff --git a/tests/integration/test_orkes_scheduler_client_integration.py b/tests/integration/test_orkes_scheduler_client_integration.py new file mode 100644 index 00000000..89e05f22 --- /dev/null +++ b/tests/integration/test_orkes_scheduler_client_integration.py @@ -0,0 +1,535 @@ +import os +import time +import uuid + +import pytest + +from conductor.client.http.models.save_schedule_request import \ + SaveScheduleRequestAdapter as SaveScheduleRequest +from conductor.client.http.models.start_workflow_request import \ + StartWorkflowRequestAdapter as StartWorkflowRequest +from conductor.client.configuration.configuration import Configuration +from conductor.client.codegen.rest import ApiException +from conductor.client.orkes.models.metadata_tag import MetadataTag +from conductor.client.orkes.orkes_scheduler_client import OrkesSchedulerClient + + +class TestOrkesSchedulerClientIntegration: + """ + Integration tests for OrkesSchedulerClient. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def scheduler_client(self, configuration: Configuration) -> OrkesSchedulerClient: + return OrkesSchedulerClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def test_schedule_name(self, test_suffix: str) -> str: + return f"test_schedule_{test_suffix}" + + @pytest.fixture(scope="class") + def simple_start_workflow_request(self) -> StartWorkflowRequest: + return StartWorkflowRequest( + name="test_workflow", + version=1, + input={"param1": "value1", "param2": "value2"}, + correlation_id="test_correlation_id", + priority=0, + ) + + @pytest.fixture(scope="class") + def simple_save_schedule_request( + self, test_suffix: str, simple_start_workflow_request: StartWorkflowRequest + ) -> SaveScheduleRequest: + return SaveScheduleRequest( + name=f"test_schedule_{test_suffix}", + cron_expression="0 */5 * * * ?", + description="A simple test schedule", + start_workflow_request=simple_start_workflow_request, + paused=False, + run_catchup_schedule_instances=True, + schedule_start_time=int(time.time() * 1000), + schedule_end_time=int((time.time() + 86400) * 1000), + zone_id="UTC", + ) + + @pytest.fixture(scope="class") + def complex_save_schedule_request( + self, test_suffix: str, simple_start_workflow_request: StartWorkflowRequest + ) -> SaveScheduleRequest: + return SaveScheduleRequest( + name=f"test_complex_schedule_{test_suffix}", + cron_expression="0 0 12 * * ?", + description="A complex test schedule that runs daily at noon", + start_workflow_request=simple_start_workflow_request, + paused=True, + run_catchup_schedule_instances=False, + schedule_start_time=int(time.time() * 1000), + schedule_end_time=int((time.time() + 604800) * 1000), + zone_id="America/New_York", + created_by="integration_test", + updated_by="integration_test", + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schedule_lifecycle_simple( + self, + scheduler_client: OrkesSchedulerClient, + simple_save_schedule_request: SaveScheduleRequest, + ): + try: + scheduler_client.save_schedule(simple_save_schedule_request) + + retrieved_schedule = scheduler_client.get_schedule( + simple_save_schedule_request.name + ) + assert retrieved_schedule.name == simple_save_schedule_request.name + assert ( + retrieved_schedule.cron_expression + == simple_save_schedule_request.cron_expression + ) + assert ( + retrieved_schedule.description + == simple_save_schedule_request.description + ) + + all_schedules = scheduler_client.get_all_schedules() + schedule_names = [schedule.name for schedule in all_schedules] + assert simple_save_schedule_request.name in schedule_names + + except Exception as e: + print(f"Exception in test_schedule_lifecycle_simple: {str(e)}") + raise + finally: + try: + scheduler_client.delete_schedule(simple_save_schedule_request.name) + except Exception as e: + print( + f"Warning: Failed to cleanup schedule {simple_save_schedule_request.name}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schedule_lifecycle_complex( + self, + scheduler_client: OrkesSchedulerClient, + complex_save_schedule_request: SaveScheduleRequest, + ): + try: + scheduler_client.save_schedule(complex_save_schedule_request) + + retrieved_schedule = scheduler_client.get_schedule( + complex_save_schedule_request.name + ) + assert retrieved_schedule.name == complex_save_schedule_request.name + assert ( + retrieved_schedule.cron_expression + == complex_save_schedule_request.cron_expression + ) + assert retrieved_schedule.zone_id == complex_save_schedule_request.zone_id + + except Exception as e: + print(f"Exception in test_schedule_lifecycle_complex: {str(e)}") + raise + finally: + try: + scheduler_client.delete_schedule(complex_save_schedule_request.name) + except Exception as e: + print( + f"Warning: Failed to cleanup schedule {complex_save_schedule_request.name}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schedule_pause_resume( + self, + scheduler_client: OrkesSchedulerClient, + test_suffix: str, + simple_start_workflow_request: StartWorkflowRequest, + ): + schedule_name = f"test_pause_resume_{test_suffix}" + try: + schedule_request = SaveScheduleRequest( + name=schedule_name, + cron_expression="0 */10 * * * ?", + description="Schedule for pause/resume testing", + start_workflow_request=simple_start_workflow_request, + paused=False, + ) + + scheduler_client.save_schedule(schedule_request) + + retrieved_schedule = scheduler_client.get_schedule(schedule_name) + assert not retrieved_schedule.paused + + scheduler_client.pause_schedule(schedule_name) + + paused_schedule = scheduler_client.get_schedule(schedule_name) + assert paused_schedule.paused + + scheduler_client.resume_schedule(schedule_name) + + resumed_schedule = scheduler_client.get_schedule(schedule_name) + assert not resumed_schedule.paused + + except Exception as e: + print(f"Exception in test_schedule_pause_resume: {str(e)}") + raise + finally: + try: + scheduler_client.delete_schedule(schedule_name) + except Exception as e: + print(f"Warning: Failed to cleanup schedule {schedule_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schedule_execution_times( + self, + scheduler_client: OrkesSchedulerClient, + ): + try: + cron_expression = "0 0 12 * * ?" + schedule_start_time = int(time.time() * 1000) + schedule_end_time = int((time.time() + 86400 * 7) * 1000) + limit = 5 + + execution_times = scheduler_client.get_next_few_schedule_execution_times( + cron_expression=cron_expression, + schedule_start_time=schedule_start_time, + schedule_end_time=schedule_end_time, + limit=limit, + ) + + assert isinstance(execution_times, list) + assert len(execution_times) <= limit + assert all(isinstance(time_ms, int) for time_ms in execution_times) + + execution_times_without_params = ( + scheduler_client.get_next_few_schedule_execution_times( + cron_expression=cron_expression, + ) + ) + + assert isinstance(execution_times_without_params, list) + assert all( + isinstance(time_ms, int) for time_ms in execution_times_without_params + ) + + except Exception as e: + print(f"Exception in test_schedule_execution_times: {str(e)}") + raise + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schedule_search( + self, + scheduler_client: OrkesSchedulerClient, + test_suffix: str, + simple_start_workflow_request: StartWorkflowRequest, + ): + schedule_name = f"test_search_schedule_{test_suffix}" + try: + schedule_request = SaveScheduleRequest( + name=schedule_name, + cron_expression="0 0 8 * * ?", + description="Schedule for search testing", + start_workflow_request=simple_start_workflow_request, + paused=False, + ) + + scheduler_client.save_schedule(schedule_request) + + search_results = scheduler_client.search_schedule_executions( + start=0, size=10, sort="startTime", query=1 + ) + + assert search_results is not None + assert hasattr(search_results, "total_hits") + assert hasattr(search_results, "results") + + search_results_with_query = scheduler_client.search_schedule_executions( + start=0, + size=5, + query=f"name:{schedule_name}", + ) + + assert search_results_with_query is not None + + except Exception as e: + print(f"Exception in test_schedule_search: {str(e)}") + raise + finally: + try: + scheduler_client.delete_schedule(schedule_name) + except Exception as e: + print(f"Warning: Failed to cleanup schedule {schedule_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schedule_tags( + self, + scheduler_client: OrkesSchedulerClient, + test_suffix: str, + simple_start_workflow_request: StartWorkflowRequest, + ): + schedule_name = f"test_tagged_schedule_{test_suffix}" + try: + schedule_request = SaveScheduleRequest( + name=schedule_name, + cron_expression="0 0 6 * * ?", + description="Schedule with tags", + start_workflow_request=simple_start_workflow_request, + paused=False, + ) + + scheduler_client.save_schedule(schedule_request) + + tags = [ + MetadataTag("environment", "test"), + MetadataTag("team", "backend"), + MetadataTag("priority", "high"), + ] + + scheduler_client.set_scheduler_tags(tags, schedule_name) + + retrieved_tags = scheduler_client.get_scheduler_tags(schedule_name) + assert len(retrieved_tags) >= 3 + tag_keys = [tag.key for tag in retrieved_tags] + assert "environment" in tag_keys + assert "team" in tag_keys + assert "priority" in tag_keys + + tags_to_delete = [MetadataTag("priority", "high")] + scheduler_client.delete_scheduler_tags(tags_to_delete, schedule_name) + + retrieved_tags_after_delete = scheduler_client.get_scheduler_tags( + schedule_name + ) + remaining_tag_keys = [tag.key for tag in retrieved_tags_after_delete] + assert "priority" not in remaining_tag_keys + + except Exception as e: + print(f"Exception in test_schedule_tags: {str(e)}") + raise + finally: + try: + scheduler_client.delete_schedule(schedule_name) + except Exception as e: + print(f"Warning: Failed to cleanup schedule {schedule_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schedule_update( + self, + scheduler_client: OrkesSchedulerClient, + test_suffix: str, + simple_start_workflow_request: StartWorkflowRequest, + ): + schedule_name = f"test_update_schedule_{test_suffix}" + try: + initial_schedule = SaveScheduleRequest( + name=schedule_name, + cron_expression="0 0 9 * * ?", + description="Initial schedule", + start_workflow_request=simple_start_workflow_request, + paused=False, + ) + + scheduler_client.save_schedule(initial_schedule) + + retrieved_schedule = scheduler_client.get_schedule(schedule_name) + assert retrieved_schedule.description == "Initial schedule" + + updated_schedule = SaveScheduleRequest( + name=schedule_name, + cron_expression="0 0 10 * * ?", + description="Updated schedule", + start_workflow_request=simple_start_workflow_request, + paused=True, + ) + + scheduler_client.save_schedule(updated_schedule) + + updated_retrieved_schedule = scheduler_client.get_schedule(schedule_name) + assert updated_retrieved_schedule.description == "Updated schedule" + assert updated_retrieved_schedule.paused + + except Exception as e: + print(f"Exception in test_schedule_update: {str(e)}") + raise + finally: + try: + scheduler_client.delete_schedule(schedule_name) + except Exception as e: + print(f"Warning: Failed to cleanup schedule {schedule_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_complex_schedule_management_flow( + self, scheduler_client: OrkesSchedulerClient, test_suffix: str + ): + created_resources = {"schedules": []} + + try: + schedule_types = { + "daily": "0 0 8 * * ?", + "hourly": "0 0 * * * ?", + "weekly": "0 0 9 ? * MON", + "monthly": "0 0 10 1 * ?", + } + + for schedule_type, cron_expression in schedule_types.items(): + schedule_name = f"complex_{schedule_type}_{test_suffix}" + start_workflow_request = StartWorkflowRequest( + name="test_workflow", + version=1, + input={ + "schedule_type": schedule_type, + "timestamp": int(time.time()), + }, + correlation_id=f"correlation_{schedule_type}", + priority=0, + ) + + schedule_request = SaveScheduleRequest( + name=schedule_name, + cron_expression=cron_expression, + description=f"Complex {schedule_type} schedule", + start_workflow_request=start_workflow_request, + paused=False, + run_catchup_schedule_instances=True, + schedule_start_time=int(time.time() * 1000), + schedule_end_time=int((time.time() + 2592000) * 1000), + zone_id="UTC", + ) + + scheduler_client.save_schedule(schedule_request) + created_resources["schedules"].append(schedule_name) + + tags = [ + MetadataTag("type", schedule_type), + MetadataTag("environment", "test"), + MetadataTag("owner", "integration_test"), + ] + + scheduler_client.set_scheduler_tags(tags, schedule_name) + + all_schedules = scheduler_client.get_all_schedules() + schedule_names = [schedule.name for schedule in all_schedules] + for schedule_name in created_resources["schedules"]: + assert ( + schedule_name in schedule_names + ), f"Schedule {schedule_name} not found in list" + + for schedule_type in schedule_types.keys(): + schedule_name = f"complex_{schedule_type}_{test_suffix}" + retrieved_schedule = scheduler_client.get_schedule(schedule_name) + assert retrieved_schedule.name == schedule_name + + retrieved_tags = scheduler_client.get_scheduler_tags(schedule_name) + tag_keys = [tag.key for tag in retrieved_tags] + assert "type" in tag_keys + assert "environment" in tag_keys + assert "owner" in tag_keys + + bulk_schedules = [] + for i in range(3): + schedule_name = f"bulk_schedule_{i}_{test_suffix}" + start_workflow_request = StartWorkflowRequest( + name="test_workflow", + version=1, + input={"bulk_index": i}, + correlation_id=f"bulk_correlation_{i}", + priority=0, + ) + + schedule_request = SaveScheduleRequest( + name=schedule_name, + cron_expression=f"0 */{15 + i} * * * ?", + description=f"Bulk schedule {i}", + start_workflow_request=start_workflow_request, + paused=False, + ) + + scheduler_client.save_schedule(schedule_request) + bulk_schedules.append(schedule_name) + created_resources["schedules"].append(schedule_name) + + all_schedules_after_bulk = scheduler_client.get_all_schedules() + schedule_names_after_bulk = [ + schedule.name for schedule in all_schedules_after_bulk + ] + for schedule_name in bulk_schedules: + assert ( + schedule_name in schedule_names_after_bulk + ), f"Bulk schedule {schedule_name} not found in list" + + scheduler_client.requeue_all_execution_records() + + for schedule_type in ["daily", "hourly"]: + schedule_name = f"complex_{schedule_type}_{test_suffix}" + execution_times = ( + scheduler_client.get_next_few_schedule_execution_times( + cron_expression=schedule_types[schedule_type], + limit=3, + ) + ) + assert isinstance(execution_times, list) + assert len(execution_times) <= 3 + + except Exception as e: + print(f"Exception in test_complex_schedule_management_flow: {str(e)}") + raise + finally: + self._perform_comprehensive_cleanup(scheduler_client, created_resources) + + def _perform_comprehensive_cleanup( + self, scheduler_client: OrkesSchedulerClient, created_resources: dict + ): + cleanup_enabled = os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + if not cleanup_enabled: + return + + for schedule_name in created_resources["schedules"]: + try: + scheduler_client.delete_schedule(schedule_name) + except Exception as e: + print(f"Warning: Failed to delete schedule {schedule_name}: {str(e)}") + + remaining_schedules = [] + for schedule_name in created_resources["schedules"]: + try: + scheduler_client.get_schedule(schedule_name) + remaining_schedules.append(schedule_name) + except ApiException as e: + if e.code == 404: + pass + else: + remaining_schedules.append(schedule_name) + except Exception: + remaining_schedules.append(schedule_name) + + if remaining_schedules: + print( + f"Warning: {len(remaining_schedules)} schedules could not be verified as deleted: {remaining_schedules}" + ) diff --git a/tests/integration/test_orkes_schema_client_integration.py b/tests/integration/test_orkes_schema_client_integration.py new file mode 100644 index 00000000..1785da18 --- /dev/null +++ b/tests/integration/test_orkes_schema_client_integration.py @@ -0,0 +1,476 @@ +import os +import uuid +from copy import deepcopy + +import pytest + +from conductor.client.http.models.schema_def import \ + SchemaDefAdapter as SchemaDef +from conductor.client.http.models.schema_def import SchemaType +from conductor.client.configuration.configuration import Configuration +from conductor.client.codegen.rest import ApiException +from conductor.client.orkes.orkes_schema_client import OrkesSchemaClient + + +class TestOrkesSchemaClientIntegration: + """ + Integration tests for OrkesSchemaClient. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def schema_client(self, configuration: Configuration) -> OrkesSchemaClient: + return OrkesSchemaClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def test_schema_name(self, test_suffix: str) -> str: + return f"test_schema_{test_suffix}" + + @pytest.fixture(scope="class") + def json_schema_data(self) -> dict: + return { + "type": "object", + "properties": { + "id": {"type": "integer"}, + "name": {"type": "string"}, + "email": {"type": "string", "format": "email"}, + "active": {"type": "boolean"}, + "tags": {"type": "array", "items": {"type": "string"}}, + }, + "required": ["id", "name", "email"], + "$schema": "http://json-schema.org/draft-07/schema", + } + + @pytest.fixture(scope="class") + def avro_schema_data(self) -> dict: + return { + "type": "record", + "name": "User", + "namespace": "com.example", + "fields": [ + {"name": "id", "type": "int"}, + {"name": "name", "type": "string"}, + {"name": "email", "type": "string"}, + {"name": "active", "type": "boolean", "default": True}, + ], + } + + @pytest.fixture(scope="class") + def protobuf_schema_data(self) -> dict: + return { + "syntax": "proto3", + "package": "com.example", + "message": { + "name": "User", + "fields": [ + {"name": "id", "type": "int32", "number": 1}, + {"name": "name", "type": "string", "number": 2}, + {"name": "email", "type": "string", "number": 3}, + {"name": "active", "type": "bool", "number": 4}, + ], + }, + } + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schema_lifecycle_json( + self, + schema_client: OrkesSchemaClient, + test_schema_name: str, + json_schema_data: dict, + ): + try: + schema = SchemaDef( + name=test_schema_name, + version=1, + type=SchemaType.JSON, + data=json_schema_data, + external_ref="http://example.com/json-schema", + ) + + schema_client.register_schema(schema) + + retrieved_schema = schema_client.get_schema(test_schema_name, 1) + assert retrieved_schema.name == test_schema_name + assert retrieved_schema.version == 1 + assert retrieved_schema.type == SchemaType.JSON + assert retrieved_schema.data == json_schema_data + assert ( + retrieved_schema.data["$schema"] + == "http://json-schema.org/draft-07/schema" + ) + + schemas = schema_client.get_all_schemas() + schema_names = [s.name for s in schemas] + assert test_schema_name in schema_names + + except Exception as e: + print(f"Exception in test_schema_lifecycle_json: {str(e)}") + raise + finally: + try: + schema_client.delete_schema(test_schema_name, 1) + except Exception as e: + print(f"Warning: Failed to cleanup schema {test_schema_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schema_lifecycle_avro( + self, schema_client: OrkesSchemaClient, test_suffix: str, avro_schema_data: dict + ): + schema_name = f"test_avro_schema_{test_suffix}" + try: + schema = SchemaDef( + name=schema_name, + version=1, + type=SchemaType.AVRO, + data=avro_schema_data, + external_ref="http://example.com/avro-schema", + ) + + schema_client.register_schema(schema) + + retrieved_schema = schema_client.get_schema(schema_name, 1) + assert retrieved_schema.name == schema_name + assert retrieved_schema.version == 1 + assert retrieved_schema.type == SchemaType.AVRO + assert retrieved_schema.data == avro_schema_data + + except Exception as e: + print(f"Exception in test_schema_lifecycle_avro: {str(e)}") + raise + finally: + try: + schema_client.delete_schema(schema_name, 1) + except Exception as e: + print(f"Warning: Failed to cleanup schema {schema_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schema_lifecycle_protobuf( + self, + schema_client: OrkesSchemaClient, + test_suffix: str, + protobuf_schema_data: dict, + ): + schema_name = f"test_protobuf_schema_{test_suffix}" + try: + schema = SchemaDef( + name=schema_name, + version=1, + type=SchemaType.PROTOBUF, + data=protobuf_schema_data, + external_ref="http://example.com/protobuf-schema", + ) + + schema_client.register_schema(schema) + + retrieved_schema = schema_client.get_schema(schema_name, 1) + assert retrieved_schema.name == schema_name + assert retrieved_schema.version == 1 + assert retrieved_schema.type == SchemaType.PROTOBUF + assert retrieved_schema.data == protobuf_schema_data + + except Exception as e: + print(f"Exception in test_schema_lifecycle_protobuf: {str(e)}") + raise + finally: + try: + schema_client.delete_schema(schema_name, 1) + except Exception as e: + print(f"Warning: Failed to cleanup schema {schema_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_schema_versioning( + self, schema_client: OrkesSchemaClient, test_suffix: str, json_schema_data: dict + ): + schema_name = f"test_versioned_schema_{test_suffix}" + try: + schema_v1 = SchemaDef( + name=schema_name, + version=1, + type=SchemaType.JSON, + data=json_schema_data, + external_ref="http://example.com/v1", + ) + schema_v2_data = deepcopy(json_schema_data) + schema_v2_data["properties"]["age"] = {"type": "integer"} + schema_v2 = SchemaDef( + name=schema_name, + version=2, + type=SchemaType.JSON, + data=schema_v2_data, + external_ref="http://example.com/v2", + ) + + schema_client.register_schema(schema_v1) + schema_client.register_schema(schema_v2) + + retrieved_v1 = schema_client.get_schema(schema_name, 1) + assert retrieved_v1.version == 1 + assert "age" not in retrieved_v1.data["properties"].keys() + + retrieved_v2 = schema_client.get_schema(schema_name, 2) + assert retrieved_v2.version == 2 + assert "age" in retrieved_v2.data["properties"].keys() + + except Exception as e: + print(f"Exception in test_schema_versioning: {str(e)}") + raise + finally: + try: + schema_client.delete_schema(schema_name, 1) + schema_client.delete_schema(schema_name, 2) + except Exception as e: + print(f"Warning: Failed to cleanup schema {schema_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_delete_schema_by_name( + self, schema_client: OrkesSchemaClient, test_suffix: str, json_schema_data: dict + ): + schema_name = f"test_delete_by_name_{test_suffix}" + try: + schema_v1 = SchemaDef( + name=schema_name, version=1, type=SchemaType.JSON, data=json_schema_data + ) + + schema_v2 = SchemaDef( + name=schema_name, version=2, type=SchemaType.JSON, data=json_schema_data + ) + + schema_client.register_schema(schema_v1) + schema_client.register_schema(schema_v2) + + schema_client.delete_schema_by_name(schema_name) + + with pytest.raises(ApiException) as exc_info: + schema_client.get_schema(schema_name, 1) + assert exc_info.value.code == 404 + + with pytest.raises(ApiException) as exc_info: + schema_client.get_schema(schema_name, 2) + assert exc_info.value.code == 404 + + except Exception as e: + print(f"Exception in test_delete_schema_by_name: {str(e)}") + raise + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_concurrent_schema_operations( + self, schema_client: OrkesSchemaClient, test_suffix: str, json_schema_data: dict + ): + try: + import threading + import time + + results = [] + errors = [] + created_schemas = [] + cleanup_lock = threading.Lock() + + def create_and_delete_schema(schema_suffix: str): + schema_name = None + try: + schema_name = f"concurrent_schema_{schema_suffix}" + schema = SchemaDef( + name=schema_name, + version=1, + type=SchemaType.JSON, + data=json_schema_data, + ) + + schema_client.register_schema(schema) + + with cleanup_lock: + created_schemas.append(schema_name) + + time.sleep(0.1) + + retrieved_schema = schema_client.get_schema(schema_name, 1) + assert retrieved_schema.name == schema_name + + if os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true": + try: + schema_client.delete_schema(schema_name, 1) + with cleanup_lock: + if schema_name in created_schemas: + created_schemas.remove(schema_name) + except Exception as cleanup_error: + print( + f"Warning: Failed to cleanup schema {schema_name} in thread: {str(cleanup_error)}" + ) + + results.append(f"schema_{schema_suffix}_success") + except Exception as e: + errors.append(f"schema_{schema_suffix}_error: {str(e)}") + if schema_name and schema_name not in created_schemas: + with cleanup_lock: + created_schemas.append(schema_name) + + threads = [] + for i in range(3): + thread = threading.Thread( + target=create_and_delete_schema, args=(f"{test_suffix}_{i}",) + ) + threads.append(thread) + thread.start() + + for thread in threads: + thread.join() + + assert ( + len(results) == 3 + ), f"Expected 3 successful operations, got {len(results)}. Errors: {errors}" + assert len(errors) == 0, f"Unexpected errors: {errors}" + + except Exception as e: + print(f"Exception in test_concurrent_schema_operations: {str(e)}") + raise + finally: + for schema_name in created_schemas: + try: + schema_client.delete_schema(schema_name, 1) + except Exception as e: + print(f"Warning: Failed to delete schema {schema_name}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_complex_schema_management_flow( + self, schema_client: OrkesSchemaClient, test_suffix: str + ): + created_resources = {"schemas": []} + + try: + schema_types = [SchemaType.JSON, SchemaType.AVRO, SchemaType.PROTOBUF] + schema_templates = { + SchemaType.JSON: { + "type": "object", + "properties": {"field": {"type": "string"}}, + "$schema": "http://json-schema.org/draft-07/schema", + }, + SchemaType.AVRO: { + "type": "record", + "name": "TestRecord", + "fields": [{"name": "field", "type": "string"}], + }, + SchemaType.PROTOBUF: { + "syntax": "proto3", + "message": { + "name": "TestMessage", + "fields": [{"name": "field", "type": "string", "number": 1}], + }, + }, + } + + for schema_type in schema_types: + for version in range(1, 4): + schema_name = ( + f"complex_{schema_type.value.lower()}_v{version}_{test_suffix}" + ) + schema = SchemaDef( + name=schema_name, + version=version, + type=schema_type, + data=schema_templates[schema_type], + external_ref=f"http://example.com/{schema_type.value.lower()}/v{version}", + ) + + schema_client.register_schema(schema) + created_resources["schemas"].append((schema_name, version)) + + all_schemas = schema_client.get_all_schemas() + schema_names = [s.name for s in all_schemas] + for schema_name, version in created_resources["schemas"]: + assert ( + schema_name in schema_names + ), f"Schema {schema_name} not found in list" + + for schema_type in schema_types: + for version in range(1, 4): + schema_name = ( + f"complex_{schema_type.value.lower()}_v{version}_{test_suffix}" + ) + retrieved_schema = schema_client.get_schema(schema_name, version) + assert retrieved_schema.name == schema_name + assert retrieved_schema.version == version + assert retrieved_schema.type == schema_type + + bulk_schemas = [] + for i in range(5): + schema_name = f"bulk_schema_{i}_{test_suffix}" + schema = SchemaDef( + name=schema_name, + version=1, + type=SchemaType.JSON, + data={"type": "object", "properties": {"id": {"type": "integer"}}}, + ) + schema_client.register_schema(schema) + bulk_schemas.append(schema_name) + created_resources["schemas"].append((schema_name, 1)) + + all_schemas_after_bulk = schema_client.get_all_schemas() + schema_names_after_bulk = [s.name for s in all_schemas_after_bulk] + for schema_name in bulk_schemas: + assert ( + schema_name in schema_names_after_bulk + ), f"Bulk schema {schema_name} not found in list" + + except Exception as e: + print(f"Exception in test_complex_schema_management_flow: {str(e)}") + raise + finally: + self._perform_comprehensive_cleanup(schema_client, created_resources) + + def _perform_comprehensive_cleanup( + self, schema_client: OrkesSchemaClient, created_resources: dict + ): + cleanup_enabled = os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + if not cleanup_enabled: + return + + for schema_name, version in created_resources["schemas"]: + try: + schema_client.delete_schema(schema_name, version) + except Exception as e: + print( + f"Warning: Failed to delete schema {schema_name} v{version}: {str(e)}" + ) + + remaining_schemas = [] + for schema_name, version in created_resources["schemas"]: + try: + schema_client.get_schema(schema_name, version) + remaining_schemas.append((schema_name, version)) + except ApiException as e: + if e.code == 404: + pass + else: + remaining_schemas.append((schema_name, version)) + except Exception: + remaining_schemas.append((schema_name, version)) + + if remaining_schemas: + print( + f"Warning: {len(remaining_schemas)} schemas could not be verified as deleted: {remaining_schemas}" + ) diff --git a/tests/integration/test_orkes_secret_client_integration.py b/tests/integration/test_orkes_secret_client_integration.py new file mode 100644 index 00000000..a0efebcb --- /dev/null +++ b/tests/integration/test_orkes_secret_client_integration.py @@ -0,0 +1,368 @@ +import os +import uuid +from copy import deepcopy + +import pytest + +from conductor.client.configuration.configuration import Configuration +from conductor.client.codegen.rest import ApiException +from conductor.client.orkes.models.metadata_tag import MetadataTag +from conductor.client.orkes.orkes_secret_client import OrkesSecretClient + + +class TestOrkesSecretClientIntegration: + """ + Integration tests for OrkesSecretClient. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def secret_client(self, configuration: Configuration) -> OrkesSecretClient: + return OrkesSecretClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def test_secret_key(self, test_suffix: str) -> str: + return f"test_secret_{test_suffix}" + + @pytest.fixture(scope="class") + def simple_secret_value(self) -> str: + return "simple_secret_value_123" + + @pytest.fixture(scope="class") + def complex_secret_value(self) -> str: + return """{"api_key": "sk-1234567890abcdef", "database_url": "postgresql://user:pass@localhost:5432/db", "redis_password": "redis_secret_456", "jwt_secret": "jwt_secret_key_789", "encryption_key": "encryption_key_abc123"}""" + + @pytest.fixture(scope="class") + def json_secret_value(self) -> str: + return '{"username": "admin", "password": "secure_password_123", "role": "administrator"}' + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_secret_lifecycle_simple( + self, + secret_client: OrkesSecretClient, + test_secret_key: str, + simple_secret_value: str, + ): + try: + secret_client.put_secret(test_secret_key, simple_secret_value) + + retrieved_value = secret_client.get_secret(test_secret_key) + assert retrieved_value == simple_secret_value + + exists = secret_client.secret_exists(test_secret_key) + assert exists is True + + all_secrets = secret_client.list_all_secret_names() + assert test_secret_key in all_secrets + + except Exception as e: + print(f"Exception in test_secret_lifecycle_simple: {str(e)}") + raise + finally: + try: + secret_client.delete_secret(test_secret_key) + except Exception as e: + print(f"Warning: Failed to cleanup secret {test_secret_key}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_secret_lifecycle_complex( + self, + secret_client: OrkesSecretClient, + test_suffix: str, + complex_secret_value: str, + ): + secret_key = f"test_complex_secret_{test_suffix}" + try: + secret_client.put_secret(secret_key, complex_secret_value) + + retrieved_value = secret_client.get_secret(secret_key) + assert retrieved_value is not None + + exists = secret_client.secret_exists(secret_key) + assert exists is True + + except Exception as e: + print(f"Exception in test_secret_lifecycle_complex: {str(e)}") + raise + finally: + try: + secret_client.delete_secret(secret_key) + except Exception as e: + print(f"Warning: Failed to cleanup secret {secret_key}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_secret_with_tags( + self, + secret_client: OrkesSecretClient, + test_suffix: str, + simple_secret_value: str, + ): + secret_key = f"test_tagged_secret_{test_suffix}" + try: + secret_client.put_secret(secret_key, simple_secret_value) + + tags = [ + MetadataTag("environment", "test"), + MetadataTag("type", "api_key"), + MetadataTag("owner", "integration_test"), + ] + secret_client.set_secret_tags(tags, secret_key) + + retrieved_tags = secret_client.get_secret_tags(secret_key) + assert len(retrieved_tags) == 3 + tag_keys = [tag.key for tag in retrieved_tags] + assert "environment" in tag_keys + assert "type" in tag_keys + assert "owner" in tag_keys + + tags_to_delete = [MetadataTag("owner", "integration_test")] + secret_client.delete_secret_tags(tags_to_delete, secret_key) + + retrieved_tags_after_delete = secret_client.get_secret_tags(secret_key) + remaining_tag_keys = [tag.key for tag in retrieved_tags_after_delete] + assert "owner" not in remaining_tag_keys + assert len(retrieved_tags_after_delete) == 2 + + except Exception as e: + print(f"Exception in test_secret_with_tags: {str(e)}") + raise + finally: + try: + secret_client.delete_secret(secret_key) + except Exception as e: + print(f"Warning: Failed to cleanup secret {secret_key}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_secret_update( + self, + secret_client: OrkesSecretClient, + test_suffix: str, + simple_secret_value: str, + ): + secret_key = f"test_secret_update_{test_suffix}" + try: + initial_value = simple_secret_value + secret_client.put_secret(secret_key, initial_value) + + retrieved_value = secret_client.get_secret(secret_key) + assert retrieved_value == initial_value + + updated_value = "updated_secret_value_456" + secret_client.put_secret(secret_key, updated_value) + + updated_retrieved_value = secret_client.get_secret(secret_key) + assert updated_retrieved_value == updated_value + + except Exception as e: + print(f"Exception in test_secret_update: {str(e)}") + raise + finally: + try: + secret_client.delete_secret(secret_key) + except Exception as e: + print(f"Warning: Failed to cleanup secret {secret_key}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_concurrent_secret_operations( + self, + secret_client: OrkesSecretClient, + test_suffix: str, + simple_secret_value: str, + ): + try: + import threading + import time + + results = [] + errors = [] + created_secrets = [] + cleanup_lock = threading.Lock() + + def create_and_delete_secret(secret_suffix: str): + secret_key = None + try: + secret_key = f"concurrent_secret_{secret_suffix}" + secret_value = f"concurrent_value_{secret_suffix}" + secret_client.put_secret(secret_key, secret_value) + + with cleanup_lock: + created_secrets.append(secret_key) + + time.sleep(0.1) + + retrieved_value = secret_client.get_secret(secret_key) + assert retrieved_value == secret_value + + if os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true": + try: + secret_client.delete_secret(secret_key) + with cleanup_lock: + if secret_key in created_secrets: + created_secrets.remove(secret_key) + except Exception as cleanup_error: + print( + f"Warning: Failed to cleanup secret {secret_key} in thread: {str(cleanup_error)}" + ) + + results.append(f"secret_{secret_suffix}_success") + except Exception as e: + errors.append(f"secret_{secret_suffix}_error: {str(e)}") + if secret_key and secret_key not in created_secrets: + with cleanup_lock: + created_secrets.append(secret_key) + + threads = [] + for i in range(3): + thread = threading.Thread( + target=create_and_delete_secret, args=(f"{test_suffix}_{i}",) + ) + threads.append(thread) + thread.start() + + for thread in threads: + thread.join() + + assert ( + len(results) == 3 + ), f"Expected 3 successful operations, got {len(results)}. Errors: {errors}" + assert len(errors) == 0, f"Unexpected errors: {errors}" + + except Exception as e: + print(f"Exception in test_concurrent_secret_operations: {str(e)}") + raise + finally: + for secret_key in created_secrets: + try: + secret_client.delete_secret(secret_key) + except Exception as e: + print(f"Warning: Failed to delete secret {secret_key}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_complex_secret_management_flow( + self, secret_client: OrkesSecretClient, test_suffix: str + ): + created_resources = {"secrets": []} + + try: + secret_types = { + "api_key": "sk-1234567890abcdef", + "database_password": "db_password_secure_123", + "redis_password": "redis_secret_456", + "jwt_secret": "jwt_secret_key_789", + "encryption_key": "encryption_key_abc123", + } + + for secret_type, secret_value in secret_types.items(): + secret_key = f"complex_{secret_type}_{test_suffix}" + secret_client.put_secret(secret_key, secret_value) + created_resources["secrets"].append(secret_key) + + tags = [ + MetadataTag("type", secret_type), + MetadataTag("environment", "test"), + MetadataTag("owner", "integration_test"), + ] + secret_client.set_secret_tags(tags, secret_key) + + all_secrets = secret_client.list_all_secret_names() + for secret_key in created_resources["secrets"]: + assert ( + secret_key in all_secrets + ), f"Secret {secret_key} not found in list" + + for secret_type, secret_value in secret_types.items(): + secret_key = f"complex_{secret_type}_{test_suffix}" + retrieved_value = secret_client.get_secret(secret_key) + assert retrieved_value == secret_value + + retrieved_tags = secret_client.get_secret_tags(secret_key) + tag_keys = [tag.key for tag in retrieved_tags] + assert "type" in tag_keys + assert "environment" in tag_keys + assert "owner" in tag_keys + + bulk_secrets = [] + for i in range(5): + secret_key = f"bulk_secret_{i}_{test_suffix}" + secret_value = f"bulk_value_{i}_{uuid.uuid4()}" + secret_client.put_secret(secret_key, secret_value) + bulk_secrets.append(secret_key) + created_resources["secrets"].append(secret_key) + + all_secrets_after_bulk = secret_client.list_all_secret_names() + for secret_key in bulk_secrets: + assert ( + secret_key in all_secrets_after_bulk + ), f"Bulk secret {secret_key} not found in list" + + accessible_secrets = ( + secret_client.list_secrets_that_user_can_grant_access_to() + ) + assert isinstance(accessible_secrets, list) + + for secret_type in ["api_key", "database_password"]: + secret_key = f"complex_{secret_type}_{test_suffix}" + exists = secret_client.secret_exists(secret_key) + assert exists is True + + except Exception as e: + print(f"Exception in test_complex_secret_management_flow: {str(e)}") + raise + finally: + self._perform_comprehensive_cleanup(secret_client, created_resources) + + def _perform_comprehensive_cleanup( + self, secret_client: OrkesSecretClient, created_resources: dict + ): + cleanup_enabled = os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + if not cleanup_enabled: + return + + for secret_key in created_resources["secrets"]: + try: + secret_client.delete_secret(secret_key) + except Exception as e: + print(f"Warning: Failed to delete secret {secret_key}: {str(e)}") + + remaining_secrets = [] + for secret_key in created_resources["secrets"]: + try: + exists = secret_client.secret_exists(secret_key) + if exists: + remaining_secrets.append(secret_key) + except ApiException as e: + if e.code == 404: + pass + else: + remaining_secrets.append(secret_key) + except Exception: + remaining_secrets.append(secret_key) + + if remaining_secrets: + print( + f"Warning: {len(remaining_secrets)} secrets could not be verified as deleted: {remaining_secrets}" + ) diff --git a/tests/integration/test_orkes_service_registry_client_integration.py b/tests/integration/test_orkes_service_registry_client_integration.py new file mode 100644 index 00000000..1411cb37 --- /dev/null +++ b/tests/integration/test_orkes_service_registry_client_integration.py @@ -0,0 +1,345 @@ +import os +import uuid + +import pytest + +from conductor.client.http.models.request_param import ( + RequestParamAdapter as RequestParam, +) +from conductor.client.http.models.service_method import ( + ServiceMethodAdapter as ServiceMethod, +) +from conductor.client.http.models.service_registry import ( + Config, + OrkesCircuitBreakerConfig, +) +from conductor.client.http.models.service_registry import ( + ServiceRegistryAdapter as ServiceRegistry, +) +from conductor.client.configuration.configuration import Configuration +from conductor.client.http.models.service_registry import ServiceType +from conductor.client.codegen.rest import ApiException +from conductor.client.orkes.orkes_service_registry_client import ( + OrkesServiceRegistryClient, +) + + +class TestOrkesServiceRegistryClientIntegration: + """ + Integration tests for OrkesServiceRegistryClient. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def service_registry_client( + self, configuration: Configuration + ) -> OrkesServiceRegistryClient: + return OrkesServiceRegistryClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def test_service_name(self, test_suffix: str) -> str: + return f"test_service_{test_suffix}" + + @pytest.fixture(scope="class") + def simple_http_service(self, test_suffix: str) -> ServiceRegistry: + circuit_breaker_config = OrkesCircuitBreakerConfig( + failure_rate_threshold=50.0, + sliding_window_size=10, + minimum_number_of_calls=5, + wait_duration_in_open_state=60, + permitted_number_of_calls_in_half_open_state=3, + slow_call_rate_threshold=100.0, + slow_call_duration_threshold=60, + automatic_transition_from_open_to_half_open_enabled=True, + max_wait_duration_in_half_open_state=30, + ) + config = Config(circuit_breaker_config=circuit_breaker_config) + + return ServiceRegistry( + name=f"test_http_service_{test_suffix}", + type=ServiceType.HTTP, + service_uri="http://localhost:8080/api", + methods=[], + request_params=[], + config=config, + ) + + @pytest.fixture(scope="class") + def simple_grpc_service(self, test_suffix: str) -> ServiceRegistry: + circuit_breaker_config = OrkesCircuitBreakerConfig( + failure_rate_threshold=30.0, + sliding_window_size=20, + minimum_number_of_calls=10, + wait_duration_in_open_state=120, + permitted_number_of_calls_in_half_open_state=5, + slow_call_rate_threshold=80.0, + slow_call_duration_threshold=30, + automatic_transition_from_open_to_half_open_enabled=False, + max_wait_duration_in_half_open_state=60, + ) + config = Config(circuit_breaker_config=circuit_breaker_config) + + return ServiceRegistry( + name=f"test_grpc_service_{test_suffix}", + type=ServiceType.GRPC, + service_uri="grpc://localhost:9090", + methods=[], + request_params=[], + config=config, + ) + + @pytest.fixture(scope="class") + def sample_service_method(self) -> ServiceMethod: + request_params = [ + RequestParam(name="id", type="string", required=True), + RequestParam(name="name", type="string", required=False), + ] + + return ServiceMethod( + id=1, + operation_name="getUser", + method_name="getUser", + method_type="GET", + input_type="string", + output_type="User", + request_params=request_params, + example_input={"id": "123", "name": "John Doe"}, + ) + + @pytest.fixture(scope="class") + def sample_proto_data(self) -> bytes: + return b""" + syntax = "proto3"; + + package user; + + service UserService { + rpc GetUser(GetUserRequest) returns (GetUserResponse); + rpc CreateUser(CreateUserRequest) returns (CreateUserResponse); + } + + message GetUserRequest { + string id = 1; + } + + message GetUserResponse { + string id = 1; + string name = 2; + string email = 3; + } + + message CreateUserRequest { + string name = 1; + string email = 2; + } + + message CreateUserResponse { + string id = 1; + string name = 2; + string email = 3; + } + """ + + @pytest.mark.v5_2_6 + def test_service_lifecycle_http( + self, + service_registry_client: OrkesServiceRegistryClient, + simple_http_service: ServiceRegistry, + ): + try: + service_registry_client.add_or_update_service(simple_http_service) + + retrieved_service = service_registry_client.get_service( + simple_http_service.name + ) + assert retrieved_service.name == simple_http_service.name + assert retrieved_service.type == simple_http_service.type + assert retrieved_service.service_uri == simple_http_service.service_uri + + all_services = service_registry_client.get_registered_services() + service_names = [service.name for service in all_services] + assert simple_http_service.name in service_names + + except Exception as e: + print(f"Exception in test_service_lifecycle_http: {str(e)}") + raise + finally: + try: + service_registry_client.remove_service(simple_http_service.name) + except Exception as e: + print( + f"Warning: Failed to cleanup service {simple_http_service.name}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + def test_service_lifecycle_grpc( + self, + service_registry_client: OrkesServiceRegistryClient, + simple_grpc_service: ServiceRegistry, + ): + try: + service_registry_client.add_or_update_service(simple_grpc_service) + + retrieved_service = service_registry_client.get_service( + simple_grpc_service.name + ) + assert retrieved_service.name == simple_grpc_service.name + assert retrieved_service.type == simple_grpc_service.type + assert retrieved_service.service_uri == simple_grpc_service.service_uri + + except Exception as e: + print(f"Exception in test_service_lifecycle_grpc: {str(e)}") + raise + finally: + try: + service_registry_client.remove_service(simple_grpc_service.name) + except Exception as e: + print( + f"Warning: Failed to cleanup service {simple_grpc_service.name}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + def test_service_update( + self, + service_registry_client: OrkesServiceRegistryClient, + test_suffix: str, + ): + service_name = f"test_service_update_{test_suffix}" + try: + initial_service = ServiceRegistry( + name=service_name, + type=ServiceType.HTTP, + service_uri="http://localhost:8080/api", + methods=[], + request_params=[], + ) + + service_registry_client.add_or_update_service(initial_service) + + retrieved_service = service_registry_client.get_service(service_name) + assert retrieved_service.service_uri == "http://localhost:8080/api" + + updated_service = ServiceRegistry( + name=service_name, + type=ServiceType.HTTP, + service_uri="http://localhost:9090/api", + methods=[], + request_params=[], + ) + + service_registry_client.add_or_update_service(updated_service) + + updated_retrieved_service = service_registry_client.get_service( + service_name + ) + assert updated_retrieved_service.service_uri == "http://localhost:9090/api" + + except Exception as e: + print(f"Exception in test_service_update: {str(e)}") + raise + finally: + try: + service_registry_client.remove_service(service_name) + except Exception as e: + print(f"Warning: Failed to cleanup service {service_name}: {str(e)}") + + @pytest.mark.v5_2_6 + def test_concurrent_service_operations( + self, + service_registry_client: OrkesServiceRegistryClient, + test_suffix: str, + ): + try: + import threading + import time + + results = [] + errors = [] + created_services = [] + cleanup_lock = threading.Lock() + + def create_and_delete_service(service_suffix: str): + service_name = None + try: + service_name = f"concurrent_service_{service_suffix}" + service = ServiceRegistry( + name=service_name, + type=ServiceType.HTTP, + service_uri=f"http://localhost:808{service_suffix}/api", + methods=[], + request_params=[], + ) + + service_registry_client.add_or_update_service(service) + + with cleanup_lock: + created_services.append(service_name) + + time.sleep(0.1) + + retrieved_service = service_registry_client.get_service( + service_name + ) + assert retrieved_service.name == service_name + + if os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true": + try: + service_registry_client.remove_service(service_name) + with cleanup_lock: + if service_name in created_services: + created_services.remove(service_name) + except Exception as cleanup_error: + print( + f"Warning: Failed to cleanup service {service_name} in thread: {str(cleanup_error)}" + ) + + results.append(f"service_{service_suffix}_success") + except Exception as e: + errors.append(f"service_{service_suffix}_error: {str(e)}") + if service_name and service_name not in created_services: + with cleanup_lock: + created_services.append(service_name) + + threads = [] + for i in range(3): + thread = threading.Thread( + target=create_and_delete_service, args=(f"{test_suffix}_{i}",) + ) + threads.append(thread) + thread.start() + + for thread in threads: + thread.join() + + assert ( + len(results) == 3 + ), f"Expected 3 successful operations, got {len(results)}. Errors: {errors}" + assert len(errors) == 0, f"Unexpected errors: {errors}" + + except Exception as e: + print(f"Exception in test_concurrent_service_operations: {str(e)}") + raise + finally: + for service_name in created_services: + try: + service_registry_client.remove_service(service_name) + except Exception as e: + print(f"Warning: Failed to delete service {service_name}: {str(e)}") diff --git a/tests/integration/test_orkes_task_client_integration.py b/tests/integration/test_orkes_task_client_integration.py new file mode 100644 index 00000000..39978e3e --- /dev/null +++ b/tests/integration/test_orkes_task_client_integration.py @@ -0,0 +1,823 @@ +import os +import threading +import time +import uuid + +import pytest + +from conductor.client.http.models.start_workflow_request import \ + StartWorkflowRequestAdapter as StartWorkflowRequest +from conductor.client.http.models.task_def import \ + TaskDefAdapter as TaskDef +from conductor.client.http.models.task_result import \ + TaskResultAdapter as TaskResult +from conductor.client.http.models.workflow import \ + WorkflowAdapter as Workflow +from conductor.client.http.models.workflow_def import \ + WorkflowDefAdapter as WorkflowDef +from conductor.client.configuration.configuration import Configuration +from conductor.client.codegen.rest import ApiException +from conductor.client.orkes.orkes_metadata_client import OrkesMetadataClient +from conductor.client.orkes.orkes_task_client import OrkesTaskClient +from conductor.client.orkes.orkes_workflow_client import OrkesWorkflowClient +from conductor.shared.http.enums.task_result_status import TaskResultStatus + + +class TestOrkesTaskClientIntegration: + """ + Integration tests for OrkesTaskClient. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + """Create configuration from environment variables.""" + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def task_client(self, configuration: Configuration) -> OrkesTaskClient: + """Create OrkesTaskClient instance.""" + return OrkesTaskClient(configuration) + + @pytest.fixture(scope="class") + def workflow_client(self, configuration: Configuration) -> OrkesWorkflowClient: + """Create OrkesWorkflowClient instance.""" + return OrkesWorkflowClient(configuration) + + @pytest.fixture(scope="class") + def metadata_client(self, configuration: Configuration) -> OrkesMetadataClient: + """Create OrkesMetadataClient instance.""" + return OrkesMetadataClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + """Generate unique suffix for test resources.""" + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def test_task_type(self, test_suffix: str) -> str: + """Generate test task type.""" + return f"test_task_{test_suffix}" + + @pytest.fixture(scope="class") + def test_workflow_name(self, test_suffix: str) -> str: + """Generate test workflow name.""" + return f"test_workflow_{test_suffix}" + + @pytest.fixture(scope="class") + def test_worker_id(self, test_suffix: str) -> str: + """Generate test worker ID.""" + return f"test_worker_{test_suffix}" + + @pytest.fixture(scope="class") + def test_domain(self, test_suffix: str) -> str: + """Generate test domain.""" + return f"test_domain_{test_suffix}" + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_task_definition_lifecycle( + self, metadata_client: OrkesMetadataClient, test_task_type: str + ): + """Test complete task definition lifecycle: create, read, update, delete.""" + try: + task_def = TaskDef( + name=test_task_type, + description="Test task for integration testing", + owner_email="test@example.com", + timeout_seconds=30, + response_timeout_seconds=20, + input_keys=["input1", "input2"], + output_keys=["output1", "output2"], + ) + + metadata_client.register_task_def(task_def) + + retrieved_task_def = metadata_client.get_task_def(test_task_type) + assert retrieved_task_def.get("name") == test_task_type + assert ( + retrieved_task_def.get("description") + == "Test task for integration testing" + ) + + task_defs = metadata_client.get_all_task_defs() + task_names = [td.name for td in task_defs] + assert test_task_type in task_names + + updated_task_def = TaskDef( + name=test_task_type, + description="Updated test task for integration testing", + owner_email="test@example.com", + timeout_seconds=60, + response_timeout_seconds=40, + input_keys=["input1", "input2", "input3"], + output_keys=["output1", "output2", "output3"], + ) + + metadata_client.update_task_def(updated_task_def) + + retrieved_updated = metadata_client.get_task_def(test_task_type) + assert ( + retrieved_updated.get("description") + == "Updated test task for integration testing" + ) + assert retrieved_updated.get("timeoutSeconds") == 60 + + finally: + try: + metadata_client.unregister_task_def(test_task_type) + except Exception: + pass + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_definition_lifecycle( + self, + metadata_client: OrkesMetadataClient, + test_workflow_name: str, + test_task_type: str, + ): + """Test complete workflow definition lifecycle: create, read, update, delete.""" + try: + workflow_def = WorkflowDef( + name=test_workflow_name, + description="Test workflow for integration testing", + version=1, + tasks=[ + { + "name": test_task_type, + "taskReferenceName": "test_task_ref", + "type": "SIMPLE", + } + ], + input_parameters=[], + output_parameters={}, + owner_email="test@example.com", + ) + + metadata_client.update_workflow_def(workflow_def) + + retrieved_workflow_def = metadata_client.get_workflow_def( + test_workflow_name, 1 + ) + assert retrieved_workflow_def.name == test_workflow_name + assert ( + retrieved_workflow_def.description + == "Test workflow for integration testing" + ) + + workflow_defs = metadata_client.get_all_workflow_defs() + workflow_names = [wd.name for wd in workflow_defs] + assert test_workflow_name in workflow_names + + finally: + try: + metadata_client.unregister_workflow_def(test_workflow_name, 1) + except Exception: + pass + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_task_polling_lifecycle( + self, + task_client: OrkesTaskClient, + workflow_client: OrkesWorkflowClient, + metadata_client: OrkesMetadataClient, + test_task_type: str, + test_workflow_name: str, + test_worker_id: str, + test_domain: str, + ): + """Test complete task polling lifecycle: poll, batch poll, with different parameters.""" + try: + task_def = TaskDef( + name=test_task_type, + description="Test task for polling", + owner_email="test@example.com", + timeout_seconds=30, + response_timeout_seconds=20, + ) + metadata_client.register_task_def(task_def) + + workflow_def = WorkflowDef( + name=test_workflow_name, + description="Test workflow for polling", + version=1, + tasks=[ + { + "name": test_task_type, + "taskReferenceName": "test_task_ref", + "type": "SIMPLE", + } + ], + input_parameters=[], + output_parameters={}, + owner_email="test@example.com", + ) + metadata_client.update_workflow_def(workflow_def) + + polled_task = task_client.poll_task(test_task_type) + assert polled_task.domain is None + + polled_task_with_worker = task_client.poll_task( + test_task_type, worker_id=test_worker_id + ) + assert polled_task_with_worker.domain is None + + polled_task_with_domain = task_client.poll_task( + test_task_type, domain=test_domain + ) + assert polled_task_with_domain.domain is None + + polled_task_with_both = task_client.poll_task( + test_task_type, worker_id=test_worker_id, domain=test_domain + ) + assert polled_task_with_both.domain is None + + batch_polled_tasks = task_client.batch_poll_tasks(test_task_type) + assert isinstance(batch_polled_tasks, list) + assert len(batch_polled_tasks) == 0 + + batch_polled_tasks_with_count = task_client.batch_poll_tasks( + test_task_type, count=5 + ) + assert isinstance(batch_polled_tasks_with_count, list) + assert len(batch_polled_tasks_with_count) == 0 + + batch_polled_tasks_with_timeout = task_client.batch_poll_tasks( + test_task_type, timeout_in_millisecond=1000 + ) + assert isinstance(batch_polled_tasks_with_timeout, list) + assert len(batch_polled_tasks_with_timeout) == 0 + + batch_polled_tasks_with_all = task_client.batch_poll_tasks( + test_task_type, + worker_id=test_worker_id, + count=3, + timeout_in_millisecond=500, + domain=test_domain, + ) + assert isinstance(batch_polled_tasks_with_all, list) + assert len(batch_polled_tasks_with_all) == 0 + + queue_size = task_client.get_queue_size_for_task(test_task_type) + assert isinstance(queue_size, int) + assert queue_size >= 0 + + poll_data = task_client.get_task_poll_data(test_task_type) + assert isinstance(poll_data, list) + + finally: + try: + metadata_client.unregister_task_def(test_task_type) + metadata_client.unregister_workflow_def(test_workflow_name, 1) + except Exception: + pass + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_task_execution_lifecycle( + self, + task_client: OrkesTaskClient, + workflow_client: OrkesWorkflowClient, + metadata_client: OrkesMetadataClient, + test_task_type: str, + test_workflow_name: str, + test_worker_id: str, + ): + """Test complete task execution lifecycle: start workflow, poll task, update task, get task.""" + try: + task_def = TaskDef( + name=test_task_type, + description="Test task for execution", + owner_email="test@example.com", + timeout_seconds=30, + response_timeout_seconds=20, + ) + metadata_client.register_task_def(task_def) + + workflow_def = WorkflowDef( + name=test_workflow_name, + description="Test workflow for execution", + version=1, + tasks=[ + { + "name": test_task_type, + "taskReferenceName": "test_task_ref", + "type": "SIMPLE", + } + ], + input_parameters=[], + output_parameters={}, + owner_email="test@example.com", + ) + metadata_client.update_workflow_def(workflow_def) + + start_request = StartWorkflowRequest( + name=test_workflow_name, version=1, input={"test_input": "test_value"} + ) + workflow_id = workflow_client.start_workflow(start_request) + assert workflow_id is not None + + time.sleep(2) + + polled_task = task_client.poll_task( + test_task_type, worker_id=test_worker_id + ) + + if polled_task is not None: + retrieved_task = task_client.get_task(polled_task.task_id) + assert retrieved_task.task_id == polled_task.task_id + assert retrieved_task.task_type == test_task_type + + log_message = f"Test log message from {test_worker_id}" + task_client.add_task_log(polled_task.task_id, log_message) + + task_logs = task_client.get_task_logs(polled_task.task_id) + assert isinstance(task_logs, list) + assert len(task_logs) >= 1 + + task_result = TaskResult( + workflow_instance_id=workflow_id, + task_id=polled_task.task_id, + status=TaskResultStatus.IN_PROGRESS, + output_data={"result": "task completed successfully"}, + ) + update_result = task_client.update_task(task_result) + assert update_result is not None + + update_by_ref_result = task_client.update_task_by_ref_name( + workflow_id=workflow_id, + task_ref_name="test_task_ref", + status=TaskResultStatus.IN_PROGRESS, + output={"result": "updated by ref name"}, + worker_id=test_worker_id, + ) + assert update_by_ref_result is not None + + sync_result = task_client.update_task_sync( + workflow_id=workflow_id, + task_ref_name="test_task_ref", + status=TaskResultStatus.COMPLETED, + output={"result": "updated sync"}, + worker_id=test_worker_id, + ) + assert sync_result is not None + assert isinstance(sync_result, Workflow) + + else: + with pytest.raises(ApiException) as exc_info: + task_client.get_task("non_existent_task_id") + assert exc_info.value.code == 404 + + finally: + try: + metadata_client.unregister_task_def(test_task_type) + metadata_client.unregister_workflow_def(test_workflow_name, 1) + except Exception: + pass + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_task_status_transitions( + self, + task_client: OrkesTaskClient, + workflow_client: OrkesWorkflowClient, + metadata_client: OrkesMetadataClient, + test_task_type: str, + test_workflow_name: str, + test_worker_id: str, + ): + """Test task status transitions: IN_PROGRESS, COMPLETED, FAILED.""" + try: + task_def = TaskDef( + name=test_task_type, + description="Test task for status transitions", + owner_email="test@example.com", + timeout_seconds=30, + response_timeout_seconds=20, + ) + metadata_client.register_task_def(task_def) + + workflow_def = WorkflowDef( + name=test_workflow_name, + description="Test workflow for status transitions", + version=1, + tasks=[ + { + "name": test_task_type, + "taskReferenceName": "test_task_ref", + "type": "SIMPLE", + } + ], + input_parameters=[], + output_parameters={}, + owner_email="test@example.com", + ) + metadata_client.update_workflow_def(workflow_def) + + start_request = StartWorkflowRequest( + name=test_workflow_name, version=1, input={"test_input": "status_test"} + ) + workflow_id = workflow_client.start_workflow(start_request) + + time.sleep(2) + + polled_task = task_client.poll_task( + test_task_type, worker_id=test_worker_id + ) + + if polled_task is not None: + in_progress_result = TaskResult( + workflow_instance_id=workflow_id, + task_id=polled_task.task_id, + status=TaskResultStatus.IN_PROGRESS, + output_data={"status": "in_progress"}, + ) + task_client.update_task(in_progress_result) + + completed_result = TaskResult( + workflow_instance_id=workflow_id, + task_id=polled_task.task_id, + status=TaskResultStatus.COMPLETED, + output_data={"status": "completed", "result": "success"}, + ) + task_client.update_task(completed_result) + + failed_result = TaskResult( + workflow_instance_id=workflow_id, + task_id=polled_task.task_id, + status=TaskResultStatus.FAILED, + output_data={"status": "failed", "error": "test error"}, + ) + task_client.update_task(failed_result) + + terminal_error_result = TaskResult( + workflow_instance_id=workflow_id, + task_id=polled_task.task_id, + status=TaskResultStatus.FAILED_WITH_TERMINAL_ERROR, + output_data={"status": "terminal_error", "error": "terminal error"}, + ) + task_client.update_task(terminal_error_result) + + finally: + try: + metadata_client.unregister_task_def(test_task_type) + metadata_client.unregister_workflow_def(test_workflow_name, 1) + except Exception: + pass + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_concurrent_task_operations( + self, + task_client: OrkesTaskClient, + workflow_client: OrkesWorkflowClient, + metadata_client: OrkesMetadataClient, + test_suffix: str, + ): + """Test concurrent operations on multiple tasks.""" + try: + task_types = [] + workflow_names = [] + workflow_ids = [] + + for i in range(3): + task_type = f"concurrent_task_{test_suffix}_{i}" + workflow_name = f"concurrent_workflow_{test_suffix}_{i}" + + task_def = TaskDef( + name=task_type, + description=f"Concurrent test task {i}", + owner_email="test@example.com", + timeout_seconds=30, + response_timeout_seconds=20, + ) + metadata_client.register_task_def(task_def) + task_types.append(task_type) + + workflow_def = WorkflowDef( + name=workflow_name, + description=f"Concurrent test workflow {i}", + version=1, + tasks=[ + { + "name": task_type, + "taskReferenceName": f"task_ref_{i}", + "type": "SIMPLE", + } + ], + input_parameters=[], + output_parameters={}, + owner_email="test@example.com", + ) + metadata_client.update_workflow_def(workflow_def) + workflow_names.append(workflow_name) + + start_request = StartWorkflowRequest( + name=workflow_name, + version=1, + input={"test_input": "concurrent_test"}, + ) + workflow_id = workflow_client.start_workflow(start_request) + workflow_ids.append(workflow_id) + + results = [] + errors = [] + + def poll_and_update_task(task_type: str, worker_id: str): + try: + task = task_client.poll_task(task_type, worker_id=worker_id) + if task is not None: + task_result = TaskResult( + workflow_instance_id=workflow_ids[i], + task_id=task.task_id, + status=TaskResultStatus.COMPLETED, + output_data={ + "worker_id": worker_id, + "result": "concurrent_test", + }, + ) + update_result = task_client.update_task(task_result) + results.append(f"task_{task_type}_success") + else: + results.append(f"task_{task_type}_no_task") + except Exception as e: + errors.append(f"task_{task_type}_error: {str(e)}") + + threads = [] + for i, task_type in enumerate(task_types): + worker_id = f"concurrent_worker_{test_suffix}_{i}" + thread = threading.Thread( + target=poll_and_update_task, args=(task_type, worker_id) + ) + threads.append(thread) + thread.start() + + for thread in threads: + thread.join() + + assert ( + len(results) == 3 + ), f"Expected 3 operations, got {len(results)}. Errors: {errors}" + assert len(errors) == 0, f"Unexpected errors: {errors}" + + finally: + for task_type in task_types: + try: + metadata_client.unregister_task_def(task_type) + except Exception: + pass + + for workflow_name in workflow_names: + try: + metadata_client.unregister_workflow_def(workflow_name, 1) + except Exception: + pass + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_complex_task_workflow_scenario( + self, + task_client: OrkesTaskClient, + workflow_client: OrkesWorkflowClient, + metadata_client: OrkesMetadataClient, + test_suffix: str, + ): + """ + Complex task workflow scenario demonstrating: + - Multiple task types in a single workflow + - Task dependencies and execution order + - Task logging and monitoring + - Error handling and recovery + - Bulk operations + """ + created_resources = { + "task_defs": [], + "workflow_defs": [], + "workflows": [], + "tasks": [], + } + + try: + task_types = ["data_processing", "validation", "notification", "cleanup"] + task_defs = {} + + for task_type in task_types: + full_task_type = f"{task_type}_task_{test_suffix}" + task_def = TaskDef( + name=full_task_type, + description=f"Task for {task_type}", + owner_email="test@example.com", + timeout_seconds=60, + response_timeout_seconds=30, + input_keys=[f"{task_type}_input"], + output_keys=[f"{task_type}_output"], + ) + + created_task_def = metadata_client.register_task_def(task_def) + task_defs[task_type] = created_task_def + created_resources["task_defs"].append(full_task_type) + + workflow_name = f"complex_workflow_{test_suffix}" + workflow_def = WorkflowDef( + name=workflow_name, + description="Complex workflow for integration testing", + version=1, + tasks=[ + { + "name": f"data_processing_task_{test_suffix}", + "taskReferenceName": "data_processing", + "type": "SIMPLE", + }, + { + "name": f"validation_task_{test_suffix}", + "taskReferenceName": "validation", + "type": "SIMPLE", + "inputParameters": { + "validation_input": "${data_processing.output.data_processing_output}" + }, + }, + { + "name": f"notification_task_{test_suffix}", + "taskReferenceName": "notification", + "type": "SIMPLE", + "inputParameters": { + "notification_input": "${validation.output.validation_output}" + }, + }, + { + "name": f"cleanup_task_{test_suffix}", + "taskReferenceName": "cleanup", + "type": "SIMPLE", + }, + ], + input_parameters=["initial_data"], + output_parameters={"final_result": "${cleanup.output.cleanup_output}"}, + owner_email="test@example.com", + ) + + created_workflow_def = metadata_client.update_workflow_def(workflow_def) + created_resources["workflow_defs"].append((workflow_name, 1)) + + workflow_instances = [] + for i in range(3): + start_request = StartWorkflowRequest( + name=workflow_name, + version=1, + input={"initial_data": f"test_data_{i}"}, + ) + workflow_id = workflow_client.start_workflow(start_request) + workflow_instances.append(workflow_id) + created_resources["workflows"].append(workflow_id) + + for i, workflow_id in enumerate(workflow_instances): + data_task = task_client.poll_task( + f"data_processing_task_{test_suffix}", + worker_id=f"worker_{test_suffix}_{i}", + ) + if data_task: + task_client.add_task_log( + data_task.task_id, f"Processing data for workflow {workflow_id}" + ) + + data_result = TaskResult( + workflow_instance_id=workflow_id, + task_id=data_task.task_id, + status=TaskResultStatus.COMPLETED, + output_data={"data_processing_output": f"processed_data_{i}"}, + ) + task_client.update_task(data_result) + created_resources["tasks"].append(data_task.task_id) + + validation_task = task_client.poll_task( + f"validation_task_{test_suffix}", + worker_id=f"worker_{test_suffix}_{i}", + ) + if validation_task: + task_client.add_task_log( + validation_task.task_id, + f"Validating data for workflow {workflow_id}", + ) + + validation_result = TaskResult( + workflow_instance_id=workflow_id, + task_id=validation_task.task_id, + status=TaskResultStatus.COMPLETED, + output_data={"validation_output": f"validated_data_{i}"}, + ) + task_client.update_task(validation_result) + created_resources["tasks"].append(validation_task.task_id) + + notification_task = task_client.poll_task( + f"notification_task_{test_suffix}", + worker_id=f"worker_{test_suffix}_{i}", + ) + if notification_task: + task_client.add_task_log( + notification_task.task_id, + f"Sending notification for workflow {workflow_id}", + ) + + notification_result = TaskResult( + workflow_instance_id=workflow_id, + task_id=notification_task.task_id, + status=TaskResultStatus.COMPLETED, + output_data={"notification_output": f"notification_sent_{i}"}, + ) + task_client.update_task(notification_result) + created_resources["tasks"].append(notification_task.task_id) + + cleanup_task = task_client.poll_task( + f"cleanup_task_{test_suffix}", worker_id=f"worker_{test_suffix}_{i}" + ) + if cleanup_task: + task_client.add_task_log( + cleanup_task.task_id, f"Cleaning up for workflow {workflow_id}" + ) + cleanup_result = TaskResult( + workflow_instance_id=workflow_id, + task_id=cleanup_task.task_id, + status=TaskResultStatus.COMPLETED, + output_data={"cleanup_output": f"cleanup_completed_{i}"}, + ) + task_client.update_task(cleanup_result) + created_resources["tasks"].append(cleanup_task.task_id) + + for task_id in created_resources["tasks"]: + retrieved_task = task_client.get_task(task_id) + assert retrieved_task.task_id == task_id + + task_logs = task_client.get_task_logs(task_id) + assert len(task_logs) >= 1 + + assert retrieved_task.status == "COMPLETED" + + for task_type in task_types: + full_task_type = f"{task_type}_task_{test_suffix}" + batch_tasks = task_client.batch_poll_tasks( + full_task_type, count=5, timeout_in_millisecond=1000 + ) + assert isinstance(batch_tasks, list) + + queue_size = task_client.get_queue_size_for_task(full_task_type) + assert isinstance(queue_size, int) + assert queue_size >= 0 + + poll_data = task_client.get_task_poll_data(full_task_type) + assert isinstance(poll_data, list) + + if created_resources["tasks"]: + with pytest.raises(ValueError): + invalid_task_result = TaskResult( + task_id=created_resources["tasks"][0], + status="INVALID_STATUS", + output_data={"error": "test"}, + ) + try: + task_client.update_task(invalid_task_result) + except Exception as e: + print(f"Expected error with invalid status: {e}") + + except Exception as e: + print(f"Error during complex scenario: {str(e)}") + raise + finally: + self._perform_comprehensive_cleanup(metadata_client, created_resources) + + def _perform_comprehensive_cleanup( + self, metadata_client: OrkesMetadataClient, created_resources: dict + ): + """ + Perform comprehensive cleanup of all created resources. + Handles cleanup in the correct order to avoid dependency issues. + """ + cleanup_enabled = os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + if not cleanup_enabled: + return + + for workflow_name, version in created_resources["workflow_defs"]: + try: + metadata_client.unregister_workflow_def(workflow_name, version) + except Exception as e: + print( + f"Warning: Failed to delete workflow definition {workflow_name}: {str(e)}" + ) + + for task_type in created_resources["task_defs"]: + try: + metadata_client.unregister_task_def(task_type) + except Exception as e: + print( + f"Warning: Failed to delete task definition {task_type}: {str(e)}" + ) diff --git a/tests/integration/test_orkes_workflow_client_integration.py b/tests/integration/test_orkes_workflow_client_integration.py new file mode 100644 index 00000000..daab86cc --- /dev/null +++ b/tests/integration/test_orkes_workflow_client_integration.py @@ -0,0 +1,1080 @@ +import os +import time +import uuid + +import pytest + +from conductor.client.http.models.correlation_ids_search_request import \ + CorrelationIdsSearchRequestAdapter as CorrelationIdsSearchRequest +from conductor.client.http.models.rerun_workflow_request import \ + RerunWorkflowRequestAdapter as RerunWorkflowRequest +from conductor.client.http.models.start_workflow_request import \ + StartWorkflowRequestAdapter as StartWorkflowRequest +from conductor.client.http.models.workflow_def import \ + WorkflowDefAdapter as WorkflowDef +from conductor.client.http.models.workflow_state_update import \ + WorkflowStateUpdateAdapter as WorkflowStateUpdate +from conductor.client.http.models.workflow_task import \ + WorkflowTaskAdapter as WorkflowTask +from conductor.client.http.models.workflow_test_request import \ + WorkflowTestRequestAdapter as WorkflowTestRequest +from conductor.client.configuration.configuration import Configuration +from conductor.client.codegen.rest import ApiException +from conductor.client.orkes.orkes_metadata_client import OrkesMetadataClient +from conductor.client.orkes.orkes_workflow_client import OrkesWorkflowClient + + +class TestOrkesWorkflowClientIntegration: + """ + Integration tests for OrkesWorkflowClient. + + Environment Variables: + - CONDUCTOR_SERVER_URL: Base URL for Conductor server (default: http://localhost:8080/api) + - CONDUCTOR_AUTH_KEY: Authentication key for Orkes + - CONDUCTOR_AUTH_SECRET: Authentication secret for Orkes + - CONDUCTOR_UI_SERVER_URL: UI server URL (optional) + - CONDUCTOR_TEST_TIMEOUT: Test timeout in seconds (default: 30) + - CONDUCTOR_TEST_CLEANUP: Whether to cleanup test resources (default: true) + """ + + @pytest.fixture(scope="class") + def configuration(self) -> Configuration: + config = Configuration() + config.debug = os.getenv("CONDUCTOR_DEBUG", "false").lower() == "true" + config.apply_logging_config() + return config + + @pytest.fixture(scope="class") + def workflow_client(self, configuration: Configuration) -> OrkesWorkflowClient: + return OrkesWorkflowClient(configuration) + + @pytest.fixture(scope="class") + def metadata_client(self, configuration: Configuration) -> OrkesMetadataClient: + return OrkesMetadataClient(configuration) + + @pytest.fixture(scope="class") + def test_suffix(self) -> str: + return str(uuid.uuid4())[:8] + + @pytest.fixture(scope="class") + def test_workflow_name(self, test_suffix: str) -> str: + return f"test_workflow_{test_suffix}" + + @pytest.fixture(scope="class") + def simple_workflow_task(self) -> WorkflowTask: + return WorkflowTask( + name="test_task", + task_reference_name="test_task_ref", + type="HTTP_POLL", + input_parameters={ + "http_request": { + "uri": "http://httpbin.org/get", + "method": "GET", + "terminationCondition": "(function(){ return $.output.response.body.randomInt > 10;})();", + "pollingInterval": "5", + "pollingStrategy": "FIXED", + } + }, + ) + + @pytest.fixture(scope="class") + def simple_workflow_def( + self, test_workflow_name: str, simple_workflow_task: WorkflowTask + ) -> WorkflowDef: + return WorkflowDef( + name=test_workflow_name, + version=1, + description="A simple test workflow for integration testing", + tasks=[simple_workflow_task], + timeout_seconds=60, + timeout_policy="TIME_OUT_WF", + restartable=True, + owner_email="test@example.com", + ) + + @pytest.fixture(scope="class") + def simple_workflow_input(self) -> dict: + return { + "param1": "value1", + "param2": "value2", + "number": 42, + "boolean": True, + "array": [1, 2, 3], + "object": {"nested": "value"}, + } + + @pytest.fixture(scope="class") + def complex_workflow_input(self) -> dict: + return { + "user_id": "user_12345", + "order_data": { + "order_id": "order_67890", + "items": [ + {"product_id": "prod_1", "quantity": 2, "price": 29.99}, + {"product_id": "prod_2", "quantity": 1, "price": 49.99}, + ], + "shipping_address": { + "street": "123 Main St", + "city": "Anytown", + "state": "CA", + "zip": "12345", + }, + }, + "preferences": { + "notifications": True, + "language": "en", + "timezone": "UTC", + }, + "metadata": { + "source": "integration_test", + "timestamp": int(time.time()), + "version": "1.0", + }, + } + + @pytest.fixture(scope="class") + def simple_start_workflow_request( + self, test_workflow_name: str, simple_workflow_input: dict + ) -> StartWorkflowRequest: + return StartWorkflowRequest( + name=test_workflow_name, + version=1, + input=simple_workflow_input, + correlation_id=f"test_correlation_{str(uuid.uuid4())[:8]}", + priority=0, + ) + + @pytest.fixture(scope="class") + def complex_start_workflow_request( + self, test_workflow_name: str, complex_workflow_input: dict + ) -> StartWorkflowRequest: + return StartWorkflowRequest( + name=test_workflow_name, + version=1, + input=complex_workflow_input, + correlation_id=f"complex_correlation_{str(uuid.uuid4())[:8]}", + priority=1, + created_by="integration_test", + idempotency_key=f"idempotency_{str(uuid.uuid4())[:8]}", + ) + + @pytest.fixture(scope="class", autouse=True) + def setup_workflow_definition( + self, metadata_client: OrkesMetadataClient, simple_workflow_def: WorkflowDef + ): + """Create workflow definition before running tests.""" + try: + metadata_client.register_workflow_def(simple_workflow_def, overwrite=True) + time.sleep(1) + yield + finally: + try: + metadata_client.unregister_workflow_def( + simple_workflow_def.name, simple_workflow_def.version + ) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow definition {simple_workflow_def.name}: {str(e)}" + ) + + @pytest.mark.v3_21_16 + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_start_by_name( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_id = None + try: + + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + correlationId=f"start_by_name_{str(uuid.uuid4())[:8]}", + priority=0, + ) + + assert workflow_id is not None + assert isinstance(workflow_id, str) + assert len(workflow_id) > 0 + + workflow = workflow_client.get_workflow(workflow_id, include_tasks=True) + assert workflow.workflow_id == workflow_id + assert workflow.workflow_name == test_workflow_name + assert workflow.workflow_version == 1 + + except Exception as e: + print(f"Exception in test_workflow_start_by_name: {str(e)}") + raise + finally: + try: + if workflow_id: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print(f"Warning: Failed to cleanup workflow: {str(e)}") + + @pytest.mark.v3_21_16 + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_start_with_request( + self, + workflow_client: OrkesWorkflowClient, + simple_start_workflow_request: StartWorkflowRequest, + ): + try: + workflow_id = workflow_client.start_workflow(simple_start_workflow_request) + + assert workflow_id is not None + assert isinstance(workflow_id, str) + assert len(workflow_id) > 0 + + workflow = workflow_client.get_workflow(workflow_id, include_tasks=True) + assert workflow.workflow_id == workflow_id + assert workflow.workflow_name == simple_start_workflow_request.name + assert workflow.workflow_version == simple_start_workflow_request.version + + except Exception as e: + print(f"Exception in test_workflow_start_with_request: {str(e)}") + raise + finally: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print(f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_execute_sync( + self, + workflow_client: OrkesWorkflowClient, + simple_start_workflow_request: StartWorkflowRequest, + ): + try: + workflow_run = workflow_client.execute_workflow( + start_workflow_request=simple_start_workflow_request, + request_id=f"execute_sync_{str(uuid.uuid4())[:8]}", + wait_for_seconds=30, + ) + + assert workflow_run is not None + assert hasattr(workflow_run, "workflow_id") + assert hasattr(workflow_run, "status") + + except Exception as e: + print(f"Exception in test_workflow_execute_sync: {str(e)}") + raise + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_execute_with_return_strategy( + self, + workflow_client: OrkesWorkflowClient, + simple_start_workflow_request: StartWorkflowRequest, + ): + try: + signal_response = workflow_client.execute_workflow_with_return_strategy( + start_workflow_request=simple_start_workflow_request, + request_id=f"execute_strategy_{str(uuid.uuid4())[:8]}", + wait_for_seconds=30, + consistency="DURABLE", + return_strategy="TARGET_WORKFLOW", + ) + + assert signal_response is not None + + except Exception as e: + print(f"Exception in test_workflow_execute_with_return_strategy: {str(e)}") + raise + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_pause_resume( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + workflow_client.pause_workflow(workflow_id) + + workflow_status = workflow_client.get_workflow_status(workflow_id) + assert workflow_status.status in ["PAUSED", "RUNNING"] + + workflow_client.resume_workflow(workflow_id) + + workflow_status_after_resume = workflow_client.get_workflow_status( + workflow_id + ) + assert workflow_status_after_resume.status in ["RUNNING", "COMPLETED"] + + except Exception as e: + print(f"Exception in test_workflow_pause_resume: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_restart( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + workflow_client.terminate_workflow( + workflow_id, + reason="Integration test termination", + trigger_failure_workflow=False, + ) + workflow_status = workflow_client.get_workflow_status(workflow_id) + assert workflow_status.status == "TERMINATED" + + workflow_client.restart_workflow(workflow_id, use_latest_def=False) + + workflow_status = workflow_client.get_workflow_status(workflow_id) + assert workflow_status.status in ["RUNNING", "COMPLETED"] + + except Exception as e: + print(f"Exception in test_workflow_restart: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_rerun( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + original_workflow_id = None + rerun_workflow_id = None + try: + original_workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + workflow_client.terminate_workflow( + original_workflow_id, + reason="Integration test termination", + trigger_failure_workflow=False, + ) + workflow_status = workflow_client.get_workflow_status(original_workflow_id) + assert workflow_status.status == "TERMINATED" + + rerun_request = RerunWorkflowRequest( + correlation_id=f"rerun_correlation_{str(uuid.uuid4())[:8]}", + workflow_input={"rerun_param": "rerun_value"}, + ) + + rerun_workflow_id = workflow_client.rerun_workflow( + original_workflow_id, rerun_request + ) + + assert rerun_workflow_id is not None + assert isinstance(rerun_workflow_id, str) + assert rerun_workflow_id == original_workflow_id + + rerun_workflow = workflow_client.get_workflow(rerun_workflow_id) + assert rerun_workflow.workflow_id == rerun_workflow_id + + except Exception as e: + print(f"Exception in test_workflow_rerun: {str(e)}") + raise + finally: + for wf_id in [original_workflow_id, rerun_workflow_id]: + if wf_id: + try: + workflow_client.delete_workflow(wf_id, archive_workflow=True) + except Exception as e: + print(f"Warning: Failed to cleanup workflow {wf_id}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_retry( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + workflow_client.terminate_workflow( + workflow_id, + reason="Integration test termination", + trigger_failure_workflow=False, + ) + workflow_status = workflow_client.get_workflow_status(workflow_id) + assert workflow_status.status == "TERMINATED" + + workflow_client.retry_workflow(workflow_id, resume_subworkflow_tasks=False) + + workflow_status = workflow_client.get_workflow_status(workflow_id) + assert workflow_status.status in ["RUNNING", "COMPLETED"] + + except Exception as e: + print(f"Exception in test_workflow_retry: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_terminate( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + workflow_client.terminate_workflow( + workflow_id, + reason="Integration test termination", + trigger_failure_workflow=False, + ) + + workflow_status = workflow_client.get_workflow_status(workflow_id) + assert workflow_status.status == "TERMINATED" + + except Exception as e: + print(f"Exception in test_workflow_terminate: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_get_with_tasks( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + workflow_with_tasks = workflow_client.get_workflow( + workflow_id, include_tasks=True + ) + assert workflow_with_tasks.workflow_id == workflow_id + assert hasattr(workflow_with_tasks, "tasks") + + workflow_without_tasks = workflow_client.get_workflow( + workflow_id, include_tasks=False + ) + assert workflow_without_tasks.workflow_id == workflow_id + + except Exception as e: + print(f"Exception in test_workflow_get_with_tasks: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_status_with_options( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + status_with_output = workflow_client.get_workflow_status( + workflow_id, include_output=True, include_variables=True + ) + assert status_with_output.workflow_id == workflow_id + assert hasattr(status_with_output, "status") + + status_without_output = workflow_client.get_workflow_status( + workflow_id, include_output=False, include_variables=False + ) + assert status_without_output.workflow_id == workflow_id + + except Exception as e: + print(f"Exception in test_workflow_status_with_options: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_test( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + try: + test_request = WorkflowTestRequest( + name=test_workflow_name, + version=1, + input=simple_workflow_input, + correlation_id=f"test_correlation_{str(uuid.uuid4())[:8]}", + ) + + test_result = workflow_client.test_workflow(test_request) + + assert test_result is not None + assert hasattr(test_result, "workflow_id") + + except Exception as e: + print(f"Exception in test_workflow_test: {str(e)}") + raise + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_search( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + search_results = workflow_client.search( + start=0, + size=10, + free_text="*", + query=None, + ) + + assert search_results is not None + assert hasattr(search_results, "total_hits") + assert hasattr(search_results, "results") + + search_results_with_query = workflow_client.search( + start=0, + size=5, + free_text="*", + query=f"workflowType:{test_workflow_name}", + ) + + assert search_results_with_query is not None + + except Exception as e: + print(f"Exception in test_workflow_search: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_correlation_ids_batch( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_ids = [] + correlation_ids = [] + try: + for i in range(3): + correlation_id = f"batch_correlation_{i}_{str(uuid.uuid4())[:8]}" + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + correlationId=correlation_id, + ) + workflow_ids.append(workflow_id) + correlation_ids.append(correlation_id) + + batch_request = CorrelationIdsSearchRequest( + correlation_ids=correlation_ids, + workflow_names=[test_workflow_name], + ) + + batch_results = workflow_client.get_by_correlation_ids_in_batch( + batch_request=batch_request, + include_completed=False, + include_tasks=False, + ) + + assert batch_results is not None + assert isinstance(batch_results, dict) + + except Exception as e: + print(f"Exception in test_workflow_correlation_ids_batch: {str(e)}") + raise + finally: + for workflow_id in workflow_ids: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_correlation_ids_simple( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_ids = [] + correlation_ids = [] + try: + for i in range(2): + correlation_id = f"simple_correlation_{i}_{str(uuid.uuid4())[:8]}" + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + correlationId=correlation_id, + ) + workflow_ids.append(workflow_id) + correlation_ids.append(correlation_id) + + correlation_results = workflow_client.get_by_correlation_ids( + workflow_name=test_workflow_name, + correlation_ids=correlation_ids, + include_completed=False, + include_tasks=False, + ) + + assert correlation_results is not None + assert isinstance(correlation_results, dict) + + except Exception as e: + print(f"Exception in test_workflow_correlation_ids_simple: {str(e)}") + raise + finally: + for workflow_id in workflow_ids: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_update_variables( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + updated_variables = { + "updated_var1": "updated_value1", + "updated_var2": "updated_value2", + "number_var": 100, + "boolean_var": False, + } + + workflow_client.update_variables(workflow_id, updated_variables) + + workflow = workflow_client.get_workflow(workflow_id, include_tasks=True) + assert workflow.workflow_id == workflow_id + + except Exception as e: + print(f"Exception in test_workflow_update_variables: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_workflow_update_state( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + ) + + state_update = WorkflowStateUpdate( + task_reference_name="test_task_ref", + variables={"state_var1": "state_value1", "state_var2": "state_value2"}, + ) + + workflow_run = workflow_client.update_state( + workflow_id=workflow_id, + update_request=state_update, + wait_until_task_ref_names=["test_task_ref"], + wait_for_seconds=30, + ) + + assert workflow_run is not None + + except Exception as e: + print(f"Exception in test_workflow_update_state: {str(e)}") + raise + finally: + if workflow_id: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print( + f"Warning: Failed to cleanup workflow {workflow_id}: {str(e)}" + ) + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_concurrent_workflow_operations( + self, + workflow_client: OrkesWorkflowClient, + test_workflow_name: str, + simple_workflow_input: dict, + ): + try: + import threading + import time + + results = [] + errors = [] + created_workflows = [] + cleanup_lock = threading.Lock() + + def create_and_manage_workflow(workflow_suffix: str): + workflow_id = None + try: + workflow_id = workflow_client.start_workflow_by_name( + name=test_workflow_name, + input=simple_workflow_input, + version=1, + correlationId=f"concurrent_{workflow_suffix}", + ) + + with cleanup_lock: + created_workflows.append(workflow_id) + + time.sleep(0.1) + + workflow = workflow_client.get_workflow(workflow_id) + assert workflow.workflow_id == workflow_id + + workflow_status = workflow_client.get_workflow_status(workflow_id) + assert workflow_status.workflow_id == workflow_id + + if os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true": + try: + workflow_client.delete_workflow( + workflow_id, archive_workflow=True + ) + with cleanup_lock: + if workflow_id in created_workflows: + created_workflows.remove(workflow_id) + except Exception as cleanup_error: + print( + f"Warning: Failed to cleanup workflow {workflow_id} in thread: {str(cleanup_error)}" + ) + + results.append(f"workflow_{workflow_suffix}_success") + except Exception as e: + errors.append(f"workflow_{workflow_suffix}_error: {str(e)}") + if workflow_id and workflow_id not in created_workflows: + with cleanup_lock: + created_workflows.append(workflow_id) + + threads = [] + for i in range(3): + thread = threading.Thread( + target=create_and_manage_workflow, args=(f"{i}",) + ) + threads.append(thread) + thread.start() + + for thread in threads: + thread.join() + + assert ( + len(results) == 3 + ), f"Expected 3 successful operations, got {len(results)}. Errors: {errors}" + assert len(errors) == 0, f"Unexpected errors: {errors}" + + except Exception as e: + print(f"Exception in test_concurrent_workflow_operations: {str(e)}") + raise + finally: + for workflow_id in created_workflows: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print(f"Warning: Failed to delete workflow {workflow_id}: {str(e)}") + + @pytest.mark.v5_2_6 + @pytest.mark.v4_1_73 + def test_complex_workflow_management_flow( + self, + workflow_client: OrkesWorkflowClient, + metadata_client: OrkesMetadataClient, + test_suffix: str, + simple_workflow_task: WorkflowTask, + ): + created_resources = {"workflows": [], "workflow_defs": []} + + try: + workflow_types = { + "simple": {"param1": "value1", "param2": "value2"}, + "complex": { + "user_data": {"id": "user_123", "name": "Test User"}, + "order_data": {"items": [{"id": "item_1", "quantity": 2}]}, + }, + "batch": { + "batch_id": "batch_456", + "items": [ + {"id": f"item_{i}", "data": f"data_{i}"} for i in range(5) + ], + }, + } + + for workflow_type, input_data in workflow_types.items(): + workflow_name = f"complex_workflow_{workflow_type}_{test_suffix}" + + workflow_def = WorkflowDef( + name=workflow_name, + version=1, + description=f"Complex {workflow_type} workflow for testing", + tasks=[simple_workflow_task], + timeout_seconds=60, + timeout_policy="TIME_OUT_WF", + restartable=True, + owner_email="test@example.com", + ) + + metadata_client.register_workflow_def(workflow_def, overwrite=True) + created_resources["workflow_defs"].append((workflow_name, 1)) + + time.sleep(1) + + try: + retrieved_def = metadata_client.get_workflow_def(workflow_name) + assert retrieved_def.name == workflow_name + assert retrieved_def.version == 1 + except Exception as e: + print( + f"Warning: Could not verify workflow definition {workflow_name}: {str(e)}" + ) + + correlation_id = f"complex_{workflow_type}_{test_suffix}" + workflow_id = workflow_client.start_workflow_by_name( + name=workflow_name, + input=input_data, + version=1, + correlationId=correlation_id, + priority=0, + ) + created_resources["workflows"].append(workflow_id) + + workflow = workflow_client.get_workflow(workflow_id, include_tasks=True) + assert workflow.workflow_id == workflow_id + assert workflow.workflow_name == workflow_name + + workflow_status = workflow_client.get_workflow_status( + workflow_id, include_output=True, include_variables=True + ) + assert workflow_status.workflow_id == workflow_id + + search_results = workflow_client.search( + start=0, + size=20, + free_text="*", + query=f"correlationId:*{test_suffix}*", + ) + + assert search_results is not None + assert hasattr(search_results, "total_hits") + assert hasattr(search_results, "results") + + correlation_ids = [ + f"complex_{workflow_type}_{test_suffix}" + for workflow_type in workflow_types.keys() + ] + + batch_request = CorrelationIdsSearchRequest( + correlation_ids=correlation_ids, + workflow_names=[ + f"complex_workflow_simple_{test_suffix}", + f"complex_workflow_complex_{test_suffix}", + f"complex_workflow_batch_{test_suffix}", + ], + ) + + batch_results = workflow_client.get_by_correlation_ids_in_batch( + batch_request=batch_request, + include_completed=False, + include_tasks=False, + ) + + assert batch_results is not None + assert isinstance(batch_results, dict) + + for workflow_type in workflow_types.keys(): + workflow_name = f"complex_workflow_{workflow_type}_{test_suffix}" + correlation_id = f"complex_{workflow_type}_{test_suffix}" + correlation_results = workflow_client.get_by_correlation_ids( + workflow_name=workflow_name, + correlation_ids=[correlation_id], + include_completed=False, + include_tasks=False, + ) + + assert correlation_results is not None + assert isinstance(correlation_results, dict) + + except Exception as e: + print(f"Exception in test_complex_workflow_management_flow: {str(e)}") + raise + finally: + self._perform_comprehensive_cleanup( + workflow_client, metadata_client, created_resources, test_suffix + ) + + def _perform_comprehensive_cleanup( + self, + workflow_client: OrkesWorkflowClient, + metadata_client: OrkesMetadataClient, + created_resources: dict, + test_suffix: str, + ): + cleanup_enabled = os.getenv("CONDUCTOR_TEST_CLEANUP", "true").lower() == "true" + if not cleanup_enabled: + return + + for workflow_id in created_resources["workflows"]: + try: + workflow_client.delete_workflow(workflow_id, archive_workflow=True) + except Exception as e: + print(f"Warning: Failed to delete workflow {workflow_id}: {str(e)}") + + for workflow_name, version in created_resources.get("workflow_defs", []): + try: + metadata_client.unregister_workflow_def(workflow_name, version) + except Exception as e: + print( + f"Warning: Failed to delete workflow definition {workflow_name}: {str(e)}" + ) + + remaining_workflows = [] + for workflow_id in created_resources["workflows"]: + try: + workflow_client.get_workflow(workflow_id) + remaining_workflows.append(workflow_id) + except ApiException as e: + if e.code == 404: + pass + else: + remaining_workflows.append(workflow_id) + except Exception: + remaining_workflows.append(workflow_id) + + if remaining_workflows: + print( + f"Warning: {len(remaining_workflows)} workflows could not be verified as deleted: {remaining_workflows}" + ) diff --git a/tests/serdesertest/test_serdeser_action.py b/tests/serdesertest/test_serdeser_action.py index c2e1bbec..d94e1b61 100644 --- a/tests/serdesertest/test_serdeser_action.py +++ b/tests/serdesertest/test_serdeser_action.py @@ -3,12 +3,12 @@ import pytest -from conductor.client.http.models.action import Action -from conductor.client.http.models.start_workflow import StartWorkflow -from conductor.client.http.models.task_details import TaskDetails -from conductor.client.http.models.terminate_workflow import TerminateWorkflow +from conductor.client.http.models.action import ActionAdapter +from conductor.client.http.models.start_workflow import StartWorkflowAdapter +from conductor.client.http.models.task_details import TaskDetailsAdapter +from conductor.client.http.models.terminate_workflow import TerminateWorkflowAdapter from conductor.client.http.models.update_workflow_variables import ( - UpdateWorkflowVariables, + UpdateWorkflowVariablesAdapter, ) from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -35,21 +35,21 @@ def server_json(): def test_action_serdes(server_json): - action_obj = Action( + action_obj = ActionAdapter( action=server_json.get("action"), start_workflow=create_model_object( - StartWorkflow, server_json.get("start_workflow") + StartWorkflowAdapter, server_json.get("start_workflow") ), complete_task=create_model_object( - TaskDetails, server_json.get("complete_task") + TaskDetailsAdapter, server_json.get("complete_task") ), - fail_task=create_model_object(TaskDetails, server_json.get("fail_task")), + fail_task=create_model_object(TaskDetailsAdapter, server_json.get("fail_task")), expand_inline_json=server_json.get("expandInlineJSON"), terminate_workflow=create_model_object( - TerminateWorkflow, server_json.get("terminate_workflow") + TerminateWorkflowAdapter, server_json.get("terminate_workflow") ), update_workflow_variables=create_model_object( - UpdateWorkflowVariables, server_json.get("update_workflow_variables") + UpdateWorkflowVariablesAdapter, server_json.get("update_workflow_variables") ), ) assert server_json.get("action") == action_obj.action diff --git a/tests/serdesertest/test_serdeser_authorization_request.py b/tests/serdesertest/test_serdeser_authorization_request.py index 2df4ad20..caf50f83 100644 --- a/tests/serdesertest/test_serdeser_authorization_request.py +++ b/tests/serdesertest/test_serdeser_authorization_request.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.authorization_request import AuthorizationRequest +from conductor.client.http.models.authorization_request import AuthorizationRequestAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_serialization_deserialization(server_json): - auth_request = AuthorizationRequest( + auth_request = AuthorizationRequestAdapter( subject=server_json.get("subject"), target=server_json.get("target"), access=server_json.get("access"), diff --git a/tests/serdesertest/test_serdeser_bulk_response.py b/tests/serdesertest/test_serdeser_bulk_response.py index cae4d883..72bfec52 100644 --- a/tests/serdesertest/test_serdeser_bulk_response.py +++ b/tests/serdesertest/test_serdeser_bulk_response.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models import BulkResponse +from conductor.client.http.models.bulk_response import BulkResponseAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,12 +12,12 @@ def server_json_dict(): def test_bulk_response_serialization_deserialization(server_json_dict): - bulk_response = BulkResponse( + bulk_response = BulkResponseAdapter( bulk_error_results=server_json_dict["bulkErrorResults"], bulk_successful_results=server_json_dict["bulkSuccessfulResults"], message=server_json_dict["message"], ) - assert isinstance(bulk_response, BulkResponse) + assert isinstance(bulk_response, BulkResponseAdapter) assert isinstance(bulk_response.bulk_error_results, dict) assert isinstance(bulk_response.bulk_successful_results, list) for key, value in bulk_response.bulk_error_results.items(): @@ -53,7 +53,7 @@ def test_bulk_response_serialization_deserialization(server_json_dict): normalized_original = json.loads(json.dumps(server_json_dict, sort_keys=True)) normalized_result = json.loads(json.dumps(json_compatible_dict, sort_keys=True)) assert normalized_original == normalized_result - bulk_response_2 = BulkResponse( + bulk_response_2 = BulkResponseAdapter( bulk_error_results=result_dict["bulk_error_results"], bulk_successful_results=result_dict["bulk_successful_results"], message=server_json_dict["message"], @@ -62,18 +62,18 @@ def test_bulk_response_serialization_deserialization(server_json_dict): assert ( bulk_response.bulk_successful_results == bulk_response_2.bulk_successful_results ) - bulk_response_errors_only = BulkResponse(bulk_error_results={"id1": "error1"}) + bulk_response_errors_only = BulkResponseAdapter(bulk_error_results={"id1": "error1"}) assert bulk_response_errors_only.bulk_error_results == {"id1": "error1"} assert bulk_response_errors_only.bulk_successful_results == [] sample_successful_result = [{"value": "success1"}] - bulk_response_success_only = BulkResponse( + bulk_response_success_only = BulkResponseAdapter( bulk_successful_results=sample_successful_result ) assert bulk_response_success_only.bulk_error_results == {} assert ( bulk_response_success_only.bulk_successful_results == sample_successful_result ) - bulk_response_empty = BulkResponse( + bulk_response_empty = BulkResponseAdapter( bulk_error_results={}, bulk_successful_results=[] ) assert bulk_response_empty.bulk_error_results == {} diff --git a/tests/serdesertest/test_serdeser_conductor_application.py b/tests/serdesertest/test_serdeser_conductor_application.py index 7fb84ec5..165b2328 100644 --- a/tests/serdesertest/test_serdeser_conductor_application.py +++ b/tests/serdesertest/test_serdeser_conductor_application.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models import ConductorApplication +from conductor.client.http.models.conductor_application import ConductorApplicationAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_serialization_deserialization(server_json): - conductor_app = ConductorApplication( + conductor_app = ConductorApplicationAdapter( id=server_json.get("id"), name=server_json.get("name"), created_by=server_json.get("createdBy"), diff --git a/tests/serdesertest/test_serdeser_conductor_user.py b/tests/serdesertest/test_serdeser_conductor_user.py index ac4b74ab..84e55129 100644 --- a/tests/serdesertest/test_serdeser_conductor_user.py +++ b/tests/serdesertest/test_serdeser_conductor_user.py @@ -2,7 +2,9 @@ import pytest -from conductor.client.http.models import ConductorUser, Group, Role +from conductor.client.http.models.conductor_user import ConductorUserAdapter +from conductor.client.http.models.group import GroupAdapter +from conductor.client.http.models.role import RoleAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +14,7 @@ def server_json(): def test_conductor_user_serde(server_json): # noqa: PLR0915 - conductor_user = ConductorUser() + conductor_user = ConductorUserAdapter() conductor_user_dict = server_json if "id" in conductor_user_dict: conductor_user.id = conductor_user_dict["id"] @@ -21,13 +23,13 @@ def test_conductor_user_serde(server_json): # noqa: PLR0915 if "roles" in conductor_user_dict: roles_list = [] for _ in conductor_user_dict["roles"]: - role = Role() + role = RoleAdapter() roles_list.append(role) conductor_user.roles = roles_list if "groups" in conductor_user_dict: groups_list = [] for group_data in conductor_user_dict["groups"]: - group = Group() + group = GroupAdapter() groups_list.append(group) conductor_user.groups = groups_list if "uuid" in conductor_user_dict: diff --git a/tests/serdesertest/test_serdeser_correlation_ids_search_request.py b/tests/serdesertest/test_serdeser_correlation_ids_search_request.py index c71f0433..71d42eef 100644 --- a/tests/serdesertest/test_serdeser_correlation_ids_search_request.py +++ b/tests/serdesertest/test_serdeser_correlation_ids_search_request.py @@ -2,9 +2,7 @@ import pytest -from conductor.client.http.models.correlation_ids_search_request import ( - CorrelationIdsSearchRequest, -) +from conductor.client.http.models.correlation_ids_search_request import CorrelationIdsSearchRequestAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -21,13 +19,13 @@ def test_serdeser_correlation_ids_search_request(server_json): python_key = next( ( k - for k, v in CorrelationIdsSearchRequest.attribute_map.items() + for k, v in CorrelationIdsSearchRequestAdapter.attribute_map.items() if v == key ), key, ) python_format_json[python_key] = value - model_obj = CorrelationIdsSearchRequest(**python_format_json) + model_obj = CorrelationIdsSearchRequestAdapter(**python_format_json) assert model_obj.correlation_ids is not None assert isinstance(model_obj.correlation_ids, list) for item in model_obj.correlation_ids: diff --git a/tests/serdesertest/test_serdeser_create_or_update_application_request.py b/tests/serdesertest/test_serdeser_create_or_update_application_request.py index a024f608..948f0f74 100644 --- a/tests/serdesertest/test_serdeser_create_or_update_application_request.py +++ b/tests/serdesertest/test_serdeser_create_or_update_application_request.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models import CreateOrUpdateApplicationRequest +from conductor.client.http.models.create_or_update_application_request import CreateOrUpdateApplicationRequestAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -14,7 +14,7 @@ def server_json(): def test_deserialize_serialize(server_json): - model = CreateOrUpdateApplicationRequest() + model = CreateOrUpdateApplicationRequestAdapter() model_dict = server_json if "name" in model_dict: model.name = model_dict["name"] diff --git a/tests/serdesertest/test_serdeser_event_handler.py b/tests/serdesertest/test_serdeser_event_handler.py index 6d874773..90d9a5d1 100644 --- a/tests/serdesertest/test_serdeser_event_handler.py +++ b/tests/serdesertest/test_serdeser_event_handler.py @@ -2,8 +2,8 @@ import pytest -from conductor.client.http.models.action import Action -from conductor.client.http.models.event_handler import EventHandler +from conductor.client.http.models.action import ActionAdapter +from conductor.client.http.models.event_handler import EventHandlerAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -20,15 +20,15 @@ def test_deserialize_serialize(server_json): converted_action = {} for key, value in action_json.items(): python_attr = None - for attr, json_key in Action.attribute_map.items(): + for attr, json_key in ActionAdapter.attribute_map.items(): if json_key == key: python_attr = attr break if python_attr: converted_action[python_attr] = value - action = Action(**converted_action) + action = ActionAdapter(**converted_action) actions.append(action) - model = EventHandler( + model = EventHandlerAdapter( name=server_json.get("name"), event=server_json.get("event"), condition=server_json.get("condition"), @@ -45,7 +45,7 @@ def test_deserialize_serialize(server_json): assert len(model.actions) == len(server_json.get("actions", [])) if server_json.get("actions"): for action in model.actions: - assert isinstance(action, Action) + assert isinstance(action, ActionAdapter) result_json = model.to_dict() assert result_json.get("name") == server_json.get("name") assert result_json.get("event") == server_json.get("event") diff --git a/tests/serdesertest/test_serdeser_external_storage_location.py b/tests/serdesertest/test_serdeser_external_storage_location.py index 26302e10..14b70fde 100644 --- a/tests/serdesertest/test_serdeser_external_storage_location.py +++ b/tests/serdesertest/test_serdeser_external_storage_location.py @@ -2,9 +2,7 @@ import pytest -from conductor.client.http.models.external_storage_location import ( - ExternalStorageLocation, -) +from conductor.client.http.models.external_storage_location import ExternalStorageLocationAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -14,7 +12,7 @@ def server_json(): def test_external_storage_location_serde(server_json): - model = ExternalStorageLocation( + model = ExternalStorageLocationAdapter( uri=server_json.get("uri"), path=server_json.get("path") ) assert server_json.get("uri") == model.uri diff --git a/tests/serdesertest/test_serdeser_generate_token_request.py b/tests/serdesertest/test_serdeser_generate_token_request.py index 7bad2835..f2713188 100644 --- a/tests/serdesertest/test_serdeser_generate_token_request.py +++ b/tests/serdesertest/test_serdeser_generate_token_request.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.generate_token_request import GenerateTokenRequest +from conductor.client.http.models.generate_token_request import GenerateTokenRequestAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_generate_token_request_ser_des(server_json): - model_obj = GenerateTokenRequest( + model_obj = GenerateTokenRequestAdapter( key_id=server_json["keyId"], key_secret=server_json["keySecret"] ) assert model_obj.key_id == server_json["keyId"] @@ -24,8 +24,8 @@ def test_generate_token_request_ser_des(server_json): } assert serialized_json["keyId"] == server_json["keyId"] assert serialized_json["keySecret"] == server_json["keySecret"] - duplicate_obj = GenerateTokenRequest( + duplicate_obj = GenerateTokenRequestAdapter( key_id=server_json["keyId"], key_secret=server_json["keySecret"] ) assert model_obj == duplicate_obj - assert model_obj != GenerateTokenRequest(key_id="different", key_secret="values") + assert model_obj != GenerateTokenRequestAdapter(key_id="different", key_secret="values") diff --git a/tests/serdesertest/test_serdeser_group.py b/tests/serdesertest/test_serdeser_group.py index f2edaf6b..42dc1037 100644 --- a/tests/serdesertest/test_serdeser_group.py +++ b/tests/serdesertest/test_serdeser_group.py @@ -2,8 +2,8 @@ import pytest -from conductor.client.http.models.group import Group -from conductor.client.http.models.role import Role +from conductor.client.http.models.group import GroupAdapter +from conductor.client.http.models.role import RoleAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -13,10 +13,10 @@ def server_json(): def test_group_serde(server_json): - group = Group( + group = GroupAdapter( id=server_json.get("id"), description=server_json.get("description"), - roles=[Role(**role) for role in server_json.get("roles", [])], + roles=[RoleAdapter(**role) for role in server_json.get("roles", [])], default_access=server_json.get("defaultAccess"), ) assert server_json.get("id") == group.id @@ -25,7 +25,7 @@ def test_group_serde(server_json): assert group.roles is not None assert len(server_json.get("roles")) == len(group.roles) for i, role in enumerate(group.roles): - assert isinstance(role, Role) + assert isinstance(role, RoleAdapter) assert server_json.get("roles")[i].get("name") == role.name if server_json.get("defaultAccess"): assert group.default_access is not None @@ -35,7 +35,7 @@ def test_group_serde(server_json): result_dict = group.to_dict() camel_case_dict = {} for key, value in result_dict.items(): - json_key = Group.attribute_map.get(key, key) + json_key = GroupAdapter.attribute_map.get(key, key) camel_case_dict[json_key] = value for key in server_json.keys(): if key == "roles": @@ -48,7 +48,7 @@ def test_group_serde(server_json): assert server_json.get("roles")[i].get( role_key ) == role_dict.get( - Role.attribute_map.get( + RoleAdapter.attribute_map.get( role_key.replace("camelCase", "snake_case"), role_key ) ) diff --git a/tests/serdesertest/test_serdeser_integration.py b/tests/serdesertest/test_serdeser_integration.py index 424fc5db..801a8fda 100644 --- a/tests/serdesertest/test_serdeser_integration.py +++ b/tests/serdesertest/test_serdeser_integration.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.integration import Integration +from conductor.client.http.models.integration import IntegrationAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_integration_serdeser(server_json): - integration = Integration( + integration = IntegrationAdapter( category=server_json.get("category"), configuration=server_json.get("configuration"), created_by=server_json.get("createdBy"), diff --git a/tests/serdesertest/test_serdeser_integration_api.py b/tests/serdesertest/test_serdeser_integration_api.py index 1eee8ea9..7afcf3c5 100644 --- a/tests/serdesertest/test_serdeser_integration_api.py +++ b/tests/serdesertest/test_serdeser_integration_api.py @@ -2,8 +2,8 @@ import pytest -from conductor.client.http.models.integration_api import IntegrationApi -from conductor.client.http.models.tag_object import TagObject +from conductor.client.http.models.integration_api import IntegrationApiAdapter +from conductor.client.http.models.tag_object import TagObjectAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -13,7 +13,7 @@ def server_json(): def test_integration_api_serialization_deserialization(server_json): - integration_api = IntegrationApi( + integration_api = IntegrationApiAdapter( api=server_json.get("api"), configuration=server_json.get("configuration"), created_by=server_json.get("createdBy"), @@ -23,7 +23,7 @@ def test_integration_api_serialization_deserialization(server_json): integration_name=server_json.get("integrationName"), tags=( [ - TagObject(key=tag.get("key"), value=tag.get("value")) + TagObjectAdapter(key=tag.get("key"), value=tag.get("value")) for tag in server_json.get("tags", []) ] if server_json.get("tags") @@ -44,14 +44,14 @@ def test_integration_api_serialization_deserialization(server_json): if server_json.get("tags"): assert len(server_json.get("tags")) == len(integration_api.tags) for i, tag in enumerate(integration_api.tags): - assert isinstance(tag, TagObject) + assert isinstance(tag, TagObjectAdapter) assert server_json.get("tags")[i].get("key") == tag.key assert server_json.get("tags")[i].get("value") == tag.value serialized_json = integration_api.to_dict() for field in ["api", "description", "enabled"]: json_field = field - if field in IntegrationApi.attribute_map: - json_field = IntegrationApi.attribute_map[field] + if field in IntegrationApiAdapter.attribute_map: + json_field = IntegrationApiAdapter.attribute_map[field] assert server_json.get(json_field) == serialized_json.get(field) assert server_json.get("createdBy") == serialized_json.get("created_by") assert server_json.get("createdOn") == serialized_json.get("created_on") diff --git a/tests/serdesertest/test_serdeser_integration_def.py b/tests/serdesertest/test_serdeser_integration_def.py index d571054d..2d631ef2 100644 --- a/tests/serdesertest/test_serdeser_integration_def.py +++ b/tests/serdesertest/test_serdeser_integration_def.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.integration_def import IntegrationDef +from conductor.client.http.models.integration_def import IntegrationDefAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_serialization_deserialization(server_json): - integration_def = IntegrationDef( + integration_def = IntegrationDefAdapter( category=server_json["category"], category_label=server_json["categoryLabel"], configuration=server_json["configuration"], diff --git a/tests/serdesertest/test_serdeser_integration_update.py b/tests/serdesertest/test_serdeser_integration_update.py index e327c1eb..ca718e09 100644 --- a/tests/serdesertest/test_serdeser_integration_update.py +++ b/tests/serdesertest/test_serdeser_integration_update.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.integration_update import IntegrationUpdate +from conductor.client.http.models.integration_update import IntegrationUpdateAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_integration_update_serdes(server_json): - integration_update = IntegrationUpdate( + integration_update = IntegrationUpdateAdapter( category=server_json.get("category"), configuration=server_json.get("configuration"), description=server_json.get("description"), diff --git a/tests/serdesertest/test_serdeser_permission.py b/tests/serdesertest/test_serdeser_permission.py index 98f8918b..3ae2a460 100644 --- a/tests/serdesertest/test_serdeser_permission.py +++ b/tests/serdesertest/test_serdeser_permission.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.permission import Permission +from conductor.client.http.models.permission import PermissionAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_permission_serde(server_json): - permission_obj = Permission(name=server_json.get("name")) + permission_obj = PermissionAdapter(name=server_json.get("name")) assert permission_obj.name == server_json.get("name") serialized_json = permission_obj.to_dict() assert serialized_json.get("name") == server_json.get("name") diff --git a/tests/serdesertest/test_serdeser_poll_data.py b/tests/serdesertest/test_serdeser_poll_data.py index 778aa2df..dec6ca02 100644 --- a/tests/serdesertest/test_serdeser_poll_data.py +++ b/tests/serdesertest/test_serdeser_poll_data.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.poll_data import PollData +from conductor.client.http.models.poll_data import PollDataAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -14,7 +14,7 @@ def server_json(): def test_poll_data_serdes(server_json): # 1. Test deserialization from JSON to PollData object - poll_data = PollData( + poll_data = PollDataAdapter( queue_name=server_json.get("queueName"), domain=server_json.get("domain"), worker_id=server_json.get("workerId"), diff --git a/tests/serdesertest/test_serdeser_prompt_test_request.py b/tests/serdesertest/test_serdeser_prompt_test_request.py index 9ddac8e3..d2e9a559 100644 --- a/tests/serdesertest/test_serdeser_prompt_test_request.py +++ b/tests/serdesertest/test_serdeser_prompt_test_request.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.prompt_test_request import PromptTemplateTestRequest +from conductor.client.http.models.prompt_template_test_request import PromptTemplateTestRequestAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_prompt_template_test_request_serde(server_json): - model_obj = PromptTemplateTestRequest( + model_obj = PromptTemplateTestRequestAdapter( llm_provider=server_json.get("llmProvider"), model=server_json.get("model"), prompt=server_json.get("prompt"), diff --git a/tests/serdesertest/test_serdeser_rate_limit.py b/tests/serdesertest/test_serdeser_rate_limit.py index ad677151..51470b8e 100644 --- a/tests/serdesertest/test_serdeser_rate_limit.py +++ b/tests/serdesertest/test_serdeser_rate_limit.py @@ -3,7 +3,7 @@ import pytest -from conductor.client.http.models.rate_limit import RateLimit +from conductor.client.http.models.rate_limit import RateLimitAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -18,7 +18,7 @@ def camel_to_snake(name): def test_serialization_deserialization(server_json): - rate_limit = RateLimit( + rate_limit = RateLimitAdapter( rate_limit_key=server_json.get("rateLimitKey"), concurrent_exec_limit=server_json.get("concurrentExecLimit"), tag=server_json.get("tag"), diff --git a/tests/serdesertest/test_serdeser_rerun_workflow_request.py b/tests/serdesertest/test_serdeser_rerun_workflow_request.py index e74f3c83..1ead3c06 100644 --- a/tests/serdesertest/test_serdeser_rerun_workflow_request.py +++ b/tests/serdesertest/test_serdeser_rerun_workflow_request.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models import RerunWorkflowRequest +from conductor.client.http.models.rerun_workflow_request import RerunWorkflowRequestAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -13,7 +13,7 @@ def request_json(): @pytest.fixture def request_obj(request_json): - obj = RerunWorkflowRequest() + obj = RerunWorkflowRequestAdapter() obj.re_run_from_workflow_id = request_json["reRunFromWorkflowId"] obj.workflow_input = request_json["workflowInput"] obj.re_run_from_task_id = request_json["reRunFromTaskId"] diff --git a/tests/serdesertest/test_serdeser_role.py b/tests/serdesertest/test_serdeser_role.py index 8e9102b4..3dc2c21b 100644 --- a/tests/serdesertest/test_serdeser_role.py +++ b/tests/serdesertest/test_serdeser_role.py @@ -2,8 +2,8 @@ import pytest -from conductor.client.http.models.permission import Permission -from conductor.client.http.models.role import Role +from conductor.client.http.models.permission import PermissionAdapter +from conductor.client.http.models.role import RoleAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -16,10 +16,10 @@ def server_json(): def test_role_serialization_deserialization(server_json): """Test that Role objects can be properly serialized and deserialized.""" # 1. Test deserialization from server JSON to SDK model - role_obj = Role( + role_obj = RoleAdapter( name=server_json.get("name"), permissions=[ - Permission(**perm) if isinstance(perm, dict) else perm + PermissionAdapter(**perm) if isinstance(perm, dict) else perm for perm in server_json.get("permissions", []) ], ) diff --git a/tests/serdesertest/test_serdeser_save_schedule_request.py b/tests/serdesertest/test_serdeser_save_schedule_request.py index fa10b027..721624cf 100644 --- a/tests/serdesertest/test_serdeser_save_schedule_request.py +++ b/tests/serdesertest/test_serdeser_save_schedule_request.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.save_schedule_request import SaveScheduleRequest +from conductor.client.http.models.save_schedule_request import SaveScheduleRequestAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -61,7 +61,7 @@ def verify_json_match(result_json, original_json): def test_save_schedule_request_serde(server_json): - request = SaveScheduleRequest( + request = SaveScheduleRequestAdapter( name=server_json.get("name"), cron_expression=server_json.get("cronExpression"), run_catchup_schedule_instances=server_json.get("runCatchupScheduleInstances"), diff --git a/tests/serdesertest/test_serdeser_schema_def.py b/tests/serdesertest/test_serdeser_schema_def.py index f04ae1ba..e912b875 100644 --- a/tests/serdesertest/test_serdeser_schema_def.py +++ b/tests/serdesertest/test_serdeser_schema_def.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.schema_def import SchemaDef, SchemaType +from conductor.client.http.models.schema_def import SchemaDefAdapter, SchemaType from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_schema_def_serdes(server_json): - schema_def = SchemaDef( + schema_def = SchemaDefAdapter( name=server_json.get("name"), version=server_json.get("version"), type=SchemaType(server_json.get("type")) if server_json.get("type") else None, @@ -37,7 +37,7 @@ def test_schema_def_serdes(server_json): assert server_json.get("updatedBy") == schema_def.updated_by model_dict = schema_def.to_dict() model_json = {} - for attr, json_key in {**SchemaDef.attribute_map}.items(): + for attr, json_key in {**SchemaDefAdapter.attribute_map}.items(): value = model_dict.get(attr) if value is not None: if attr == "type" and value is not None: diff --git a/tests/serdesertest/test_serdeser_search_result_task.py b/tests/serdesertest/test_serdeser_search_result_task.py index 9de4bb37..643c2fec 100644 --- a/tests/serdesertest/test_serdeser_search_result_task.py +++ b/tests/serdesertest/test_serdeser_search_result_task.py @@ -2,8 +2,8 @@ import pytest -from conductor.client.http.models.search_result_task import SearchResultTask -from conductor.client.http.models.task import Task +from conductor.client.http.models.search_result_task import SearchResultTaskAdapter +from conductor.client.http.models.task import TaskAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -13,8 +13,8 @@ def server_json(): def test_search_result_task_ser_des(server_json): - task = Task() - search_result = SearchResultTask( + task = TaskAdapter() + search_result = SearchResultTaskAdapter( total_hits=server_json.get("totalHits"), results=[task] if server_json.get("results") else None, ) diff --git a/tests/serdesertest/test_serdeser_search_result_task_summary.py b/tests/serdesertest/test_serdeser_search_result_task_summary.py index 7093418d..0f54e61b 100644 --- a/tests/serdesertest/test_serdeser_search_result_task_summary.py +++ b/tests/serdesertest/test_serdeser_search_result_task_summary.py @@ -3,9 +3,9 @@ import pytest from conductor.client.http.models.search_result_task_summary import ( - SearchResultTaskSummary, + SearchResultTaskSummaryAdapter, ) -from conductor.client.http.models.task_summary import TaskSummary +from conductor.client.http.models.task_summary import TaskSummaryAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -17,9 +17,9 @@ def server_json(): def test_search_result_task_summary_serdeser(server_json): """Test serialization and deserialization of SearchResultTaskSummary""" - task_summary = TaskSummary() + task_summary = TaskSummaryAdapter() # 1. Test deserialization of server JSON into SDK model - model = SearchResultTaskSummary( + model = SearchResultTaskSummaryAdapter( total_hits=server_json.get("totalHits"), results=[task_summary] if server_json.get("results") else None, ) @@ -30,7 +30,7 @@ def test_search_result_task_summary_serdeser(server_json): for i, task_summary in enumerate(model.results): # Assuming TaskSummary has properties that correspond to the JSON fields # Add specific assertions for TaskSummary fields here - assert isinstance(task_summary, TaskSummary) + assert isinstance(task_summary, TaskSummaryAdapter) # 3. Test serialization back to JSON model_dict = model.to_dict() # 4. Verify the resulting JSON matches the original diff --git a/tests/serdesertest/test_serdeser_search_result_workflow.py b/tests/serdesertest/test_serdeser_search_result_workflow.py index 11ba713c..11523d65 100644 --- a/tests/serdesertest/test_serdeser_search_result_workflow.py +++ b/tests/serdesertest/test_serdeser_search_result_workflow.py @@ -2,8 +2,8 @@ import pytest -from conductor.client.http.models.search_result_workflow import SearchResultWorkflow -from conductor.client.http.models.workflow import Workflow +from conductor.client.http.models.search_result_workflow import SearchResultWorkflowAdapter +from conductor.client.http.models.workflow import WorkflowAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -13,19 +13,19 @@ def server_json(): def test_search_result_workflow_serde(server_json): - model = SearchResultWorkflow() + model = SearchResultWorkflowAdapter() if "totalHits" in server_json: model.total_hits = server_json["totalHits"] if server_json.get("results"): workflow_list = [] for workflow_json in server_json["results"]: - workflow = Workflow() + workflow = WorkflowAdapter() workflow_list.append(workflow) model.results = workflow_list assert model.total_hits is not None assert model.results is not None if model.results: - assert isinstance(model.results[0], Workflow) + assert isinstance(model.results[0], WorkflowAdapter) model_dict = model.to_dict() model_json = json.dumps(model_dict) deserialized_json = json.loads(model_json) diff --git a/tests/serdesertest/test_serdeser_search_result_workflow_schedule_execution_model.py b/tests/serdesertest/test_serdeser_search_result_workflow_schedule_execution_model.py index b9512459..91d40c0d 100644 --- a/tests/serdesertest/test_serdeser_search_result_workflow_schedule_execution_model.py +++ b/tests/serdesertest/test_serdeser_search_result_workflow_schedule_execution_model.py @@ -3,10 +3,10 @@ import pytest from conductor.client.http.models.search_result_workflow_schedule_execution_model import ( - SearchResultWorkflowScheduleExecutionModel, + SearchResultWorkflowScheduleExecutionModelAdapter, ) from conductor.client.http.models.workflow_schedule_execution_model import ( - WorkflowScheduleExecutionModel, + WorkflowScheduleExecutionModelAdapter, ) from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -17,8 +17,8 @@ def server_json(): def test_search_result_workflow_schedule_execution_model_serde(server_json): - work_flow_schedule_execution_model = WorkflowScheduleExecutionModel() - model = SearchResultWorkflowScheduleExecutionModel( + work_flow_schedule_execution_model = WorkflowScheduleExecutionModelAdapter() + model = SearchResultWorkflowScheduleExecutionModelAdapter( total_hits=server_json["totalHits"], results=( [work_flow_schedule_execution_model] if server_json.get("results") else None @@ -28,7 +28,7 @@ def test_search_result_workflow_schedule_execution_model_serde(server_json): assert len(model.results) == len(server_json["results"]) if model.results and len(model.results) > 0: sample_result = model.results[0] - assert isinstance(sample_result, WorkflowScheduleExecutionModel) + assert isinstance(sample_result, WorkflowScheduleExecutionModelAdapter) model_dict = model.to_dict() assert model_dict["total_hits"] == server_json["totalHits"] assert len(model_dict["results"]) == len(server_json["results"]) diff --git a/tests/serdesertest/test_serdeser_search_result_workflow_summary.py b/tests/serdesertest/test_serdeser_search_result_workflow_summary.py index 9596dc0d..f51b26f6 100644 --- a/tests/serdesertest/test_serdeser_search_result_workflow_summary.py +++ b/tests/serdesertest/test_serdeser_search_result_workflow_summary.py @@ -3,9 +3,9 @@ import pytest from conductor.client.http.models.search_result_workflow_summary import ( - SearchResultWorkflowSummary, + SearchResultWorkflowSummaryAdapter, ) -from conductor.client.http.models.workflow_summary import WorkflowSummary +from conductor.client.http.models.workflow_summary import WorkflowSummaryAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -15,8 +15,8 @@ def server_json(): def test_serialization_deserialization(server_json): - workflow_summary = WorkflowSummary() - model = SearchResultWorkflowSummary( + workflow_summary = WorkflowSummaryAdapter() + model = SearchResultWorkflowSummaryAdapter( total_hits=server_json.get("totalHits"), results=[workflow_summary] if server_json.get("results") else None, ) diff --git a/tests/serdesertest/test_serdeser_skip_task_request.py b/tests/serdesertest/test_serdeser_skip_task_request.py index 15c36f58..3ec36ab4 100644 --- a/tests/serdesertest/test_serdeser_skip_task_request.py +++ b/tests/serdesertest/test_serdeser_skip_task_request.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.skip_task_request import SkipTaskRequest +from conductor.client.http.models.skip_task_request import SkipTaskRequestAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -14,7 +14,7 @@ def server_json(): def test_skip_task_request_serde(server_json): # 1. Deserialize server JSON to model using constructor - model = SkipTaskRequest( + model = SkipTaskRequestAdapter( task_input=server_json.get("taskInput"), task_output=server_json.get("taskOutput"), ) diff --git a/tests/serdesertest/test_serdeser_start_workflow_request.py b/tests/serdesertest/test_serdeser_start_workflow_request.py index fd39b721..13faa1e4 100644 --- a/tests/serdesertest/test_serdeser_start_workflow_request.py +++ b/tests/serdesertest/test_serdeser_start_workflow_request.py @@ -1,10 +1,8 @@ import json import pytest -from conductor.client.http.models.start_workflow_request import ( - IdempotencyStrategy, - StartWorkflowRequest, -) +from conductor.client.http.models.start_workflow_request import StartWorkflowRequestAdapter +from conductor.shared.http.enums import IdempotencyStrategy from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -14,7 +12,7 @@ def server_json(): def test_deserialize_serialize_start_workflow_request(server_json): - workflow_request = StartWorkflowRequest( + workflow_request = StartWorkflowRequestAdapter( name=server_json.get("name"), version=server_json.get("version"), correlation_id=server_json.get("correlationId"), diff --git a/tests/serdesertest/test_serdeser_state_change_event.py b/tests/serdesertest/test_serdeser_state_change_event.py index 5beb1198..bffabb7a 100644 --- a/tests/serdesertest/test_serdeser_state_change_event.py +++ b/tests/serdesertest/test_serdeser_state_change_event.py @@ -4,7 +4,7 @@ from conductor.client.http.models.state_change_event import ( StateChangeConfig, - StateChangeEvent, + StateChangeEventAdapter, StateChangeEventType, ) from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -16,7 +16,7 @@ def state_change_event_json(): def test_state_change_event_serde(state_change_event_json): - event = StateChangeEvent( + event = StateChangeEventAdapter( type=state_change_event_json["type"], payload=state_change_event_json["payload"] ) assert event.type == state_change_event_json["type"] @@ -28,7 +28,7 @@ def test_state_change_event_serde(state_change_event_json): def test_state_change_config_multiple_event_types(): event_types = [StateChangeEventType.onStart, StateChangeEventType.onSuccess] - events = [StateChangeEvent(type="sample_type", payload={"key": "value"})] + events = [StateChangeEventAdapter(type="sample_type", payload={"key": "value"})] config = StateChangeConfig(event_type=event_types, events=events) assert config.type == "onStart,onSuccess" serialized_json = config.to_dict() diff --git a/tests/serdesertest/test_serdeser_sub_workflow_params.py b/tests/serdesertest/test_serdeser_sub_workflow_params.py index ccbd896f..93ce674f 100644 --- a/tests/serdesertest/test_serdeser_sub_workflow_params.py +++ b/tests/serdesertest/test_serdeser_sub_workflow_params.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.sub_workflow_params import SubWorkflowParams +from conductor.client.http.models.sub_workflow_params import SubWorkflowParamsAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_serialization_deserialization(server_json): - model_obj = SubWorkflowParams( + model_obj = SubWorkflowParamsAdapter( name=server_json["name"], version=server_json.get("version"), task_to_domain=server_json.get("taskToDomain"), diff --git a/tests/serdesertest/test_serdeser_subject_ref.py b/tests/serdesertest/test_serdeser_subject_ref.py index 1170b455..972f6903 100644 --- a/tests/serdesertest/test_serdeser_subject_ref.py +++ b/tests/serdesertest/test_serdeser_subject_ref.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.subject_ref import SubjectRef +from conductor.client.http.models.subject_ref import SubjectRefAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -14,7 +14,7 @@ def server_json(): def test_subject_ref_serdes(server_json): # 1. Deserialize server JSON into SDK model object - subject_ref = SubjectRef(type=server_json.get("type"), id=server_json.get("id")) + subject_ref = SubjectRefAdapter(type=server_json.get("type"), id=server_json.get("id")) # 2. Verify all fields are properly populated during deserialization assert subject_ref.type == server_json.get("type") assert subject_ref.id == server_json.get("id") diff --git a/tests/serdesertest/test_serdeser_tag.py b/tests/serdesertest/test_serdeser_tag.py new file mode 100644 index 00000000..8e7cc621 --- /dev/null +++ b/tests/serdesertest/test_serdeser_tag.py @@ -0,0 +1,44 @@ +import json + +import pytest + +from conductor.client.http.models.tag import TagAdapter, TypeEnum +from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver + + +@pytest.fixture +def server_json(): + server_json_str = JsonTemplateResolver.get_json_string("Tag") + return json.loads(server_json_str) + + +def test_tag_string_serde(server_json): + """Test serialization and deserialization of TagString model""" + # 1. Deserialize JSON into model object + tag_string = TagAdapter( + key=server_json.get("key"), + type=server_json.get("type"), + value=server_json.get("value"), + ) + # 2. Verify all fields are properly populated + assert server_json.get("key") == tag_string.key + assert server_json.get("type") == tag_string.type + assert server_json.get("value") == tag_string.value + # Specific enum validation if 'type' is present + if server_json.get("type"): + assert tag_string.type in [TypeEnum.METADATA.value, TypeEnum.RATE_LIMIT.value] + # 3. Serialize model back to JSON + model_dict = tag_string.to_dict() + model_json = json.dumps(model_dict) + model_dict_reloaded = json.loads(model_json) + # 4. Verify JSON matches the original + # Note: Only compare fields that were in the original JSON + for key in server_json: + assert server_json[key] == model_dict_reloaded[key] + # Create another instance using the dict and verify equality + reconstructed_tag = TagAdapter( + key=model_dict_reloaded.get("key"), + type=model_dict_reloaded.get("type"), + value=model_dict_reloaded.get("value"), + ) + assert tag_string == reconstructed_tag diff --git a/tests/serdesertest/test_serdeser_target_ref.py b/tests/serdesertest/test_serdeser_target_ref.py index 593afd8f..b2bc7cb6 100644 --- a/tests/serdesertest/test_serdeser_target_ref.py +++ b/tests/serdesertest/test_serdeser_target_ref.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.target_ref import TargetRef +from conductor.client.http.models.target_ref import TargetRefAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def server_json(): def test_target_ref_serdes(server_json): - target_ref = TargetRef(type=server_json.get("type"), id=server_json.get("id")) + target_ref = TargetRefAdapter(type=server_json.get("type"), id=server_json.get("id")) assert target_ref.type is not None assert target_ref.id is not None valid_types = [ @@ -30,7 +30,7 @@ def test_target_ref_serdes(server_json): assert server_json.get("id") == sdk_json.get("id") serialized_json = json.dumps(sdk_json) deserialized_json = json.loads(serialized_json) - round_trip_obj = TargetRef( + round_trip_obj = TargetRefAdapter( type=deserialized_json.get("type"), id=deserialized_json.get("id") ) assert target_ref.type == round_trip_obj.type diff --git a/tests/serdesertest/test_serdeser_task.py b/tests/serdesertest/test_serdeser_task.py index f6c8bc73..c55f0a20 100644 --- a/tests/serdesertest/test_serdeser_task.py +++ b/tests/serdesertest/test_serdeser_task.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.task import Task +from conductor.client.http.models.task import TaskAdapter from conductor.shared.http.enums import TaskResultStatus from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -12,7 +12,7 @@ def convert_to_snake_case(json_obj): python_obj = {} for key, value in json_obj.items(): snake_key = None - for python_key, json_key in Task.attribute_map.items(): + for python_key, json_key in TaskAdapter.attribute_map.items(): if json_key == key: snake_key = python_key break @@ -51,15 +51,15 @@ def server_json(): def test_task_serialization_deserialization(server_json): python_json = convert_to_snake_case(server_json) - task = Task(**python_json) - assert isinstance(task, Task) + task = TaskAdapter(**python_json) + assert isinstance(task, TaskAdapter) if "task_id" in python_json: assert task.task_id == python_json["task_id"] if "status" in python_json: assert task.status == python_json["status"] serialized_json = task.to_dict() - task2 = Task(**convert_to_snake_case(serialized_json)) - assert isinstance(task2, Task) + task2 = TaskAdapter(**convert_to_snake_case(serialized_json)) + assert isinstance(task2, TaskAdapter) task_result = task.to_task_result(TaskResultStatus.COMPLETED) assert task_result.task_id == task.task_id assert task_result.workflow_instance_id == task.workflow_instance_id diff --git a/tests/serdesertest/test_serdeser_task_def.py b/tests/serdesertest/test_serdeser_task_def.py index 37f99c25..6a5fa5b4 100644 --- a/tests/serdesertest/test_serdeser_task_def.py +++ b/tests/serdesertest/test_serdeser_task_def.py @@ -2,8 +2,8 @@ import pytest -from conductor.client.http.models.schema_def import SchemaDef -from conductor.client.http.models.task_def import TaskDef +from conductor.client.http.models.schema_def import SchemaDefAdapter +from conductor.client.http.models.task_def import TaskDefAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -35,7 +35,7 @@ def create_task_def_from_json(json_dict): input_schema_json = json_dict.get("inputSchema") input_schema_obj = None if input_schema_json: - input_schema_obj = SchemaDef( + input_schema_obj = SchemaDefAdapter( name=input_schema_json.get("name"), version=input_schema_json.get("version"), type=input_schema_json.get("type"), @@ -44,7 +44,7 @@ def create_task_def_from_json(json_dict): output_schema_json = json_dict.get("outputSchema") output_schema_obj = None if output_schema_json: - output_schema_obj = SchemaDef( + output_schema_obj = SchemaDefAdapter( name=output_schema_json.get("name"), version=output_schema_json.get("version"), type=output_schema_json.get("type"), @@ -53,7 +53,7 @@ def create_task_def_from_json(json_dict): enforce_schema = json_dict.get("enforceSchema", False) base_type = json_dict.get("baseType") total_timeout_seconds = json_dict.get("totalTimeoutSeconds") - return TaskDef( + return TaskDefAdapter( owner_app=owner_app, create_time=create_time, update_time=update_time, @@ -132,7 +132,7 @@ def verify_task_def_fields(task_def, json_dict): def compare_json_objects(original, result): - key_mapping = {json_key: attr for (attr, json_key) in TaskDef.attribute_map.items()} + key_mapping = {json_key: attr for (attr, json_key) in TaskDefAdapter.attribute_map.items()} for camel_key, orig_value in original.items(): if camel_key not in key_mapping: continue diff --git a/tests/serdesertest/test_serdeser_task_details.py b/tests/serdesertest/test_serdeser_task_details.py index 095417c6..05d582fa 100644 --- a/tests/serdesertest/test_serdeser_task_details.py +++ b/tests/serdesertest/test_serdeser_task_details.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.task_details import TaskDetails +from conductor.client.http.models.task_details import TaskDetailsAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -22,7 +22,7 @@ def test_task_details_serde(server_json): 4. The resulting JSON matches the original, ensuring no data is lost """ # 1. Deserialize JSON into TaskDetails object - task_details = TaskDetails( + task_details = TaskDetailsAdapter( workflow_id=server_json.get("workflowId"), task_ref_name=server_json.get("taskRefName"), output=server_json.get("output"), diff --git a/tests/serdesertest/test_serdeser_task_exec_log.py b/tests/serdesertest/test_serdeser_task_exec_log.py index b5a3f1e0..74ee0b51 100644 --- a/tests/serdesertest/test_serdeser_task_exec_log.py +++ b/tests/serdesertest/test_serdeser_task_exec_log.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.task_exec_log import TaskExecLog +from conductor.client.http.models.task_exec_log import TaskExecLogAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -17,7 +17,7 @@ def test_task_exec_log_serdeser(server_json): Test serialization and deserialization of TaskExecLog """ # 1. Deserialize JSON into SDK model object - task_exec_log = TaskExecLog( + task_exec_log = TaskExecLogAdapter( log=server_json.get("log"), task_id=server_json.get("taskId"), created_time=server_json.get("createdTime"), diff --git a/tests/serdesertest/test_serdeser_task_result.py b/tests/serdesertest/test_serdeser_task_result.py index 7a2e3e92..934653c0 100644 --- a/tests/serdesertest/test_serdeser_task_result.py +++ b/tests/serdesertest/test_serdeser_task_result.py @@ -2,8 +2,8 @@ import pytest -from conductor.client.http.models.task_exec_log import TaskExecLog -from conductor.client.http.models.task_result import TaskResult +from conductor.client.http.models.task_exec_log import TaskExecLogAdapter +from conductor.client.http.models.task_result import TaskResultAdapter from conductor.shared.http.enums import TaskResultStatus from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -16,7 +16,7 @@ def server_json_str(): def test_task_result_serdeser(server_json_str): # Step 1: Deserialize JSON into TaskResult object server_json_dict = json.loads(server_json_str) - task_result = TaskResult( + task_result = TaskResultAdapter( workflow_instance_id=server_json_dict.get("workflowInstanceId"), task_id=server_json_dict.get("taskId"), reason_for_incompletion=server_json_dict.get("reasonForIncompletion"), @@ -24,7 +24,7 @@ def test_task_result_serdeser(server_json_str): worker_id=server_json_dict.get("workerId"), status=server_json_dict.get("status"), output_data=server_json_dict.get("outputData"), - logs=[TaskExecLog(log.get("log")) for log in server_json_dict.get("logs", [])], + logs=[TaskExecLogAdapter(log=log.get("log")) for log in server_json_dict.get("logs", [])], external_output_payload_storage_path=server_json_dict.get( "externalOutputPayloadStoragePath" ), @@ -47,8 +47,8 @@ def test_task_result_serdeser(server_json_str): assert server_json_dict.get("workerId") == task_result.worker_id # Verify enum status is correctly converted if server_json_dict.get("status"): - assert isinstance(task_result.status, TaskResultStatus) - assert server_json_dict.get("status") == task_result.status.name + assert isinstance(task_result.status, str) + assert server_json_dict.get("status") == task_result.status # Verify output_data map assert server_json_dict.get("outputData") == task_result.output_data # Verify logs list @@ -79,7 +79,7 @@ def test_task_result_serdeser(server_json_str): assert server_json_dict.get("workerId") == serialized_json_dict.get("worker_id") # Check status - need to convert enum to string when comparing if server_json_dict.get("status"): - assert server_json_dict.get("status") == serialized_json_dict.get("status").name + assert server_json_dict.get("status") == serialized_json_dict.get("status") # Check output_data map assert server_json_dict.get("outputData") == serialized_json_dict.get("output_data") # Check logs list - in serialized version, logs are returned as dictionaries diff --git a/tests/serdesertest/test_serdeser_task_result_status.py b/tests/serdesertest/test_serdeser_task_result_status.py index 3389b748..daef10e9 100644 --- a/tests/serdesertest/test_serdeser_task_result_status.py +++ b/tests/serdesertest/test_serdeser_task_result_status.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.task_result import TaskResult +from conductor.client.http.models.task_result import TaskResultAdapter from conductor.shared.http.enums import TaskResultStatus from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -13,7 +13,7 @@ def server_json(): def test_task_result_serde(server_json): - task_result = TaskResult() + task_result = TaskResultAdapter() task_result.workflow_instance_id = server_json.get("workflowInstanceId") task_result.task_id = server_json.get("taskId") task_result.reason_for_incompletion = server_json.get("reasonForIncompletion") diff --git a/tests/serdesertest/test_serdeser_task_summary.py b/tests/serdesertest/test_serdeser_task_summary.py index 049c11af..4f2b3d14 100644 --- a/tests/serdesertest/test_serdeser_task_summary.py +++ b/tests/serdesertest/test_serdeser_task_summary.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.task_summary import TaskSummary +from conductor.client.http.models.task_summary import TaskSummaryAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -14,7 +14,7 @@ def server_json(): def test_task_summary_ser_deser(server_json): # 1. Deserialize JSON to TaskSummary object - task_summary = TaskSummary( + task_summary = TaskSummaryAdapter( workflow_id=server_json.get("workflowId"), workflow_type=server_json.get("workflowType"), correlation_id=server_json.get("correlationId"), @@ -86,5 +86,7 @@ def test_task_summary_ser_deser(server_json): parts = python_key.split("_") json_key = parts[0] + "".join(x.title() for x in parts[1:]) # Get the corresponding value from original JSON - assert json_key in server_json - assert python_value == server_json[json_key] + if json_key in server_json: + assert python_value == server_json[json_key] + else: + assert python_value == None diff --git a/tests/serdesertest/test_serdeser_terminate_workflow.py b/tests/serdesertest/test_serdeser_terminate_workflow.py index 438f7443..301009c5 100644 --- a/tests/serdesertest/test_serdeser_terminate_workflow.py +++ b/tests/serdesertest/test_serdeser_terminate_workflow.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.terminate_workflow import TerminateWorkflow +from conductor.client.http.models.terminate_workflow import TerminateWorkflowAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -17,7 +17,7 @@ def server_json(): def test_terminate_workflow_ser_des(server_json): """Test serialization and deserialization of TerminateWorkflow model.""" # 1. Verify server JSON can be correctly deserialized - model_obj = TerminateWorkflow( + model_obj = TerminateWorkflowAdapter( workflow_id=server_json["workflowId"], termination_reason=server_json["terminationReason"], ) @@ -27,11 +27,8 @@ def test_terminate_workflow_ser_des(server_json): # 3. Verify SDK model can be serialized back to JSON result_json = model_obj.to_dict() # 4. Verify resulting JSON matches original - assert server_json["workflowId"] == result_json["workflowId"] - assert server_json["terminationReason"] == result_json["terminationReason"] - # Verify no data loss by checking all keys exist - for key in server_json: - assert key in result_json + assert server_json["workflowId"] == result_json["workflow_id"] + assert server_json["terminationReason"] == result_json["termination_reason"] # Verify no extra keys were added assert len(server_json) == len(result_json) # Check string representation diff --git a/tests/serdesertest/test_serdeser_update_workflow_variables.py b/tests/serdesertest/test_serdeser_update_workflow_variables.py index a14ccbff..0c27fde5 100644 --- a/tests/serdesertest/test_serdeser_update_workflow_variables.py +++ b/tests/serdesertest/test_serdeser_update_workflow_variables.py @@ -3,7 +3,7 @@ import pytest from conductor.client.http.models.update_workflow_variables import ( - UpdateWorkflowVariables, + UpdateWorkflowVariablesAdapter, ) from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -25,7 +25,7 @@ def test_update_workflow_variables_serde(server_json): 4. The resulting JSON matches the original """ # 1. Deserialize JSON into model object - model = UpdateWorkflowVariables( + model = UpdateWorkflowVariablesAdapter( workflow_id=server_json.get("workflowId"), variables=server_json.get("variables"), append_array=server_json.get("appendArray"), @@ -41,6 +41,6 @@ def test_update_workflow_variables_serde(server_json): # 3. Serialize model back to JSON model_json = model.to_dict() # 4. Verify the resulting JSON matches the original - assert model_json.get("workflowId") == server_json.get("workflowId") + assert model_json.get("workflow_id") == server_json.get("workflowId") assert model_json.get("variables") == server_json.get("variables") - assert model_json.get("appendArray") == server_json.get("appendArray") + assert model_json.get("append_array") == server_json.get("appendArray") diff --git a/tests/serdesertest/test_serdeser_upsert_group_request.py b/tests/serdesertest/test_serdeser_upsert_group_request.py index 4996b0d6..418da7ce 100644 --- a/tests/serdesertest/test_serdeser_upsert_group_request.py +++ b/tests/serdesertest/test_serdeser_upsert_group_request.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.upsert_group_request import UpsertGroupRequest +from conductor.client.http.models.upsert_group_request import UpsertGroupRequestAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -14,7 +14,7 @@ def server_json(): def test_serde_upsert_group_request(server_json): # 1. Deserialize JSON into model object - model_obj = UpsertGroupRequest( + model_obj = UpsertGroupRequestAdapter( description=server_json.get("description"), roles=server_json.get("roles"), default_access=server_json.get("defaultAccess"), diff --git a/tests/serdesertest/test_serdeser_upsert_user_request.py b/tests/serdesertest/test_serdeser_upsert_user_request.py index b43c7ee3..82af7f23 100644 --- a/tests/serdesertest/test_serdeser_upsert_user_request.py +++ b/tests/serdesertest/test_serdeser_upsert_user_request.py @@ -4,7 +4,7 @@ from conductor.client.http.models.upsert_user_request import ( RolesEnum, - UpsertUserRequest, + UpsertUserRequestAdapter, ) from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -17,7 +17,7 @@ def server_json(): def test_upsert_user_request_serdeser(server_json): # 1. Deserialize JSON into model object - model_obj = UpsertUserRequest( + model_obj = UpsertUserRequestAdapter( name=server_json.get("name"), roles=server_json.get("roles"), groups=server_json.get("groups"), diff --git a/tests/serdesertest/test_serdeser_workflow.py b/tests/serdesertest/test_serdeser_workflow.py index 99090e19..53d18643 100644 --- a/tests/serdesertest/test_serdeser_workflow.py +++ b/tests/serdesertest/test_serdeser_workflow.py @@ -3,7 +3,9 @@ import pytest -from conductor.client.http.models import Task, Workflow, WorkflowDef +from conductor.client.http.models.task import TaskAdapter +from conductor.client.http.models.workflow import WorkflowAdapter +from conductor.client.http.models.workflow_def import WorkflowDefAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -48,7 +50,7 @@ def create_workflow_from_json(json_data): create_workflow_from_json(wf_json) for wf_json in json_data.get("history") ] # Create the workflow with all fields - return Workflow( + return WorkflowAdapter( owner_app=json_data.get("ownerApp"), create_time=json_data.get("createTime"), update_time=json_data.get("updateTime"), @@ -92,9 +94,9 @@ def create_workflow_from_json(json_data): def create_task_from_json(task_json): """Create a Task object from JSON""" # Create a Task object with fields from task_json - task = Task() + task = TaskAdapter() # Access all possible fields from task_json and set them on the task object - for py_field, json_field in Task.attribute_map.items(): + for py_field, json_field in TaskAdapter.attribute_map.items(): if json_field in task_json: setattr(task, py_field, task_json.get(json_field)) return task @@ -103,9 +105,9 @@ def create_task_from_json(task_json): def create_workflow_def_from_json(workflow_def_json): """Create a WorkflowDef object from JSON""" # Create a WorkflowDef object with fields from workflow_def_json - workflow_def = WorkflowDef() + workflow_def = WorkflowDefAdapter() # Access all possible fields from workflow_def_json and set them on the workflow_def object - for py_field, json_field in WorkflowDef.attribute_map.items(): + for py_field, json_field in WorkflowDefAdapter.attribute_map.items(): if json_field in workflow_def_json: # Special handling for nested objects or complex types could be added here setattr(workflow_def, py_field, workflow_def_json.get(json_field)) @@ -115,7 +117,7 @@ def create_workflow_def_from_json(workflow_def_json): def verify_workflow_fields(workflow, json_data): """Verify that all fields in the Workflow object match the JSON data""" # Check all fields defined in the model - for py_field, json_field in Workflow.attribute_map.items(): + for py_field, json_field in WorkflowAdapter.attribute_map.items(): if json_field in json_data: python_value = getattr(workflow, py_field) json_value = json_data.get(json_field) @@ -185,7 +187,7 @@ def compare_json_objects(original, result): ), f"Field {key} doesn't match" else: # Check if the attribute is defined in swagger_types but has a different JSON name - for py_field, json_field in Workflow.attribute_map.items(): + for py_field, json_field in WorkflowAdapter.attribute_map.items(): if json_field == key and py_field in result: if key in ["failedReferenceTaskNames", "failedTaskNames"]: if isinstance(original[key], list) and isinstance( diff --git a/tests/serdesertest/test_serdeser_workflow_def.py b/tests/serdesertest/test_serdeser_workflow_def.py index d8bd169b..2e99903a 100644 --- a/tests/serdesertest/test_serdeser_workflow_def.py +++ b/tests/serdesertest/test_serdeser_workflow_def.py @@ -2,8 +2,10 @@ import pytest -from conductor.client.http.models import RateLimit, WorkflowDef, WorkflowTask -from conductor.client.http.models.schema_def import SchemaDef +from conductor.client.http.models.rate_limit import RateLimitAdapter +from conductor.client.http.models.workflow_def import WorkflowDefAdapter +from conductor.client.http.models.workflow_task import WorkflowTaskAdapter +from conductor.client.http.models.schema_def import SchemaDefAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -40,7 +42,7 @@ def create_workflow_def_from_json(json_dict): tasks = [] if json_dict.get("tasks"): for task_json in json_dict["tasks"]: - task = WorkflowTask() + task = WorkflowTaskAdapter() # Map task properties if "name" in task_json: task.name = task_json.get("name") @@ -59,16 +61,17 @@ def create_workflow_def_from_json(json_dict): input_schema = None if json_dict.get("inputSchema"): schema_json = json_dict["inputSchema"] - input_schema = SchemaDef() + input_schema = SchemaDefAdapter() if "name" in schema_json: input_schema.name = schema_json.get("name") if "version" in schema_json: input_schema.version = schema_json.get("version") + # 3. Output Schema output_schema = None if json_dict.get("outputSchema"): schema_json = json_dict["outputSchema"] - output_schema = SchemaDef() + output_schema = SchemaDefAdapter() if "name" in schema_json: output_schema.name = schema_json.get("name") if "version" in schema_json: @@ -77,7 +80,7 @@ def create_workflow_def_from_json(json_dict): rate_limit_config = None if json_dict.get("rateLimitConfig"): rate_json = json_dict["rateLimitConfig"] - rate_limit_config = RateLimit() + rate_limit_config = RateLimitAdapter() if "rateLimitKey" in rate_json: rate_limit_config.rate_limit_key = rate_json.get("rateLimitKey") if "concurrentExecLimit" in rate_json: @@ -90,8 +93,9 @@ def create_workflow_def_from_json(json_dict): rate_limit_config.concurrent_execution_limit = rate_json.get( "concurrentExecutionLimit" ) + # Create the WorkflowDef with all parameters - workflow_def = WorkflowDef( + workflow_def = WorkflowDefAdapter( name=json_dict.get("name"), description=json_dict.get("description"), version=json_dict.get("version"), diff --git a/tests/serdesertest/test_serdeser_workflow_schedule.py b/tests/serdesertest/test_serdeser_workflow_schedule.py index 1da5f239..567618e1 100644 --- a/tests/serdesertest/test_serdeser_workflow_schedule.py +++ b/tests/serdesertest/test_serdeser_workflow_schedule.py @@ -2,9 +2,9 @@ import pytest -from conductor.client.http.models.start_workflow_request import StartWorkflowRequest -from conductor.client.http.models.tag_object import TagObject -from conductor.client.http.models.workflow_schedule import WorkflowSchedule +from conductor.client.http.models.start_workflow_request import StartWorkflowRequestAdapter +from conductor.client.http.models.tag_object import TagObjectAdapter +from conductor.client.http.models.workflow_schedule import WorkflowScheduleAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -16,7 +16,7 @@ def server_json(): def test_workflow_schedule_serialization(server_json): # 1. Test deserialization from server JSON to SDK model - schedule = WorkflowSchedule( + schedule = WorkflowScheduleAdapter( name=server_json.get("name"), cron_expression=server_json.get("cronExpression"), run_catchup_schedule_instances=server_json.get("runCatchupScheduleInstances"), @@ -35,7 +35,7 @@ def test_workflow_schedule_serialization(server_json): if "startWorkflowRequest" in server_json: start_req_json = server_json.get("startWorkflowRequest") if start_req_json: - start_req = StartWorkflowRequest( + start_req = StartWorkflowRequestAdapter( name=start_req_json.get("name"), version=start_req_json.get("version"), correlation_id=start_req_json.get("correlationId"), @@ -47,7 +47,7 @@ def test_workflow_schedule_serialization(server_json): if tags_json: tags = [] for tag_json in tags_json: - tag = TagObject(key=tag_json.get("key"), value=tag_json.get("value")) + tag = TagObjectAdapter(key=tag_json.get("key"), value=tag_json.get("value")) tags.append(tag) schedule.tags = tags # 2. Verify all fields are properly populated diff --git a/tests/serdesertest/test_serdeser_workflow_schedule_execution_model.py b/tests/serdesertest/test_serdeser_workflow_schedule_execution_model.py index d92ae844..1ca19d9a 100644 --- a/tests/serdesertest/test_serdeser_workflow_schedule_execution_model.py +++ b/tests/serdesertest/test_serdeser_workflow_schedule_execution_model.py @@ -3,7 +3,7 @@ import pytest from conductor.client.http.models.workflow_schedule_execution_model import ( - WorkflowScheduleExecutionModel, + WorkflowScheduleExecutionModelAdapter, ) from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -18,7 +18,7 @@ def server_json(): def test_workflow_schedule_execution_model_serdes(server_json): # 1. Deserialize JSON into model object - model = WorkflowScheduleExecutionModel( + model = WorkflowScheduleExecutionModelAdapter( execution_id=server_json.get("executionId"), schedule_name=server_json.get("scheduleName"), scheduled_time=server_json.get("scheduledTime"), diff --git a/tests/serdesertest/test_serdeser_workflow_state_update.py b/tests/serdesertest/test_serdeser_workflow_state_update.py index 19d783b3..8ef373b8 100644 --- a/tests/serdesertest/test_serdeser_workflow_state_update.py +++ b/tests/serdesertest/test_serdeser_workflow_state_update.py @@ -2,12 +2,11 @@ import pytest -from conductor.client.http.models import ( - TaskExecLog, - TaskResult, - WorkflowStateUpdate, -) +from conductor.client.http.models.task_exec_log import TaskExecLogAdapter +from conductor.client.http.models.task_result import TaskResultAdapter +from conductor.client.http.models.workflow_state_update import WorkflowStateUpdateAdapter from conductor.shared.http.enums import TaskResultStatus + from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -26,7 +25,7 @@ def test_serialization_deserialization(server_json): # noqa: PLR0915 # Create TaskExecLog objects if logs are present logs = ( [ - TaskExecLog( + TaskExecLogAdapter( log=log_entry.get("log"), created_time=log_entry.get("createdTime"), task_id=log_entry.get("taskId"), @@ -38,7 +37,7 @@ def test_serialization_deserialization(server_json): # noqa: PLR0915 ) # Create TaskResult object with proper field mappings - task_result = TaskResult( + task_result = TaskResultAdapter( workflow_instance_id=task_result_json.get("workflowInstanceId"), task_id=task_result_json.get("taskId"), reason_for_incompletion=task_result_json.get("reasonForIncompletion"), @@ -54,7 +53,7 @@ def test_serialization_deserialization(server_json): # noqa: PLR0915 extend_lease=task_result_json.get("extendLease"), ) # Now create the WorkflowStateUpdate object - model_object = WorkflowStateUpdate( + model_object = WorkflowStateUpdateAdapter( task_reference_name=server_json.get("taskReferenceName"), task_result=task_result, variables=server_json.get("variables"), @@ -65,11 +64,11 @@ def test_serialization_deserialization(server_json): # noqa: PLR0915 # Verify TaskResult fields assert model_object.task_result is not None # Check each field that exists in the JSON - for json_key, python_attr in TaskResult.attribute_map.items(): + for json_key, python_attr in TaskResultAdapter.attribute_map.items(): if python_attr in task_result_json: # Special handling for status field which is converted to enum if json_key == "status" and task_result_json.get("status"): - assert model_object.task_result.status.name == task_result_json.get( + assert model_object.task_result.status == task_result_json.get( "status" ) # Special handling for logs which are objects @@ -97,14 +96,14 @@ def test_serialization_deserialization(server_json): # noqa: PLR0915 # Step 4: Convert result_dict to match the original JSON structure serialized_json = {} # Map snake_case keys to camelCase based on attribute_map - for snake_key, camel_key in WorkflowStateUpdate.attribute_map.items(): + for snake_key, camel_key in WorkflowStateUpdateAdapter.attribute_map.items(): if snake_key in result_dict and result_dict[snake_key] is not None: if snake_key == "task_result" and result_dict[snake_key]: # Handle TaskResult conversion task_result_dict = result_dict[snake_key] serialized_task_result = {} # Map TaskResult fields using its attribute_map - for tr_snake_key, tr_camel_key in TaskResult.attribute_map.items(): + for tr_snake_key, tr_camel_key in TaskResultAdapter.attribute_map.items(): if ( tr_snake_key in task_result_dict and task_result_dict[tr_snake_key] is not None @@ -126,11 +125,11 @@ def test_serialization_deserialization(server_json): # noqa: PLR0915 serialized_log = {} for log_key, log_value in log_dict.items(): if ( - hasattr(TaskExecLog, "attribute_map") - and log_key in TaskExecLog.attribute_map + hasattr(TaskExecLogAdapter, "attribute_map") + and log_key in TaskExecLogAdapter.attribute_map ): serialized_log[ - TaskExecLog.attribute_map[log_key] + TaskExecLogAdapter.attribute_map[log_key] ] = log_value else: serialized_log[log_key] = log_value @@ -195,11 +194,11 @@ def test_serialization_deserialization(server_json): # noqa: PLR0915 # Check if this is a field that has a different name in snake_case # Find the snake_case equivalent for the log_key snake_case_found = False - if hasattr(TaskExecLog, "attribute_map"): + if hasattr(TaskExecLogAdapter, "attribute_map"): for ( snake_key, camel_key, - ) in TaskExecLog.attribute_map.items(): + ) in TaskExecLogAdapter.attribute_map.items(): if camel_key == log_key: # Found the snake_case key corresponding to this camel_case key if snake_key in serialized_log: diff --git a/tests/serdesertest/test_serdeser_workflow_status.py b/tests/serdesertest/test_serdeser_workflow_status.py index e8d30b7a..4bbf5084 100644 --- a/tests/serdesertest/test_serdeser_workflow_status.py +++ b/tests/serdesertest/test_serdeser_workflow_status.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.workflow_status import WorkflowStatus +from conductor.client.http.models.workflow_status import WorkflowStatusAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -14,7 +14,7 @@ def server_json(): def test_workflow_status_ser_des(server_json): # 1. Test deserialization from server JSON to SDK model - workflow_status = WorkflowStatus( + workflow_status = WorkflowStatusAdapter( workflow_id=server_json.get("workflowId"), correlation_id=server_json.get("correlationId"), output=server_json.get("output"), diff --git a/tests/serdesertest/test_serdeser_workflow_summary.py b/tests/serdesertest/test_serdeser_workflow_summary.py index 61d05b97..db2c29af 100644 --- a/tests/serdesertest/test_serdeser_workflow_summary.py +++ b/tests/serdesertest/test_serdeser_workflow_summary.py @@ -2,7 +2,7 @@ import pytest -from conductor.client.http.models.workflow_summary import WorkflowSummary +from conductor.client.http.models.workflow_summary import WorkflowSummaryAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -14,7 +14,7 @@ def server_json(): def test_workflow_summary_serde(server_json): # Test deserialization from JSON to SDK model - model = WorkflowSummary( + model = WorkflowSummaryAdapter( workflow_type=server_json.get("workflowType"), version=server_json.get("version"), workflow_id=server_json.get("workflowId"), @@ -50,7 +50,7 @@ def test_workflow_summary_serde(server_json): _verify_json_matches(json_dict, server_json) -def _verify_fields(model: WorkflowSummary, server_json): +def _verify_fields(model: WorkflowSummaryAdapter, server_json): """Verify all fields in the model are correctly populated.""" assert model.workflow_type == server_json.get("workflowType") assert model.version == server_json.get("version") @@ -84,7 +84,7 @@ def _verify_fields(model: WorkflowSummary, server_json): def _transform_to_json_format(python_dict): """Transform Python dict keys from snake_case to camelCase for JSON comparison.""" - attribute_map = WorkflowSummary.attribute_map + attribute_map = WorkflowSummaryAdapter.attribute_map result = {} for py_key, value in python_dict.items(): # Get the corresponding JSON key from attribute_map diff --git a/tests/serdesertest/test_serdeser_workflow_task.py b/tests/serdesertest/test_serdeser_workflow_task.py index 28d03abb..6cc8f847 100644 --- a/tests/serdesertest/test_serdeser_workflow_task.py +++ b/tests/serdesertest/test_serdeser_workflow_task.py @@ -1,6 +1,6 @@ import json -from conductor.client.http.models.workflow_task import WorkflowTask +from conductor.client.http.models.workflow_task import WorkflowTaskAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -40,11 +40,11 @@ def test_workflow_task_serde(): server_json = json.loads(server_json_str) mapped_kwargs = {} for json_key, value in server_json.items(): - for py_attr, mapped_json in WorkflowTask.attribute_map.items(): + for py_attr, mapped_json in WorkflowTaskAdapter.attribute_map.items(): if mapped_json == json_key: mapped_kwargs[py_attr] = value break - workflow_task = WorkflowTask(**mapped_kwargs) + workflow_task = WorkflowTaskAdapter(**mapped_kwargs) assert server_json.get("name") == workflow_task.name assert server_json.get("taskReferenceName") == workflow_task.task_reference_name if "joinOn" in server_json: @@ -54,7 +54,7 @@ def test_workflow_task_serde(): for key, value in result_dict.items(): if value is not None: camel_key = key - for py_attr, json_attr in WorkflowTask.attribute_map.items(): + for py_attr, json_attr in WorkflowTaskAdapter.attribute_map.items(): if py_attr == key: camel_key = json_attr break @@ -65,7 +65,7 @@ def test_workflow_task_serde(): if workflow_task.join_on is not None: assert "joinOn" in fixed_json_dict assert workflow_task.join_on == fixed_json_dict["joinOn"] - test_task = WorkflowTask(name="Test Task", task_reference_name="testRef") + test_task = WorkflowTaskAdapter(name="Test Task", task_reference_name="testRef") test_task.join_on = ["task1", "task2"] fixed_test_dict = workflow_task_to_json_dict(test_task) assert "joinOn" in fixed_test_dict diff --git a/tests/serdesertest/test_serdeser_workflow_test_request.py b/tests/serdesertest/test_serdeser_workflow_test_request.py index ab845e15..13af38cb 100644 --- a/tests/serdesertest/test_serdeser_workflow_test_request.py +++ b/tests/serdesertest/test_serdeser_workflow_test_request.py @@ -2,11 +2,11 @@ import pytest -from conductor.client.http.models.workflow_def import WorkflowDef +from conductor.client.http.models.workflow_def import WorkflowDefAdapter from conductor.client.http.models.workflow_test_request import ( - TaskMock, - WorkflowTestRequest, + WorkflowTestRequestAdapter, ) +from conductor.client.http.models.task_mock import TaskMockAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @@ -25,7 +25,7 @@ def snake_to_camel(snake_case): def test_workflow_test_request_serdes(server_json): # noqa: PLR0915 """Test serialization and deserialization of WorkflowTestRequest""" # 1. Deserialize JSON into SDK model object - workflow_test_request = WorkflowTestRequest( + workflow_test_request = WorkflowTestRequestAdapter( correlation_id=server_json.get("correlationId"), created_by=server_json.get("createdBy"), external_input_payload_storage_path=server_json.get( @@ -41,7 +41,7 @@ def test_workflow_test_request_serdes(server_json): # noqa: PLR0915 workflow_test_request.task_to_domain = server_json.get("taskToDomain") # Handle workflowDef object if present if "workflowDef" in server_json and server_json["workflowDef"] is not None: - workflow_def = WorkflowDef() + workflow_def = WorkflowDefAdapter() # Assuming there are fields in WorkflowDef that need to be populated workflow_test_request.workflow_def = workflow_def # Handle subWorkflowTestRequest if present @@ -49,7 +49,7 @@ def test_workflow_test_request_serdes(server_json): # noqa: PLR0915 sub_workflow_dict = {} for key, value in server_json["subWorkflowTestRequest"].items(): # Create a sub-request for each entry - sub_request = WorkflowTestRequest(name=value.get("name")) + sub_request = WorkflowTestRequestAdapter(name=value.get("name")) sub_workflow_dict[key] = sub_request workflow_test_request.sub_workflow_test_request = sub_workflow_dict # Handle taskRefToMockOutput if present @@ -58,7 +58,7 @@ def test_workflow_test_request_serdes(server_json): # noqa: PLR0915 for task_ref, mock_list in server_json["taskRefToMockOutput"].items(): task_mocks = [] for mock_data in mock_list: - task_mock = TaskMock( + task_mock = TaskMockAdapter( status=mock_data.get("status", "COMPLETED"), output=mock_data.get("output"), execution_time=mock_data.get("executionTime", 0), diff --git a/tests/unit/api_client/test_api_client_adapter.py b/tests/unit/api_client/test_api_client_adapter.py new file mode 100644 index 00000000..e9776aa8 --- /dev/null +++ b/tests/unit/api_client/test_api_client_adapter.py @@ -0,0 +1,228 @@ +import pytest +from unittest.mock import MagicMock, patch +from conductor.client.adapters.api_client_adapter import ApiClientAdapter +from conductor.client.codegen.rest import AuthorizationException, ApiException + + +@pytest.fixture +def mock_config(): + config = MagicMock() + config.host = "http://test.com" + return config + + +@pytest.fixture +def api_adapter(mock_config): + client_adapter = ApiClientAdapter() + client_adapter.configuration = mock_config + return client_adapter + + +def test_call_api_success(api_adapter): + mock_response = MagicMock() + api_adapter._ApiClientAdapter__call_api_no_retry = MagicMock( + return_value=mock_response + ) + + result = api_adapter._ApiClientAdapter__call_api( + resource_path="/test", + method="GET", + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_type=None, + auth_settings=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + ) + + assert result == mock_response + api_adapter._ApiClientAdapter__call_api_no_retry.assert_called_once() + + +def test_call_api_authorization_exception_expired_token(api_adapter): + mock_response = MagicMock() + mock_auth_exception = AuthorizationException(status=401, reason="Unauthorized") + mock_auth_exception._error_code = "EXPIRED_TOKEN" + api_adapter._ApiClientAdapter__call_api_no_retry = MagicMock( + side_effect=[mock_auth_exception, mock_response] + ) + api_adapter._ApiClientAdapter__force_refresh_auth_token = MagicMock() + + with patch("conductor.client.adapters.api_client_adapter.logger") as mock_logger: + result = api_adapter._ApiClientAdapter__call_api( + resource_path="/test", + method="GET", + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_type=None, + auth_settings=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + ) + + assert result == mock_response + assert api_adapter._ApiClientAdapter__call_api_no_retry.call_count == 2 + api_adapter._ApiClientAdapter__force_refresh_auth_token.assert_called_once() + mock_logger.warning.assert_called_once() + + +def test_call_api_authorization_exception_invalid_token(api_adapter): + mock_response = MagicMock() + mock_auth_exception = AuthorizationException(status=401, reason="Unauthorized") + mock_auth_exception._error_code = "INVALID_TOKEN" + api_adapter._ApiClientAdapter__call_api_no_retry = MagicMock( + side_effect=[mock_auth_exception, mock_response] + ) + api_adapter._ApiClientAdapter__force_refresh_auth_token = MagicMock() + + with patch("conductor.client.adapters.api_client_adapter.logger") as mock_logger: + result = api_adapter._ApiClientAdapter__call_api( + resource_path="/test", + method="GET", + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_type=None, + auth_settings=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + ) + + assert result == mock_response + assert api_adapter._ApiClientAdapter__call_api_no_retry.call_count == 2 + api_adapter._ApiClientAdapter__force_refresh_auth_token.assert_called_once() + mock_logger.warning.assert_called_once() + + +def test_call_api_authorization_exception_other(api_adapter): + mock_auth_exception = AuthorizationException(status=401, reason="Unauthorized") + mock_auth_exception._error_code = "OTHER_ERROR" + api_adapter._ApiClientAdapter__call_api_no_retry = MagicMock( + side_effect=mock_auth_exception + ) + + with pytest.raises(AuthorizationException): + api_adapter._ApiClientAdapter__call_api( + resource_path="/test", + method="GET", + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_type=None, + auth_settings=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + ) + + +def test_call_api_exception(api_adapter): + api_adapter._ApiClientAdapter__call_api_no_retry = MagicMock( + side_effect=ApiException(status=500, reason="Server Error") + ) + + with patch("conductor.client.adapters.api_client_adapter.logger") as mock_logger: + with pytest.raises(ApiException): + api_adapter._ApiClientAdapter__call_api( + resource_path="/test", + method="GET", + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_type=None, + auth_settings=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + ) + + mock_logger.error.assert_called_once() + + +def test_call_api_with_all_parameters(api_adapter): + mock_response = MagicMock() + api_adapter._ApiClientAdapter__call_api_no_retry = MagicMock( + return_value=mock_response + ) + + result = api_adapter._ApiClientAdapter__call_api( + resource_path="/test", + method="POST", + path_params={"id": "123"}, + query_params={"param": "value"}, + header_params={"Authorization": "Bearer token"}, + body={"data": "test"}, + post_params={"form": "data"}, + files={"file": "content"}, + response_type=dict, + auth_settings=["api_key"], + _return_http_data_only=True, + collection_formats={"param": "csv"}, + _preload_content=False, + _request_timeout=30, + ) + + assert result == mock_response + api_adapter._ApiClientAdapter__call_api_no_retry.assert_called_once_with( + resource_path="/test", + method="POST", + path_params={"id": "123"}, + query_params={"param": "value"}, + header_params={"Authorization": "Bearer token"}, + body={"data": "test"}, + post_params={"form": "data"}, + files={"file": "content"}, + response_type=dict, + auth_settings=["api_key"], + _return_http_data_only=True, + collection_formats={"param": "csv"}, + _preload_content=False, + _request_timeout=30, + ) + + +def test_call_api_debug_logging(api_adapter): + api_adapter._ApiClientAdapter__call_api_no_retry = MagicMock( + return_value=MagicMock() + ) + + with patch("conductor.client.adapters.api_client_adapter.logger") as mock_logger: + api_adapter._ApiClientAdapter__call_api( + resource_path="/test", + method="GET", + header_params={"Authorization": "Bearer token"}, + ) + + mock_logger.debug.assert_called_once() + call_args = mock_logger.debug.call_args[0] + assert ( + call_args[0] == "HTTP request method: %s; resource_path: %s; header_params: %s" + ) + assert call_args[1] == "GET" + assert call_args[2] == "/test" + assert call_args[3] == {"Authorization": "Bearer token"} diff --git a/tests/unit/asyncio_client/__init__.py b/tests/unit/asyncio_client/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/unit/asyncio_client/test_api_client_adapter.py b/tests/unit/asyncio_client/test_api_client_adapter.py new file mode 100644 index 00000000..aecde358 --- /dev/null +++ b/tests/unit/asyncio_client/test_api_client_adapter.py @@ -0,0 +1,280 @@ +import pytest +from unittest.mock import AsyncMock, MagicMock, patch +from conductor.asyncio_client.adapters.api_client_adapter import ApiClientAdapter +from conductor.asyncio_client.http.exceptions import ApiException +from conductor.asyncio_client.http.api_response import ApiResponse + + +@pytest.fixture +def mock_config(): + config = MagicMock() + config.host = "http://test.com" + config.api_key = {"api_key": "test_token"} + config.auth_key = "test_key" + config.auth_secret = "test_secret" + return config + + +@pytest.fixture +def adapter(mock_config): + client_adapter = ApiClientAdapter() + client_adapter.configuration = mock_config + client_adapter.rest_client = AsyncMock() + return client_adapter + + +def test_get_default(): + ApiClientAdapter._default = None + instance1 = ApiClientAdapter.get_default() + instance2 = ApiClientAdapter.get_default() + assert instance1 is instance2 + assert isinstance(instance1, ApiClientAdapter) + + +@pytest.mark.asyncio +async def test_call_api_success(adapter): + mock_response = MagicMock() + mock_response.status = 200 + adapter.rest_client.request = AsyncMock(return_value=mock_response) + + result = await adapter.call_api("GET", "http://test.com/api") + + assert result == mock_response + adapter.rest_client.request.assert_called_once() + + +@pytest.mark.asyncio +async def test_call_api_401_retry(adapter): + mock_response = MagicMock() + mock_response.status = 401 + adapter.rest_client.request = AsyncMock(return_value=mock_response) + adapter.refresh_authorization_token = AsyncMock(return_value="new_token") + + result = await adapter.call_api( + "GET", "http://test.com/api", {"X-Authorization": "old_token"} + ) + + assert result == mock_response + assert adapter.rest_client.request.call_count == 2 + assert adapter.refresh_authorization_token.called + + +@pytest.mark.asyncio +async def test_call_api_401_token_endpoint_no_retry(adapter): + mock_response = MagicMock() + mock_response.status = 401 + adapter.rest_client.request = AsyncMock(return_value=mock_response) + adapter.refresh_authorization_token = AsyncMock() + + result = await adapter.call_api("POST", "http://test.com/token") + + assert result == mock_response + adapter.rest_client.request.assert_called_once() + adapter.refresh_authorization_token.assert_not_called() + + +@pytest.mark.asyncio +async def test_call_api_exception(adapter): + adapter.rest_client.request = AsyncMock( + side_effect=ApiException(status=500, reason="Server Error") + ) + + with pytest.raises(ApiException): + await adapter.call_api("GET", "http://test.com/api") + + +def test_response_deserialize_success(adapter): + mock_response = MagicMock() + mock_response.data = b'{"test": "data"}' + mock_response.status = 200 + mock_response.getheader.return_value = "application/json; charset=utf-8" + mock_response.getheaders.return_value = {"content-type": "application/json"} + + response_types_map = {"200": "object"} + adapter.deserialize = MagicMock(return_value={"test": "data"}) + + result = adapter.response_deserialize(mock_response, response_types_map) + + assert isinstance(result, ApiResponse) + assert result.status_code == 200 + assert result.data == {"test": "data"} + + +def test_response_deserialize_bytearray(adapter): + mock_response = MagicMock() + mock_response.data = b"binary data" + mock_response.status = 200 + mock_response.getheaders.return_value = {} + + response_types_map = {"200": "bytearray"} + + result = adapter.response_deserialize(mock_response, response_types_map) + + assert result.data == b"binary data" + + +def test_response_deserialize_file(adapter): + mock_response = MagicMock() + mock_response.data = b"file content" + mock_response.status = 200 + mock_response.getheaders.return_value = {} + + response_types_map = {"200": "file"} + adapter._ApiClientAdapter__deserialize_file = MagicMock(return_value="file_object") + + result = adapter.response_deserialize(mock_response, response_types_map) + + assert result.data == "file_object" + + +def test_response_deserialize_with_xx_status(adapter): + mock_response = MagicMock() + mock_response.data = b'{"test": "data"}' + mock_response.status = 201 + mock_response.getheader.return_value = "application/json; charset=utf-8" + mock_response.getheaders.return_value = {"content-type": "application/json"} + + response_types_map = {"2XX": "object"} + adapter.deserialize = MagicMock(return_value={"test": "data"}) + + result = adapter.response_deserialize(mock_response, response_types_map) + + assert result.status_code == 201 + + +def test_response_deserialize_error_status(adapter): + mock_response = MagicMock() + mock_response.data = b'{"error": "message"}' + mock_response.status = 400 + mock_response.getheader.return_value = "application/json; charset=utf-8" + mock_response.getheaders.return_value = {"content-type": "application/json"} + + response_types_map = {"400": "object"} + adapter.deserialize = MagicMock(return_value={"error": "message"}) + + with pytest.raises(ApiException): + adapter.response_deserialize(mock_response, response_types_map) + + +def test_response_deserialize_no_data_assertion(adapter): + mock_response = MagicMock() + mock_response.data = None + + with pytest.raises(AssertionError) as exc_info: + adapter.response_deserialize(mock_response, {}) + + assert "RESTResponse.read() must be called" in str(exc_info.value) + + +@pytest.mark.asyncio +async def test_refresh_authorization_token(adapter): + mock_token_response = {"token": "new_token_value"} + adapter.obtain_new_token = AsyncMock(return_value=mock_token_response) + + result = await adapter.refresh_authorization_token() + + assert result == "new_token_value" + assert adapter.configuration.api_key["api_key"] == "new_token_value" + + +@pytest.mark.asyncio +async def test_obtain_new_token(adapter): + mock_response = MagicMock() + mock_response.data = b'{"token": "test_token"}' + mock_response.read = AsyncMock() + adapter.call_api = AsyncMock(return_value=mock_response) + adapter.param_serialize = MagicMock( + return_value=( + "POST", + "/token", + {}, + {"key_id": "test_key", "key_secret": "test_secret"}, + ) + ) + + result = await adapter.obtain_new_token() + + assert result == {"token": "test_token"} + adapter.call_api.assert_called_once() + mock_response.read.assert_called_once() + + +@pytest.mark.asyncio +async def test_obtain_new_token_with_patch(): + with patch( + "conductor.asyncio_client.adapters.api_client_adapter.GenerateTokenRequest" + ) as mock_generate_token: + mock_token_request = MagicMock() + mock_token_request.to_dict.return_value = { + "key_id": "test_key", + "key_secret": "test_secret", + } + mock_generate_token.return_value = mock_token_request + + client_adapter = ApiClientAdapter() + client_adapter.configuration = MagicMock() + client_adapter.configuration.auth_key = "test_key" + client_adapter.configuration.auth_secret = "test_secret" + client_adapter.param_serialize = MagicMock( + return_value=("POST", "/token", {}, {}) + ) + + mock_response = MagicMock() + mock_response.data = b'{"token": "test_token"}' + mock_response.read = AsyncMock() + client_adapter.call_api = AsyncMock(return_value=mock_response) + + result = await client_adapter.obtain_new_token() + + assert result == {"token": "test_token"} + mock_generate_token.assert_called_once_with( + key_id="test_key", key_secret="test_secret" + ) + + +def test_response_deserialize_encoding_detection(adapter): + mock_response = MagicMock() + mock_response.data = b'{"test": "data"}' + mock_response.status = 200 + mock_response.getheader.return_value = "application/json; charset=iso-8859-1" + mock_response.getheaders.return_value = {"content-type": "application/json"} + + response_types_map = {"200": "object"} + adapter.deserialize = MagicMock(return_value={"test": "data"}) + + result = adapter.response_deserialize(mock_response, response_types_map) + + assert result.status_code == 200 + adapter.deserialize.assert_called_once() + + +def test_response_deserialize_no_content_type(adapter): + mock_response = MagicMock() + mock_response.data = b'{"test": "data"}' + mock_response.status = 200 + mock_response.getheader.return_value = None + mock_response.getheaders.return_value = {} + + response_types_map = {"200": "object"} + adapter.deserialize = MagicMock(return_value={"test": "data"}) + + result = adapter.response_deserialize(mock_response, response_types_map) + + assert result.status_code == 200 + adapter.deserialize.assert_called_once() + + +def test_response_deserialize_no_match_content_type(adapter): + mock_response = MagicMock() + mock_response.data = b'{"test": "data"}' + mock_response.status = 200 + mock_response.getheader.return_value = "application/json" + mock_response.getheaders.return_value = {} + + response_types_map = {"200": "object"} + adapter.deserialize = MagicMock(return_value={"test": "data"}) + + result = adapter.response_deserialize(mock_response, response_types_map) + + assert result.status_code == 200 + adapter.deserialize.assert_called_once() diff --git a/tests/unit/asyncio_client/test_configuration.py b/tests/unit/asyncio_client/test_configuration.py new file mode 100644 index 00000000..a4be3d5c --- /dev/null +++ b/tests/unit/asyncio_client/test_configuration.py @@ -0,0 +1,431 @@ +import os +import logging +from unittest.mock import patch, MagicMock +import pytest + +from conductor.asyncio_client.configuration.configuration import Configuration + + +def test_initialization_default(): + config = Configuration() + assert config.server_url is not None + assert config.polling_interval == 100 + assert config.domain == "default_domain" + assert config.polling_interval_seconds == 0 + assert config.debug is False + + +def test_initialization_with_parameters(): + config = Configuration( + server_url="https://test.com/api", + auth_key="test_key", + auth_secret="test_secret", + debug=True, + polling_interval=200, + domain="test_domain", + polling_interval_seconds=5, + ) + assert config.server_url == "https://test.com/api" + assert config.auth_key == "test_key" + assert config.auth_secret == "test_secret" + assert config.debug is True + assert config.polling_interval == 200 + assert config.domain == "test_domain" + assert config.polling_interval_seconds == 5 + + +def test_initialization_with_env_vars(monkeypatch): + monkeypatch.setenv("CONDUCTOR_SERVER_URL", "https://env.com/api") + monkeypatch.setenv("CONDUCTOR_AUTH_KEY", "env_key") + monkeypatch.setenv("CONDUCTOR_AUTH_SECRET", "env_secret") + monkeypatch.setenv("CONDUCTOR_WORKER_POLL_INTERVAL", "300") + monkeypatch.setenv("CONDUCTOR_WORKER_DOMAIN", "env_domain") + monkeypatch.setenv("CONDUCTOR_WORKER_POLL_INTERVAL_SECONDS", "10") + + config = Configuration() + assert config.server_url == "https://env.com/api" + assert config.auth_key == "env_key" + assert config.auth_secret == "env_secret" + assert config.polling_interval == 300 + assert config.domain == "env_domain" + assert config.polling_interval_seconds == 10 + +def test_initialization_env_vars_override_params(monkeypatch): + monkeypatch.setenv("CONDUCTOR_SERVER_URL", "https://env.com/api") + monkeypatch.setenv("CONDUCTOR_AUTH_KEY", "env_key") + + config = Configuration(server_url="https://param.com/api", auth_key="param_key") + assert config.server_url == "https://param.com/api" + assert config.auth_key == "param_key" + + +def test_initialization_empty_server_url(): + config = Configuration(server_url="") + assert config.server_url == "http://localhost:8080/api" + + +def test_initialization_none_server_url(): + config = Configuration(server_url=None) + assert config.server_url is not None + + +def test_ui_host_default(): + config = Configuration(server_url="https://test.com/api") + assert config.ui_host == "https://test.com" + + +def test_ui_host_env_var(monkeypatch): + monkeypatch.setenv("CONDUCTOR_UI_SERVER_URL", "https://ui.com") + config = Configuration() + assert config.ui_host == "https://ui.com" + + +def test_get_env_int_valid(): + config = Configuration() + with patch.dict(os.environ, {"TEST_INT": "42"}): + result = config._get_env_int("TEST_INT", 10) + assert result == 42 + + +def test_get_env_int_invalid(): + config = Configuration() + with patch.dict(os.environ, {"TEST_INT": "invalid"}): + result = config._get_env_int("TEST_INT", 10) + assert result == 10 + + +def test_get_env_int_missing(): + config = Configuration() + with patch.dict(os.environ, {}, clear=True): + result = config._get_env_int("TEST_INT", 10) + assert result == 10 + + +def test_get_env_float_valid(): + config = Configuration() + with patch.dict(os.environ, {"TEST_FLOAT": "3.14"}): + result = config._get_env_float("TEST_FLOAT", 1.0) + assert result == 3.14 + + +def test_get_env_float_invalid(): + config = Configuration() + with patch.dict(os.environ, {"TEST_FLOAT": "invalid"}): + result = config._get_env_float("TEST_FLOAT", 1.0) + assert result == 1.0 + + +def test_get_worker_property_value_task_specific(monkeypatch): + monkeypatch.setenv("CONDUCTOR_WORKER_MYTASK_POLLING_INTERVAL", "500") + config = Configuration() + result = config.get_worker_property_value("polling_interval", "mytask") + assert result == 500.0 + + +def test_get_worker_property_value_global(monkeypatch): + monkeypatch.setenv("CONDUCTOR_WORKER_POLLING_INTERVAL", "600") + config = Configuration() + result = config.get_worker_property_value("polling_interval", "mytask") + assert result == 600.0 + + +def test_get_worker_property_value_default(): + config = Configuration() + result = config.get_worker_property_value("polling_interval", "mytask") + assert result == 100 + + +def test_get_worker_property_value_domain(): + config = Configuration() + result = config.get_worker_property_value("domain", "mytask") + assert result == "default_domain" + + +def test_get_worker_property_value_poll_interval_seconds(): + config = Configuration() + result = config.get_worker_property_value("poll_interval_seconds", "mytask") + assert result == 0 + + +def test_convert_property_value_polling_interval(): + config = Configuration() + result = config._convert_property_value("polling_interval", "250") + assert result == 250.0 + + +def test_convert_property_value_polling_interval_invalid(): + config = Configuration() + result = config._convert_property_value("polling_interval", "invalid") + assert result == 100 + + +def test_convert_property_value_polling_interval_seconds(): + config = Configuration() + result = config._convert_property_value("polling_interval_seconds", "5") + assert result == 5.0 + + +def test_convert_property_value_polling_interval_seconds_invalid(): + config = Configuration() + result = config._convert_property_value("polling_interval_seconds", "invalid") + assert result == 0 + + +def test_convert_property_value_string(): + config = Configuration() + result = config._convert_property_value("domain", "test_domain") + assert result == "test_domain" + + +def test_set_worker_property(): + config = Configuration() + config.set_worker_property("mytask", "polling_interval", 300) + assert config._worker_properties["mytask"]["polling_interval"] == 300 + + +def test_set_worker_property_multiple(): + config = Configuration() + config.set_worker_property("mytask", "polling_interval", 300) + config.set_worker_property("mytask", "domain", "test_domain") + assert config._worker_properties["mytask"]["polling_interval"] == 300 + assert config._worker_properties["mytask"]["domain"] == "test_domain" + + +def test_get_worker_property(): + config = Configuration() + config.set_worker_property("mytask", "polling_interval", 300) + result = config.get_worker_property("mytask", "polling_interval") + assert result == 300 + + +def test_get_worker_property_not_found(): + config = Configuration() + result = config.get_worker_property("mytask", "polling_interval") + assert result is None + + +def test_get_polling_interval_with_task_type(monkeypatch): + monkeypatch.setenv("CONDUCTOR_WORKER_MYTASK_POLLING_INTERVAL", "400") + config = Configuration() + result = config.get_polling_interval("mytask") + assert result == 400.0 + + +def test_get_polling_interval_default(): + config = Configuration() + result = config.get_polling_interval("mytask") + assert result == 100.0 + + +def test_get_domain_with_task_type(monkeypatch): + monkeypatch.setenv("CONDUCTOR_WORKER_MYTASK_DOMAIN", "task_domain") + config = Configuration() + result = config.get_domain("mytask") + assert result == "task_domain" + + +def test_get_domain_default(): + config = Configuration() + result = config.get_domain("mytask") + assert result == "default_domain" + + +def test_get_poll_interval_with_task_type(monkeypatch): + monkeypatch.setenv("CONDUCTOR_WORKER_MYTASK_POLLING_INTERVAL", "500") + config = Configuration() + result = config.get_poll_interval("mytask") + assert result == 500 + + +def test_get_poll_interval_default(): + config = Configuration() + result = config.get_poll_interval("mytask") + assert result == 100 + + +def test_get_poll_interval_seconds(): + config = Configuration() + result = config.get_poll_interval_seconds() + assert result == 0 + + +def test_host_property(): + config = Configuration(server_url="https://test.com/api") + assert config.host == "https://test.com/api" + + +def test_host_setter(): + config = Configuration() + config.host = "https://new.com/api" + assert config.host == "https://new.com/api" + + +def test_debug_property(): + config = Configuration(debug=True) + assert config.debug is True + + +def test_debug_setter(): + config = Configuration() + config.debug = True + assert config.debug is True + + +def test_api_key_property(): + config = Configuration() + config.api_key = {"test": "value"} + assert config.api_key == {"test": "value"} + + +def test_api_key_prefix_property(): + config = Configuration() + config.api_key_prefix = {"test": "prefix"} + assert config.api_key_prefix == {"test": "prefix"} + + +def test_username_property(): + config = Configuration() + config.username = "testuser" + assert config.username == "testuser" + + +def test_password_property(): + config = Configuration() + config.password = "testpass" + assert config.password == "testpass" + + +def test_access_token_property(): + config = Configuration() + config.access_token = "testtoken" + assert config.access_token == "testtoken" + + +def test_verify_ssl_property(): + config = Configuration() + config.verify_ssl = False + assert config.verify_ssl is False + + +def test_ssl_ca_cert_property(): + config = Configuration() + config.ssl_ca_cert = "/path/to/cert" + assert config.ssl_ca_cert == "/path/to/cert" + + +def test_retries_property(): + config = Configuration() + config.retries = 5 + assert config.retries == 5 + + +def test_logger_format_property(): + config = Configuration() + config.logger_format = "%(message)s" + assert config.logger_format == "%(message)s" + + +def test_log_level_property(): + config = Configuration(debug=True) + assert config.log_level == logging.DEBUG + + +def test_apply_logging_config(): + config = Configuration() + config.apply_logging_config() + assert config.is_logger_config_applied is True + + +def test_apply_logging_config_custom(): + config = Configuration() + config.apply_logging_config(log_format="%(message)s", level=logging.ERROR) + assert config.is_logger_config_applied is True + + +def test_apply_logging_config_already_applied(): + config = Configuration() + config.apply_logging_config() + config.apply_logging_config() + assert config.is_logger_config_applied is True + + +def test_get_logging_formatted_name(): + result = Configuration.get_logging_formatted_name("test_logger") + assert result.startswith("[pid:") + assert result.endswith("] test_logger") + + +def test_ui_host_property(): + config = Configuration(server_url="https://test.com/api") + assert config.ui_host == "https://test.com" + + +def test_getattr_delegation(): + config = Configuration() + mock_config = MagicMock() + config._http_config = mock_config + mock_config.test_attr = "test_value" + + result = config.test_attr + assert result == "test_value" + + +def test_getattr_no_http_config(): + config = Configuration() + config._http_config = None + + with pytest.raises(AttributeError): + _ = config.nonexistent_attr + + +def test_auth_setup_with_credentials(): + config = Configuration(auth_key="key", auth_secret="secret") + assert "api_key" in config.api_key + assert config.api_key["api_key"] == "key" + + +def test_worker_properties_dict_initialization(): + config = Configuration() + assert isinstance(config._worker_properties, dict) + assert len(config._worker_properties) == 0 + + +def test_get_worker_property_value_unknown_property(): + config = Configuration() + result = config.get_worker_property_value("unknown_property", "mytask") + assert result is None + + +def test_get_poll_interval_with_task_type_none_value(): + config = Configuration() + with patch.dict( + os.environ, {"CONDUCTOR_WORKER_MYTASK_POLLING_INTERVAL": "invalid"} + ): + result = config.get_poll_interval("mytask") + assert result == 100 + + +def test_host_property_no_http_config(): + config = Configuration() + config._http_config = None + config._host = "test_host" + assert config.host == "test_host" + + +def test_debug_setter_false(): + config = Configuration(debug=True) + config.debug = False + assert config.debug is False + + +def test_get_poll_interval_with_task_type_none(): + config = Configuration() + result = config.get_poll_interval("mytask") + assert result == 100 + + +def test_get_poll_interval_task_type_provided_but_value_none(): + config = Configuration() + with patch.dict(os.environ, {"CONDUCTOR_WORKER_MYTASK_POLLING_INTERVAL": ""}): + result = config.get_poll_interval("mytask") + assert result == 100 diff --git a/tests/unit/asyncio_client/test_rest_adapter.py b/tests/unit/asyncio_client/test_rest_adapter.py new file mode 100644 index 00000000..fb4fef74 --- /dev/null +++ b/tests/unit/asyncio_client/test_rest_adapter.py @@ -0,0 +1,749 @@ +from unittest.mock import Mock, patch +import pytest +import httpx +from httpx import Response, RequestError, HTTPStatusError, TimeoutException + +from conductor.client.adapters.rest_adapter import RESTResponse, RESTClientObjectAdapter +from conductor.client.codegen.rest import ApiException, AuthorizationException + + +def test_rest_response_initialization(): + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {"Content-Type": "application/json"} + mock_response.content = b'{"test": "data"}' + mock_response.text = '{"test": "data"}' + mock_response.url = "https://example.com/api" + mock_response.http_version = "HTTP/1.1" + + rest_response = RESTResponse(mock_response) + + assert rest_response.status == 200 + assert rest_response.reason == "OK" + assert rest_response.headers == {"Content-Type": "application/json"} + assert rest_response.data == b'{"test": "data"}' + assert rest_response.text == '{"test": "data"}' + assert rest_response.http_version == "HTTP/1.1" + + +def test_rest_response_getheaders(): + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {"Content-Type": "application/json", "Server": "nginx"} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + rest_response = RESTResponse(mock_response) + headers = rest_response.getheaders() + + assert headers == {"Content-Type": "application/json", "Server": "nginx"} + + +def test_rest_response_getheader(): + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {"Content-Type": "application/json", "Server": "nginx"} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + rest_response = RESTResponse(mock_response) + + assert rest_response.getheader("Content-Type") == "application/json" + assert rest_response.getheader("Server") == "nginx" + assert rest_response.getheader("Non-Existent") is None + assert rest_response.getheader("Non-Existent", "default") == "default" + + +def test_rest_response_is_http2(): + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/2" + + rest_response = RESTResponse(mock_response) + + assert rest_response.is_http2() is True + + mock_response.http_version = "HTTP/1.1" + assert rest_response.is_http2() is False + + +def test_rest_response_http_version_unknown(): + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + del mock_response.http_version + + rest_response = RESTResponse(mock_response) + + assert rest_response.http_version == "Unknown" + assert rest_response.is_http2() is False + + +def test_rest_client_object_adapter_initialization(): + adapter = RESTClientObjectAdapter() + + assert adapter.connection is not None + assert isinstance(adapter.connection, httpx.Client) + + +def test_rest_client_object_adapter_initialization_with_connection(): + mock_connection = Mock(spec=httpx.Client) + adapter = RESTClientObjectAdapter(connection=mock_connection) + + assert adapter.connection == mock_connection + + +def test_rest_client_object_adapter_close(): + mock_connection = Mock(spec=httpx.Client) + adapter = RESTClientObjectAdapter(connection=mock_connection) + + adapter.close() + mock_connection.close.assert_called_once() + + +def test_rest_client_object_adapter_close_no_connection(): + adapter = RESTClientObjectAdapter() + adapter.connection = None + + adapter.close() + + +@patch("conductor.client.adapters.rest_adapter.logger") +def test_check_http2_support_success(mock_logger): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/2" + + with patch.object(adapter, "GET", return_value=RESTResponse(mock_response)): + result = adapter.check_http2_support("https://example.com") + + assert result is True + mock_logger.info.assert_called() + + +@patch("conductor.client.adapters.rest_adapter.logger") +def test_check_http2_support_failure(mock_logger): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter, "GET", return_value=RESTResponse(mock_response)): + result = adapter.check_http2_support("https://example.com") + + assert result is False + mock_logger.info.assert_called() + + +@patch("conductor.client.adapters.rest_adapter.logger") +def test_check_http2_support_exception(mock_logger): + adapter = RESTClientObjectAdapter() + + with patch.object(adapter, "GET", side_effect=Exception("Connection failed")): + result = adapter.check_http2_support("https://example.com") + + assert result is False + mock_logger.error.assert_called() + + +def test_request_get_success(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + response = adapter.request("GET", "https://example.com") + + assert isinstance(response, RESTResponse) + assert response.status == 200 + + +def test_request_post_with_json_body(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 201 + mock_response.reason_phrase = "Created" + mock_response.headers = {} + mock_response.content = b'{"id": 123}' + mock_response.text = '{"id": 123}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + response = adapter.request( + "POST", "https://example.com", body={"name": "test", "value": 42} + ) + + assert isinstance(response, RESTResponse) + assert response.status == 201 + + +def test_request_post_with_string_body(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 201 + mock_response.reason_phrase = "Created" + mock_response.headers = {} + mock_response.content = b'{"id": 123}' + mock_response.text = '{"id": 123}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + response = adapter.request("POST", "https://example.com", body="test string") + + assert isinstance(response, RESTResponse) + assert response.status == 201 + + +def test_request_post_with_bytes_body(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 201 + mock_response.reason_phrase = "Created" + mock_response.headers = {} + mock_response.content = b'{"id": 123}' + mock_response.text = '{"id": 123}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + response = adapter.request("POST", "https://example.com", body=b"test bytes") + + assert isinstance(response, RESTResponse) + assert response.status == 201 + + +def test_request_with_query_params(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + response = adapter.request( + "GET", "https://example.com", query_params={"page": 1, "limit": 10} + ) + + assert isinstance(response, RESTResponse) + assert response.status == 200 + + +def test_request_with_headers(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + response = adapter.request( + "GET", "https://example.com", headers={"Authorization": "Bearer token"} + ) + + assert isinstance(response, RESTResponse) + assert response.status == 200 + + +def test_request_with_post_params(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + response = adapter.request( + "POST", + "https://example.com", + post_params={"field1": "value1", "field2": "value2"}, + ) + + assert isinstance(response, RESTResponse) + assert response.status == 200 + + +def test_request_with_custom_timeout(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + response = adapter.request("GET", "https://example.com", _request_timeout=30.0) + + assert isinstance(response, RESTResponse) + assert response.status == 200 + + +def test_request_with_tuple_timeout(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object( + adapter.connection, "request", return_value=mock_response + ) as mock_request: + response = adapter.request( + "GET", "https://example.com", _request_timeout=(5.0, 30.0) + ) + + assert isinstance(response, RESTResponse) + assert response.status == 200 + + call_args = mock_request.call_args + timeout_arg = call_args[1]["timeout"] + assert timeout_arg.connect == 5.0 + assert timeout_arg.read == 30.0 + + +def test_request_authorization_error(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 401 + mock_response.reason_phrase = "Unauthorized" + mock_response.headers = {} + mock_response.content = b'{"error": "unauthorized"}' + mock_response.text = '{"error": "unauthorized"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + with pytest.raises(AuthorizationException): + adapter.request("GET", "https://example.com") + + +def test_request_forbidden_error(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 403 + mock_response.reason_phrase = "Forbidden" + mock_response.headers = {} + mock_response.content = b'{"error": "forbidden"}' + mock_response.text = '{"error": "forbidden"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + with pytest.raises(AuthorizationException): + adapter.request("GET", "https://example.com") + + +def test_request_http_error(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 404 + mock_response.reason_phrase = "Not Found" + mock_response.headers = {} + mock_response.content = b'{"error": "not found"}' + mock_response.text = '{"error": "not found"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object(adapter.connection, "request", return_value=mock_response): + with pytest.raises(ApiException): + adapter.request("GET", "https://example.com") + + +def test_request_http_status_error(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 500 + mock_response.reason_phrase = "Internal Server Error" + mock_response.headers = {} + mock_response.content = b'{"error": "server error"}' + mock_response.text = '{"error": "server error"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + http_error = HTTPStatusError("Server Error", request=Mock(), response=mock_response) + + with patch.object(adapter.connection, "request", side_effect=http_error): + with pytest.raises(ApiException): + adapter.request("GET", "https://example.com") + + +def test_request_http_status_error_unauthorized(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 401 + mock_response.reason_phrase = "Unauthorized" + mock_response.headers = {} + mock_response.content = b'{"error": "unauthorized"}' + mock_response.text = '{"error": "unauthorized"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + http_error = HTTPStatusError("Unauthorized", request=Mock(), response=mock_response) + + with patch.object(adapter.connection, "request", side_effect=http_error): + with pytest.raises(AuthorizationException): + adapter.request("GET", "https://example.com") + + +def test_request_connection_error(): + adapter = RESTClientObjectAdapter() + + with patch.object( + adapter.connection, "request", side_effect=RequestError("Connection failed") + ): + with pytest.raises(ApiException): + adapter.request("GET", "https://example.com") + + +def test_request_timeout_error(): + adapter = RESTClientObjectAdapter() + + with patch.object( + adapter.connection, "request", side_effect=TimeoutException("Request timeout") + ): + with pytest.raises(ApiException): + adapter.request("GET", "https://example.com") + + +def test_request_invalid_method(): + adapter = RESTClientObjectAdapter() + + with pytest.raises(AssertionError): + adapter.request("INVALID", "https://example.com") + + +def test_request_body_and_post_params_conflict(): + adapter = RESTClientObjectAdapter() + + with pytest.raises( + ValueError, match="body parameter cannot be used with post_params parameter" + ): + adapter.request( + "POST", + "https://example.com", + body={"test": "data"}, + post_params={"field": "value"}, + ) + + +def test_get_method(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object( + adapter, "request", return_value=RESTResponse(mock_response) + ) as mock_request: + response = adapter.GET( + "https://example.com", headers={"Accept": "application/json"} + ) + + mock_request.assert_called_once_with( + "GET", + "https://example.com", + headers={"Accept": "application/json"}, + query_params=None, + _preload_content=True, + _request_timeout=None, + ) + assert isinstance(response, RESTResponse) + + +def test_head_method(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b"" + mock_response.text = "" + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object( + adapter, "request", return_value=RESTResponse(mock_response) + ) as mock_request: + response = adapter.HEAD("https://example.com") + + mock_request.assert_called_once_with( + "HEAD", + "https://example.com", + headers=None, + query_params=None, + _preload_content=True, + _request_timeout=None, + ) + assert isinstance(response, RESTResponse) + + +def test_options_method(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"methods": ["GET", "POST"]}' + mock_response.text = '{"methods": ["GET", "POST"]}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object( + adapter, "request", return_value=RESTResponse(mock_response) + ) as mock_request: + response = adapter.OPTIONS("https://example.com", body={"test": "data"}) + + mock_request.assert_called_once_with( + "OPTIONS", + "https://example.com", + headers=None, + query_params=None, + post_params=None, + body={"test": "data"}, + _preload_content=True, + _request_timeout=None, + ) + assert isinstance(response, RESTResponse) + + +def test_delete_method(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 204 + mock_response.reason_phrase = "No Content" + mock_response.headers = {} + mock_response.content = b"" + mock_response.text = "" + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object( + adapter, "request", return_value=RESTResponse(mock_response) + ) as mock_request: + response = adapter.DELETE("https://example.com", body={"id": 123}) + + mock_request.assert_called_once_with( + "DELETE", + "https://example.com", + headers=None, + query_params=None, + body={"id": 123}, + _preload_content=True, + _request_timeout=None, + ) + assert isinstance(response, RESTResponse) + + +def test_post_method(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 201 + mock_response.reason_phrase = "Created" + mock_response.headers = {} + mock_response.content = b'{"id": 123}' + mock_response.text = '{"id": 123}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object( + adapter, "request", return_value=RESTResponse(mock_response) + ) as mock_request: + response = adapter.POST("https://example.com", body={"name": "test"}) + + mock_request.assert_called_once_with( + "POST", + "https://example.com", + headers=None, + query_params=None, + post_params=None, + body={"name": "test"}, + _preload_content=True, + _request_timeout=None, + ) + assert isinstance(response, RESTResponse) + + +def test_put_method(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"updated": true}' + mock_response.text = '{"updated": true}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object( + adapter, "request", return_value=RESTResponse(mock_response) + ) as mock_request: + response = adapter.PUT("https://example.com", body={"name": "updated"}) + + mock_request.assert_called_once_with( + "PUT", + "https://example.com", + headers=None, + query_params=None, + post_params=None, + body={"name": "updated"}, + _preload_content=True, + _request_timeout=None, + ) + assert isinstance(response, RESTResponse) + + +def test_patch_method(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"patched": true}' + mock_response.text = '{"patched": true}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object( + adapter, "request", return_value=RESTResponse(mock_response) + ) as mock_request: + response = adapter.PATCH("https://example.com", body={"field": "value"}) + + mock_request.assert_called_once_with( + "PATCH", + "https://example.com", + headers=None, + query_params=None, + post_params=None, + body={"field": "value"}, + _preload_content=True, + _request_timeout=None, + ) + assert isinstance(response, RESTResponse) + + +def test_request_content_type_default(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object( + adapter.connection, "request", return_value=mock_response + ) as mock_request: + adapter.request("POST", "https://example.com", body={"test": "data"}) + + call_args = mock_request.call_args + assert call_args[1]["headers"]["Content-Type"] == "application/json" + + +def test_request_content_type_override(): + adapter = RESTClientObjectAdapter() + + mock_response = Mock(spec=Response) + mock_response.status_code = 200 + mock_response.reason_phrase = "OK" + mock_response.headers = {} + mock_response.content = b'{"data": "test"}' + mock_response.text = '{"data": "test"}' + mock_response.url = "https://example.com" + mock_response.http_version = "HTTP/1.1" + + with patch.object( + adapter.connection, "request", return_value=mock_response + ) as mock_request: + adapter.request( + "POST", + "https://example.com", + body="test", + headers={"Content-Type": "text/plain"}, + ) + + call_args = mock_request.call_args + assert call_args[1]["headers"]["Content-Type"] == "text/plain" diff --git a/tests/unit/automator/test_async_task_runner.py b/tests/unit/automator/test_async_task_runner.py index fccce010..5248f0db 100644 --- a/tests/unit/automator/test_async_task_runner.py +++ b/tests/unit/automator/test_async_task_runner.py @@ -279,7 +279,7 @@ async def test_update_task_with_invalid_task_result(): @pytest.mark.asyncio async def test_update_task_with_faulty_task_api(mocker): - mocker.patch("time.sleep", return_value=None) + mocker.patch("asyncio.sleep", return_value=None) mocker.patch.object(TaskResourceApiAdapter, "update_task", side_effect=Exception()) task_runner = get_valid_task_runner() task_result = get_valid_task_result() diff --git a/tests/unit/automator/test_task_runner.py b/tests/unit/automator/test_task_runner.py index 6361937e..085e06ce 100644 --- a/tests/unit/automator/test_task_runner.py +++ b/tests/unit/automator/test_task_runner.py @@ -5,11 +5,15 @@ from requests.structures import CaseInsensitiveDict from conductor.client.automator.task_runner import TaskRunner +from conductor.client.codegen.rest import AuthorizationException, ApiException from conductor.client.configuration.configuration import Configuration from conductor.client.http.api.task_resource_api import TaskResourceApi from conductor.client.http.models.task import Task +from conductor.client.http.models.task_exec_log import TaskExecLog from conductor.client.http.models.task_result import TaskResult -from conductor.client.http.models.task_result_status import TaskResultStatus +from conductor.client.telemetry.metrics_collector import MetricsCollector +from conductor.shared.configuration.settings.metrics_settings import MetricsSettings +from conductor.shared.http.enums.task_result_status import TaskResultStatus from conductor.client.worker.worker_interface import DEFAULT_POLLING_INTERVAL from tests.unit.resources.workers import ClassWorker, OldFaultyExecutionWorker @@ -21,7 +25,7 @@ def disable_logging(): logging.disable(logging.NOTSET) -def get_valid_task_runner_with_worker_config(worker_config=None): +def get_valid_task_runner_with_worker_config(): return TaskRunner(configuration=Configuration(), worker=get_valid_worker()) @@ -298,3 +302,432 @@ def test_wait_for_polling_interval(): finish_time = time.time() spent_time = finish_time - start_time assert spent_time > expected_time + + +def test_initialization_with_metrics_collector(): + metrics_settings = MetricsSettings() + task_runner = TaskRunner( + configuration=Configuration(), + worker=get_valid_worker(), + metrics_settings=metrics_settings, + ) + assert isinstance(task_runner.metrics_collector, MetricsCollector) + + +def test_initialization_without_metrics_collector(): + task_runner = TaskRunner(configuration=Configuration(), worker=get_valid_worker()) + assert task_runner.metrics_collector is None + + +def test_initialization_with_none_configuration(): + task_runner = TaskRunner(worker=get_valid_worker()) + assert isinstance(task_runner.configuration, Configuration) + + +def test_run_method_logging_config_application(mocker): + mock_apply_logging = mocker.patch.object(Configuration, "apply_logging_config") + mock_run_once = mocker.patch.object(TaskRunner, "run_once") + mock_run_once.side_effect = KeyboardInterrupt() + + task_runner = get_valid_task_runner() + try: + task_runner.run() + except KeyboardInterrupt: + pass + + mock_apply_logging.assert_called_once() + + +def test_run_once_with_exception_handling(mocker): + worker = get_valid_worker() + mock_clear_cache = mocker.patch.object(worker, "clear_task_definition_name_cache") + mocker.patch.object( + TaskRunner, + "_TaskRunner__wait_for_polling_interval", + side_effect=Exception("Test exception"), + ) + + task_runner = TaskRunner(worker=worker) + task_runner.run_once() + + mock_clear_cache.assert_not_called() + + +def test_poll_task_with_paused_worker(mocker): + worker = get_valid_worker() + mocker.patch.object(worker, "paused", return_value=True) + + task_runner = TaskRunner(worker=worker) + result = task_runner._TaskRunner__poll_task() + + assert result is None + + +def test_poll_task_with_metrics_collector(mocker): + metrics_settings = MetricsSettings() + task_runner = TaskRunner( + configuration=Configuration(), + worker=get_valid_worker(), + metrics_settings=metrics_settings, + ) + + mocker.patch.object(TaskResourceApi, "poll", return_value=get_valid_task()) + mock_increment = mocker.patch.object(MetricsCollector, "increment_task_poll") + mock_record_time = mocker.patch.object(MetricsCollector, "record_task_poll_time") + + task_runner._TaskRunner__poll_task() + + mock_increment.assert_called_once() + mock_record_time.assert_called_once() + + +def test_poll_task_authorization_exception_invalid_token(mocker): + auth_exception = AuthorizationException(status=401, reason="Unauthorized") + auth_exception._error_code = "INVALID_TOKEN" + + mocker.patch.object(TaskResourceApi, "poll", side_effect=auth_exception) + task_runner = get_valid_task_runner() + result = task_runner._TaskRunner__poll_task() + + assert result is None + + +def test_poll_task_authorization_exception_with_metrics(mocker): + auth_exception = AuthorizationException(status=403, reason="Forbidden") + auth_exception._error_code = "FORBIDDEN" + + metrics_settings = MetricsSettings() + task_runner = TaskRunner( + configuration=Configuration(), + worker=get_valid_worker(), + metrics_settings=metrics_settings, + ) + + mocker.patch.object(TaskResourceApi, "poll", side_effect=auth_exception) + mock_increment_error = mocker.patch.object( + MetricsCollector, "increment_task_poll_error" + ) + + result = task_runner._TaskRunner__poll_task() + + assert result is None + mock_increment_error.assert_called_once() + + +def test_poll_task_api_exception(mocker): + api_exception = ApiException() + api_exception.reason = "Server Error" + api_exception.code = 500 + + mocker.patch.object(TaskResourceApi, "poll", side_effect=api_exception) + task_runner = get_valid_task_runner() + result = task_runner._TaskRunner__poll_task() + + assert result is None + + +def test_poll_task_api_exception_with_metrics(mocker): + api_exception = ApiException() + api_exception.reason = "Bad Request" + api_exception.code = 400 + + metrics_settings = MetricsSettings() + task_runner = TaskRunner( + configuration=Configuration(), + worker=get_valid_worker(), + metrics_settings=metrics_settings, + ) + + mocker.patch.object(TaskResourceApi, "poll", side_effect=api_exception) + mock_increment_error = mocker.patch.object( + MetricsCollector, "increment_task_poll_error" + ) + + result = task_runner._TaskRunner__poll_task() + + assert result is None + mock_increment_error.assert_called_once() + + +def test_poll_task_generic_exception_with_metrics(mocker): + metrics_settings = MetricsSettings() + task_runner = TaskRunner( + configuration=Configuration(), + worker=get_valid_worker(), + metrics_settings=metrics_settings, + ) + + mocker.patch.object( + TaskResourceApi, "poll", side_effect=ValueError("Generic error") + ) + mock_increment_error = mocker.patch.object( + MetricsCollector, "increment_task_poll_error" + ) + + result = task_runner._TaskRunner__poll_task() + + assert result is None + mock_increment_error.assert_called_once() + + +def test_execute_task_with_metrics_collector(mocker): + metrics_settings = MetricsSettings() + task_runner = TaskRunner( + configuration=Configuration(), + worker=get_valid_worker(), + metrics_settings=metrics_settings, + ) + + mock_record_time = mocker.patch.object(MetricsCollector, "record_task_execute_time") + mock_record_size = mocker.patch.object( + MetricsCollector, "record_task_result_payload_size" + ) + + task = get_valid_task() + task_runner._TaskRunner__execute_task(task) + + mock_record_time.assert_called_once() + mock_record_size.assert_called_once() + + +def test_execute_task_exception_with_metrics(mocker): + metrics_settings = MetricsSettings() + worker = OldFaultyExecutionWorker("task") + task_runner = TaskRunner( + configuration=Configuration(), worker=worker, metrics_settings=metrics_settings + ) + + mock_increment_error = mocker.patch.object( + MetricsCollector, "increment_task_execution_error" + ) + + task = get_valid_task() + task_result = task_runner._TaskRunner__execute_task(task) + + assert task_result.status == "FAILED" + assert task_result.reason_for_incompletion == "faulty execution" + assert len(task_result.logs) == 1 + assert isinstance(task_result.logs[0], TaskExecLog) + mock_increment_error.assert_called_once() + + +def test_update_task_with_metrics_collector(mocker): + metrics_settings = MetricsSettings() + task_runner = TaskRunner( + configuration=Configuration(), + worker=get_valid_worker(), + metrics_settings=metrics_settings, + ) + + mocker.patch.object(TaskResourceApi, "update_task", return_value="SUCCESS") + mock_increment_error = mocker.patch.object( + MetricsCollector, "increment_task_update_error" + ) + + task_result = get_valid_task_result() + response = task_runner._TaskRunner__update_task(task_result) + + assert response == "SUCCESS" + mock_increment_error.assert_not_called() + + +def test_update_task_retry_logic_with_metrics(mocker): + metrics_settings = MetricsSettings() + task_runner = TaskRunner( + configuration=Configuration(), + worker=get_valid_worker(), + metrics_settings=metrics_settings, + ) + + mock_sleep = mocker.patch("time.sleep") + mock_update = mocker.patch.object(TaskResourceApi, "update_task") + mock_update.side_effect = [ + Exception("First attempt"), + Exception("Second attempt"), + "SUCCESS", + ] + mock_increment_error = mocker.patch.object( + MetricsCollector, "increment_task_update_error" + ) + + task_result = get_valid_task_result() + response = task_runner._TaskRunner__update_task(task_result) + + assert response == "SUCCESS" + assert mock_sleep.call_count == 2 + assert mock_increment_error.call_count == 2 + + +def test_update_task_all_retries_fail_with_metrics(mocker): + metrics_settings = MetricsSettings() + task_runner = TaskRunner( + configuration=Configuration(), + worker=get_valid_worker(), + metrics_settings=metrics_settings, + ) + + mock_sleep = mocker.patch("time.sleep") + mock_update = mocker.patch.object(TaskResourceApi, "update_task") + mock_update.side_effect = Exception("All attempts fail") + mock_increment_error = mocker.patch.object( + MetricsCollector, "increment_task_update_error" + ) + + task_result = get_valid_task_result() + response = task_runner._TaskRunner__update_task(task_result) + + assert response is None + assert mock_sleep.call_count == 3 + assert mock_increment_error.call_count == 4 + + +def test_get_property_value_from_env_generic_property(monkeypatch): + monkeypatch.setenv("conductor_worker_domain", "test_domain") + task_runner = get_valid_task_runner() + result = task_runner._TaskRunner__get_property_value_from_env("domain", "task") + assert result == "test_domain" + + +def test_get_property_value_from_env_uppercase_generic(monkeypatch): + monkeypatch.setenv("CONDUCTOR_WORKER_DOMAIN", "test_domain_upper") + task_runner = get_valid_task_runner() + result = task_runner._TaskRunner__get_property_value_from_env("domain", "task") + assert result == "test_domain_upper" + + +def test_get_property_value_from_env_task_specific(monkeypatch): + monkeypatch.setenv("conductor_worker_domain", "generic_domain") + monkeypatch.setenv("conductor_worker_task_domain", "task_specific_domain") + task_runner = get_valid_task_runner() + result = task_runner._TaskRunner__get_property_value_from_env("domain", "task") + assert result == "task_specific_domain" + + +def test_get_property_value_from_env_uppercase_task_specific(monkeypatch): + monkeypatch.setenv("conductor_worker_domain", "generic_domain") + monkeypatch.setenv("CONDUCTOR_WORKER_task_DOMAIN", "task_specific_upper") + task_runner = get_valid_task_runner() + result = task_runner._TaskRunner__get_property_value_from_env("domain", "task") + assert result == "task_specific_upper" + + +def test_get_property_value_from_env_fallback_to_generic(monkeypatch): + monkeypatch.setenv("conductor_worker_domain", "generic_domain") + task_runner = get_valid_task_runner() + result = task_runner._TaskRunner__get_property_value_from_env( + "domain", "nonexistent_task" + ) + assert result == "generic_domain" + + +def test_get_property_value_from_env_no_value(): + task_runner = get_valid_task_runner() + result = task_runner._TaskRunner__get_property_value_from_env( + "nonexistent_prop", "task" + ) + assert result is None + + +def test_set_worker_properties_invalid_polling_interval(monkeypatch, caplog): + monkeypatch.setenv("conductor_worker_polling_interval", "invalid_float") + worker = get_valid_worker() + task_runner = TaskRunner(worker=worker) + + with caplog.at_level(logging.ERROR): + task_runner._TaskRunner__set_worker_properties() + + assert "Error converting polling_interval to float value" in caplog.text + + +def test_set_worker_properties_exception_in_polling_interval(monkeypatch, caplog): + monkeypatch.setenv("conductor_worker_polling_interval", "invalid_float") + worker = get_valid_worker() + task_runner = TaskRunner(worker=worker) + + with caplog.at_level(logging.ERROR): + task_runner._TaskRunner__set_worker_properties() + + assert ( + "Error converting polling_interval to float value" in caplog.text + ) + + +def test_set_worker_properties_domain_from_env(monkeypatch): + monkeypatch.setenv("conductor_worker_task_domain", "env_domain") + worker = get_valid_worker() + task_runner = TaskRunner(worker=worker) + assert task_runner.worker.domain == "env_domain" + + +def test_set_worker_properties_polling_interval_from_env(monkeypatch): + monkeypatch.setenv("conductor_worker_task_polling_interval", "2.5") + worker = get_valid_worker() + task_runner = TaskRunner(worker=worker) + assert task_runner.worker.poll_interval == 2.5 + + +def test_poll_task_with_domain_parameter(mocker): + worker = get_valid_worker() + mocker.patch.object(worker, "paused", return_value=False) + mocker.patch.object(worker, "get_domain", return_value="test_domain") + + task_runner = TaskRunner(worker=worker) + mock_poll = mocker.patch.object( + TaskResourceApi, "poll", return_value=get_valid_task() + ) + + task_runner._TaskRunner__poll_task() + + mock_poll.assert_called_once_with( + tasktype="task", workerid=worker.get_identity(), domain="test_domain" + ) + + +def test_poll_task_without_domain_parameter(mocker): + worker = get_valid_worker() + mocker.patch.object(worker, "paused", return_value=False) + mocker.patch.object(worker, "get_domain", return_value=None) + + task_runner = TaskRunner(worker=worker) + mock_poll = mocker.patch.object( + TaskResourceApi, "poll", return_value=get_valid_task() + ) + + task_runner._TaskRunner__poll_task() + + mock_poll.assert_called_once_with(tasktype="task", workerid=worker.get_identity()) + + +def test_execute_task_with_non_task_input(): + task_runner = get_valid_task_runner() + result = task_runner._TaskRunner__execute_task("not_a_task") + assert result is None + + +def test_update_task_with_non_task_result(): + task_runner = get_valid_task_runner() + result = task_runner._TaskRunner__update_task("not_a_task_result") + assert result is None + + +def test_run_once_with_no_task(mocker): + worker = get_valid_worker() + mock_clear_cache = mocker.patch.object(worker, "clear_task_definition_name_cache") + mocker.patch.object(TaskResourceApi, "poll", return_value=None) + + task_runner = TaskRunner(worker=worker) + task_runner.run_once() + + mock_clear_cache.assert_called_once() + + +def test_run_once_with_task_no_id(mocker): + worker = get_valid_worker() + mock_clear_cache = mocker.patch.object(worker, "clear_task_definition_name_cache") + task_without_id = Task(workflow_instance_id="test_workflow") + mocker.patch.object(TaskResourceApi, "poll", return_value=task_without_id) + + task_runner = TaskRunner(worker=worker) + task_runner.run_once() + + mock_clear_cache.assert_called_once() diff --git a/tests/unit/orkes/test_authorization_client.py b/tests/unit/orkes/test_authorization_client.py index 3cd6d2f9..c643cc4e 100644 --- a/tests/unit/orkes/test_authorization_client.py +++ b/tests/unit/orkes/test_authorization_client.py @@ -3,25 +3,21 @@ import pytest from conductor.client.configuration.configuration import Configuration -from conductor.client.http.api.application_resource_api import ApplicationResourceApi -from conductor.client.http.api.authorization_resource_api import ( - AuthorizationResourceApi, -) -from conductor.client.http.api.group_resource_api import GroupResourceApi -from conductor.client.http.api.user_resource_api import UserResourceApi -from conductor.client.http.models.authorization_request import AuthorizationRequest -from conductor.client.http.models.conductor_application import ConductorApplication -from conductor.client.http.models.conductor_user import ConductorUser +from conductor.client.http.api import UserResourceApi, ApplicationResourceApi, GroupResourceApi, AuthorizationResourceApi +from conductor.client.http.models.authorization_request import AuthorizationRequestAdapter as AuthorizationRequest +from conductor.client.http.models.granted_access_response import GrantedAccessResponseAdapter as GrantedAccessResponse +from conductor.client.http.models import ExtendedConductorApplication +from conductor.client.http.models.conductor_user import ConductorUserAdapter as ConductorUser from conductor.client.http.models.create_or_update_application_request import ( CreateOrUpdateApplicationRequest, ) -from conductor.client.http.models.group import Group -from conductor.client.http.models.permission import Permission -from conductor.client.http.models.role import Role -from conductor.client.http.models.subject_ref import SubjectRef -from conductor.client.http.models.target_ref import TargetRef -from conductor.client.http.models.upsert_group_request import UpsertGroupRequest -from conductor.client.http.models.upsert_user_request import UpsertUserRequest +from conductor.client.http.models.group import GroupAdapter as Group +from conductor.client.http.models.permission import PermissionAdapter as Permission +from conductor.client.http.models.role import RoleAdapter as Role +from conductor.client.http.models.subject_ref import SubjectRefAdapter as SubjectRef +from conductor.client.http.models.target_ref import TargetRefAdapter as TargetRef +from conductor.client.http.models.upsert_group_request import UpsertGroupRequestAdapter as UpsertGroupRequest +from conductor.client.http.models.upsert_user_request import UpsertUserRequestAdapter as UpsertUserRequest from conductor.client.orkes.models.access_key import AccessKey from conductor.client.orkes.models.access_key_status import AccessKeyStatus from conductor.client.orkes.models.access_type import AccessType @@ -54,8 +50,8 @@ def authorization_client(): @pytest.fixture(scope="module") def conductor_application(): - return ConductorApplication( - APP_ID, APP_NAME, USER_ID, 1699236095031, 1699236095031, USER_ID + return ExtendedConductorApplication( + 1699236095031, USER_ID, APP_ID, APP_NAME, None, 1699236095031, USER_ID ) @@ -115,7 +111,7 @@ def group_roles(): @pytest.fixture(scope="module") def conductor_group(group_roles): - return Group(GROUP_ID, GROUP_NAME, group_roles) + return Group(None, GROUP_NAME, GROUP_ID, group_roles) @pytest.fixture(autouse=True) @@ -153,6 +149,7 @@ def test_create_application(mocker, authorization_client, conductor_application) } app = authorization_client.create_application(createReq) mock.assert_called_with(createReq) + assert app == conductor_application @@ -196,9 +193,9 @@ def test_update_application(mocker, authorization_client, conductor_application) "createTime": 1699236095031, "updateTime": 1699236095031, } - app = authorization_client.update_application(updateReq, APP_ID) + app = authorization_client.update_application(APP_ID, updateReq) assert app == conductor_application - mock.assert_called_with(updateReq, APP_ID) + mock.assert_called_with(APP_ID, updateReq) def test_add_role_to_application_user(mocker, authorization_client): @@ -216,7 +213,7 @@ def test_remove_role_from_application_user(mocker, authorization_client): def test_set_application_tags(mocker, authorization_client, conductor_application): - mock = mocker.patch.object(ApplicationResourceApi, "put_tags_for_application") + mock = mocker.patch.object(ApplicationResourceApi, "put_tag_for_application") tag1 = MetadataTag("tag1", "val1") tag2 = MetadataTag("tag2", "val2") tags = [tag1, tag2] @@ -236,7 +233,7 @@ def test_get_application_tags(mocker, authorization_client, conductor_applicatio def test_delete_application_tags(mocker, authorization_client, conductor_application): - mock = mocker.patch.object(ApplicationResourceApi, "delete_tags_for_application") + mock = mocker.patch.object(ApplicationResourceApi, "put_tag_for_application") tag1 = MetadataTag("tag1", "val1") tag2 = MetadataTag("tag2", "val2") tags = [tag1, tag2] @@ -296,8 +293,8 @@ def test_upsert_user(mocker, authorization_client, conductor_user, roles): mock = mocker.patch.object(UserResourceApi, "upsert_user") upsertReq = UpsertUserRequest(USER_NAME, ["ADMIN"]) mock.return_value = conductor_user.to_dict() - user = authorization_client.upsert_user(upsertReq, USER_ID) - mock.assert_called_with(upsertReq, USER_ID) + user = authorization_client.upsert_user(USER_ID, upsertReq) + mock.assert_called_with(USER_ID, upsertReq) assert user.name == USER_NAME assert user.id == USER_ID assert user.uuid == USER_UUID @@ -341,8 +338,8 @@ def test_upsert_group(mocker, authorization_client, conductor_group, group_roles mock = mocker.patch.object(GroupResourceApi, "upsert_group") upsertReq = UpsertGroupRequest(GROUP_NAME, ["USER"]) mock.return_value = conductor_group.to_dict() - group = authorization_client.upsert_group(upsertReq, GROUP_ID) - mock.assert_called_with(upsertReq, GROUP_ID) + group = authorization_client.upsert_group(GROUP_ID, upsertReq) + mock.assert_called_with(GROUP_ID, upsertReq) assert group == conductor_group assert group.description == GROUP_NAME assert group.id == GROUP_ID @@ -401,25 +398,19 @@ def test_remove_user_from_group(mocker, authorization_client): def test_get_granted_permissions_for_group(mocker, authorization_client): mock = mocker.patch.object(GroupResourceApi, "get_granted_permissions1") - mock.return_value = { - "grantedAccess": [ - { - "target": { - "type": "WORKFLOW_DEF", - "id": WF_NAME, - }, - "access": [ - "EXECUTE", - "UPDATE", - "READ", - ], - } + mock.return_value = GrantedAccessResponse( + granted_access=[ + GrantedPermission( + target=TargetRef(WF_NAME, TargetType.WORKFLOW_DEF.value), + access=["EXECUTE", "UPDATE", "READ"], + ) ] - } + ) + perms = authorization_client.get_granted_permissions_for_group(GROUP_ID) mock.assert_called_with(GROUP_ID) expected_perm = GrantedPermission( - target=TargetRef(TargetType.WORKFLOW_DEF, WF_NAME), + target=TargetRef(WF_NAME, TargetType.WORKFLOW_DEF.value), access=["EXECUTE", "UPDATE", "READ"], ) assert perms == [expected_perm] @@ -445,7 +436,7 @@ def test_get_granted_permissions_for_user(mocker, authorization_client): perms = authorization_client.get_granted_permissions_for_user(USER_ID) mock.assert_called_with(USER_ID) expected_perm = GrantedPermission( - target=TargetRef(TargetType.WORKFLOW_DEF, WF_NAME), + target=TargetRef(id=WF_NAME, type=TargetType.WORKFLOW_DEF.value), access=["EXECUTE", "UPDATE", "READ"], ) assert perms == [expected_perm] @@ -463,16 +454,16 @@ def test_get_permissions(mocker, authorization_client): ], } permissions = authorization_client.get_permissions( - TargetRef(TargetType.WORKFLOW_DEF, WF_NAME) + TargetRef(WF_NAME, TargetType.WORKFLOW_DEF) ) mock.assert_called_with(TargetType.WORKFLOW_DEF.name, "workflow_name") expected_permissions_dict = { AccessType.EXECUTE.name: [ - SubjectRef(SubjectType.USER, USER_ID), + SubjectRef(USER_ID, SubjectType.USER), ], AccessType.READ.name: [ - SubjectRef(SubjectType.USER, USER_ID), - SubjectRef(SubjectType.GROUP, GROUP_ID), + SubjectRef(USER_ID, SubjectType.USER), + SubjectRef(GROUP_ID, SubjectType.GROUP), ], } assert permissions == expected_permissions_dict @@ -480,8 +471,8 @@ def test_get_permissions(mocker, authorization_client): def test_grant_permissions(mocker, authorization_client): mock = mocker.patch.object(AuthorizationResourceApi, "grant_permissions") - subject = SubjectRef(SubjectType.USER, USER_ID) - target = TargetRef(TargetType.WORKFLOW_DEF, WF_NAME) + subject = SubjectRef(USER_ID, SubjectType.USER) + target = TargetRef(WF_NAME,TargetType.WORKFLOW_DEF) access = [AccessType.READ, AccessType.EXECUTE] authorization_client.grant_permissions(subject, target, access) mock.assert_called_with(AuthorizationRequest(subject, target, access)) @@ -489,8 +480,8 @@ def test_grant_permissions(mocker, authorization_client): def test_remove_permissions(mocker, authorization_client): mock = mocker.patch.object(AuthorizationResourceApi, "remove_permissions") - subject = SubjectRef(SubjectType.USER, USER_ID) - target = TargetRef(TargetType.WORKFLOW_DEF, WF_NAME) + subject = SubjectRef(USER_ID, SubjectType.USER) + target = TargetRef(WF_NAME, TargetType.WORKFLOW_DEF) access = [AccessType.READ, AccessType.EXECUTE] authorization_client.remove_permissions(subject, target, access) mock.assert_called_with(AuthorizationRequest(subject, target, access)) diff --git a/tests/unit/orkes/test_metadata_client.py b/tests/unit/orkes/test_metadata_client.py index e73b00f7..1f5d9c4f 100644 --- a/tests/unit/orkes/test_metadata_client.py +++ b/tests/unit/orkes/test_metadata_client.py @@ -4,11 +4,11 @@ import pytest from conductor.client.configuration.configuration import Configuration -from conductor.client.http.api.metadata_resource_api import MetadataResourceApi -from conductor.client.http.models.tag_string import TagString -from conductor.client.http.models.task_def import TaskDef -from conductor.client.http.models.workflow_def import WorkflowDef -from conductor.client.http.rest import ApiException +from conductor.client.http.api import MetadataResourceApi +from conductor.client.http.models.tag_string import TagStringAdapter as TagString +from conductor.client.http.models.task_def import TaskDefAdapter as TaskDef +from conductor.client.http.models.workflow_def import WorkflowDefAdapter as WorkflowDef +from conductor.client.codegen.rest import ApiException from conductor.client.orkes.api.tags_api import TagsApi from conductor.client.orkes.models.metadata_tag import MetadataTag from conductor.client.orkes.models.ratelimit_tag import RateLimitTag @@ -66,14 +66,14 @@ def test_register_workflow_def_without_overwrite(mocker, metadata_client, workfl def test_update_workflow_def(mocker, metadata_client, workflow_def): - mock = mocker.patch.object(MetadataResourceApi, "update1") + mock = mocker.patch.object(MetadataResourceApi, "update") metadata_client.update_workflow_def(workflow_def) assert mock.called mock.assert_called_with([workflow_def], overwrite=True) def test_update_workflow_def_without_overwrite(mocker, metadata_client, workflow_def): - mock = mocker.patch.object(MetadataResourceApi, "update1") + mock = mocker.patch.object(MetadataResourceApi, "update") metadata_client.update_workflow_def(workflow_def, False) assert mock.called mock.assert_called_with([workflow_def], overwrite=False) @@ -87,7 +87,7 @@ def test_unregister_workflow_def(mocker, metadata_client): def test_get_workflow_def_without_version(mocker, metadata_client, workflow_def): - mock = mocker.patch.object(MetadataResourceApi, "get") + mock = mocker.patch.object(MetadataResourceApi, "get1") mock.return_value = workflow_def wf = metadata_client.get_workflow_def(WORKFLOW_NAME) assert wf == workflow_def @@ -96,7 +96,7 @@ def test_get_workflow_def_without_version(mocker, metadata_client, workflow_def) def test_get_workflow_def_with_version(mocker, metadata_client, workflow_def): - mock = mocker.patch.object(MetadataResourceApi, "get") + mock = mocker.patch.object(MetadataResourceApi, "get1") mock.return_value = workflow_def wf = metadata_client.get_workflow_def(WORKFLOW_NAME, 1) assert wf == workflow_def @@ -104,7 +104,7 @@ def test_get_workflow_def_with_version(mocker, metadata_client, workflow_def): def test_get_workflow_def_non_existent(mocker, metadata_client, workflow_def): - mock = mocker.patch.object(MetadataResourceApi, "get") + mock = mocker.patch.object(MetadataResourceApi, "get1") message = f"No such workflow found by name:{WORKFLOW_NAME}, version: null" error_body = {"status": 404, "message": message} mock.side_effect = mocker.MagicMock( @@ -115,7 +115,7 @@ def test_get_workflow_def_non_existent(mocker, metadata_client, workflow_def): def test_get_all_workflow_defs(mocker, metadata_client, workflow_def): - mock = mocker.patch.object(MetadataResourceApi, "get_all_workflows") + mock = mocker.patch.object(MetadataResourceApi, "get_workflow_defs") expected_workflow_defs_len = 2 workflow_def2 = WorkflowDef(name="ut_wf_2", version=1) mock.return_value = [workflow_def, workflow_def2] diff --git a/tests/unit/orkes/test_scheduler_client.py b/tests/unit/orkes/test_scheduler_client.py index b53ac2fe..553df8cc 100644 --- a/tests/unit/orkes/test_scheduler_client.py +++ b/tests/unit/orkes/test_scheduler_client.py @@ -4,13 +4,11 @@ import pytest from conductor.client.configuration.configuration import Configuration -from conductor.client.http.api.scheduler_resource_api import SchedulerResourceApi -from conductor.client.http.models.save_schedule_request import SaveScheduleRequest -from conductor.client.http.models.search_result_workflow_schedule_execution_model import ( - SearchResultWorkflowScheduleExecutionModel, -) -from conductor.client.http.models.workflow_schedule import WorkflowSchedule -from conductor.client.http.rest import ApiException +from conductor.client.http.api import SchedulerResourceApi +from conductor.client.http.models.save_schedule_request import SaveScheduleRequestAdapter as SaveScheduleRequest +from conductor.client.http.models.search_result_workflow_schedule_execution_model import SearchResultWorkflowScheduleExecutionModelAdapter as SearchResultWorkflowScheduleExecutionModel +from conductor.client.http.models.workflow_schedule import WorkflowScheduleAdapter as WorkflowSchedule +from conductor.client.codegen.rest import ApiException from conductor.client.orkes.models.metadata_tag import MetadataTag from conductor.client.orkes.orkes_scheduler_client import OrkesSchedulerClient @@ -159,7 +157,7 @@ def test_requeue_all_execution_records(mocker, scheduler_client): def test_search_schedule_executions(mocker, scheduler_client): - mock = mocker.patch.object(SchedulerResourceApi, "search_v21") + mock = mocker.patch.object(SchedulerResourceApi, "search_v2") srw = SearchResultWorkflowScheduleExecutionModel(total_hits=2) mock.return_value = srw start = 1698093300000 @@ -173,7 +171,7 @@ def test_search_schedule_executions(mocker, scheduler_client): start=start, size=2, sort=sort, - freeText=free_text, + free_text=free_text, query=query, ) assert search_result == srw diff --git a/tests/unit/orkes/test_schema_client.py b/tests/unit/orkes/test_schema_client.py index f27d4e9b..b93450ec 100644 --- a/tests/unit/orkes/test_schema_client.py +++ b/tests/unit/orkes/test_schema_client.py @@ -3,8 +3,8 @@ import pytest from conductor.client.configuration.configuration import Configuration -from conductor.client.http.api.schema_resource_api import SchemaResourceApi -from conductor.client.http.models.schema_def import SchemaDef +from conductor.client.http.api import SchemaResourceApi +from conductor.client.http.models.schema_def import SchemaDefAdapter as SchemaDef from conductor.client.orkes.orkes_schema_client import OrkesSchemaClient SCHEMA_NAME = "ut_schema" diff --git a/tests/unit/orkes/test_task_client.py b/tests/unit/orkes/test_task_client.py index 34923ce8..778c7deb 100644 --- a/tests/unit/orkes/test_task_client.py +++ b/tests/unit/orkes/test_task_client.py @@ -10,7 +10,7 @@ from conductor.client.http.models.task_result import TaskResult from conductor.shared.http.enums import TaskResultStatus from conductor.client.http.models.workflow import Workflow -from conductor.client.http.rest import ApiException +from conductor.client.codegen.rest import ApiException from conductor.client.orkes.orkes_task_client import OrkesTaskClient from conductor.client.workflow.task.task_type import TaskType diff --git a/tests/unit/orkes/test_workflow_client.py b/tests/unit/orkes/test_workflow_client.py index 800ea613..fc882f71 100644 --- a/tests/unit/orkes/test_workflow_client.py +++ b/tests/unit/orkes/test_workflow_client.py @@ -4,15 +4,15 @@ import pytest from conductor.client.configuration.configuration import Configuration -from conductor.client.http.api.workflow_resource_api import WorkflowResourceApi -from conductor.client.http.models import SkipTaskRequest -from conductor.client.http.models.rerun_workflow_request import RerunWorkflowRequest -from conductor.client.http.models.start_workflow_request import StartWorkflowRequest -from conductor.client.http.models.workflow import Workflow -from conductor.client.http.models.workflow_def import WorkflowDef -from conductor.client.http.models.workflow_run import WorkflowRun -from conductor.client.http.models.workflow_test_request import WorkflowTestRequest -from conductor.client.http.rest import ApiException +from conductor.client.http.api import WorkflowResourceApi +from conductor.client.http.models.skip_task_request import SkipTaskRequestAdapter as SkipTaskRequest +from conductor.client.http.models.rerun_workflow_request import RerunWorkflowRequestAdapter as RerunWorkflowRequest +from conductor.client.http.models.start_workflow_request import StartWorkflowRequestAdapter as StartWorkflowRequest +from conductor.client.http.models.workflow import WorkflowAdapter as Workflow +from conductor.client.http.models.workflow_def import WorkflowDefAdapter as WorkflowDef +from conductor.client.http.models.workflow_run import WorkflowRunAdapter as WorkflowRun +from conductor.client.http.models.workflow_test_request import WorkflowTestRequestAdapter as WorkflowTestRequest +from conductor.client.codegen.rest import ApiException from conductor.client.orkes.orkes_workflow_client import OrkesWorkflowClient WORKFLOW_NAME = "ut_wf" @@ -162,13 +162,13 @@ def test_retry_workflow_with_resume_subworkflow_tasks(mocker, workflow_client): def test_terminate_workflow(mocker, workflow_client): - mock = mocker.patch.object(WorkflowResourceApi, "terminate") + mock = mocker.patch.object(WorkflowResourceApi, "terminate1") workflow_client.terminate_workflow(WORKFLOW_UUID) mock.assert_called_with(WORKFLOW_UUID) def test_terminate_workflow_with_reason(mocker, workflow_client): - mock = mocker.patch.object(WorkflowResourceApi, "terminate") + mock = mocker.patch.object(WorkflowResourceApi, "terminate1") reason = "Unit test failed" workflow_client.terminate_workflow(WORKFLOW_UUID, reason) mock.assert_called_with(WORKFLOW_UUID, reason=reason) @@ -201,13 +201,13 @@ def test_get_workflow_non_existent(mocker, workflow_client): def test_delete_workflow(mocker, workflow_client): - mock = mocker.patch.object(WorkflowResourceApi, "delete") + mock = mocker.patch.object(WorkflowResourceApi, "delete1") workflow_client.delete_workflow(WORKFLOW_UUID) mock.assert_called_with(WORKFLOW_UUID, archive_workflow=True) def test_delete_workflow_without_archival(mocker, workflow_client): - mock = mocker.patch.object(WorkflowResourceApi, "delete") + mock = mocker.patch.object(WorkflowResourceApi, "delete1") workflow_client.delete_workflow(WORKFLOW_UUID, False) mock.assert_called_with(WORKFLOW_UUID, archive_workflow=False) diff --git a/tests/unit/worker/test_sync_worker.py b/tests/unit/worker/test_sync_worker.py new file mode 100644 index 00000000..6c72e89e --- /dev/null +++ b/tests/unit/worker/test_sync_worker.py @@ -0,0 +1,511 @@ +import dataclasses +import logging +from unittest.mock import MagicMock, patch +from typing import Any + +import pytest + +from conductor.client.worker.worker import ( + Worker, + is_callable_input_parameter_a_task, + is_callable_return_value_of_type, +) +from conductor.client.http.models.task import Task +from conductor.client.http.models.task_result import TaskResult +from conductor.shared.http.enums import TaskResultStatus +from conductor.shared.worker.exception import NonRetryableException + + +@pytest.fixture(autouse=True) +def disable_logging(): + logging.disable(logging.CRITICAL) + yield + logging.disable(logging.NOTSET) + + +@pytest.fixture +def mock_task(): + task = MagicMock(spec=Task) + task.task_id = "test_task_id" + task.workflow_instance_id = "test_workflow_id" + task.task_def_name = "test_task" + task.input_data = {"param1": "value1", "param2": 42} + return task + + +@pytest.fixture +def simple_execute_function(): + def func(param1: str, param2: int = 10): + return {"result": f"{param1}_{param2}"} + + return func + + +@pytest.fixture +def task_input_execute_function(): + def func(task: Task): + return {"result": f"processed_{task.task_id}"} + + return func + + +@pytest.fixture +def task_result_execute_function(): + def func(param1: str) -> TaskResult: + result = TaskResult( + task_id="test_task_id", + workflow_instance_id="test_workflow_id", + status=TaskResultStatus.COMPLETED, + output_data={"result": f"task_result_{param1}"}, + ) + return result + + return func + + +@pytest.fixture +def worker(simple_execute_function): + return Worker( + task_definition_name="test_task", + execute_function=simple_execute_function, + poll_interval=200, + domain="test_domain", + worker_id="test_worker_id", + ) + + +def test_init_with_all_parameters(simple_execute_function): + worker = Worker( + task_definition_name="test_task", + execute_function=simple_execute_function, + poll_interval=300, + domain="test_domain", + worker_id="custom_worker_id", + ) + + assert worker.task_definition_name == "test_task" + assert worker.poll_interval == 300 + assert worker.domain == "test_domain" + assert worker.worker_id == "custom_worker_id" + assert worker.execute_function == simple_execute_function + + +def test_init_with_defaults(simple_execute_function): + worker = Worker( + task_definition_name="test_task", execute_function=simple_execute_function + ) + + assert worker.task_definition_name == "test_task" + assert worker.poll_interval == 100 + assert worker.domain is not None + assert worker.domain == "default_domain" + assert worker.worker_id is not None + assert worker.execute_function == simple_execute_function + + +def test_get_identity(worker): + identity = worker.get_identity() + assert identity == "test_worker_id" + + +def test_execute_success_with_simple_function(worker, mock_task): + result = worker.execute(mock_task) + + assert isinstance(result, TaskResult) + assert result.task_id == "test_task_id" + assert result.workflow_instance_id == "test_workflow_id" + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"result": "value1_42"} + + +def test_execute_success_with_task_input_function( + task_input_execute_function, mock_task +): + worker = Worker( + task_definition_name="test_task", execute_function=task_input_execute_function + ) + + result = worker.execute(mock_task) + + assert isinstance(result, TaskResult) + assert result.task_id == "test_task_id" + assert result.workflow_instance_id == "test_workflow_id" + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"result": "processed_test_task_id"} + + +def test_execute_success_with_task_result_function( + task_result_execute_function, mock_task +): + worker = Worker( + task_definition_name="test_task", execute_function=task_result_execute_function + ) + + result = worker.execute(mock_task) + + assert isinstance(result, TaskResult) + assert result.task_id == "test_task_id" + assert result.workflow_instance_id == "test_workflow_id" + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"result": "task_result_value1"} + + +def test_execute_with_missing_parameters(worker, mock_task): + mock_task.input_data = {"param1": "value1"} + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"result": "value1_10"} + + +def test_execute_with_none_parameters(worker, mock_task): + mock_task.input_data = {"param1": "value1", "param2": None} + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"result": "value1_None"} + + +def test_execute_with_non_retryable_exception(worker, mock_task): + def failing_function(param1: str, param2: int): + raise NonRetryableException("Terminal error") + + worker.execute_function = failing_function + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.FAILED_WITH_TERMINAL_ERROR + assert result.reason_for_incompletion == "Terminal error" + + +def test_execute_with_general_exception(worker, mock_task): + def failing_function(param1: str, param2: int): + raise ValueError("General error") + + worker.execute_function = failing_function + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.FAILED + assert result.reason_for_incompletion == "General error" + assert len(result.logs) == 1 + assert "ValueError: General error" in result.logs[0].created_time + + +def test_execute_with_none_output(worker, mock_task): + def none_function(param1: str, param2: int): + return None + + worker.execute_function = none_function + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"result": None} + + +def test_execute_with_dataclass_output(worker, mock_task): + @dataclasses.dataclass + class TestOutput: + value: str + number: int + + def dataclass_function(param1: str, param2: int): + return TestOutput(value=param1, number=param2) + + worker.execute_function = dataclass_function + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"value": "value1", "number": 42} + + +def test_execute_with_non_dict_output(worker, mock_task): + def string_function(param1: str, param2: int): + return f"result_{param1}_{param2}" + + worker.execute_function = string_function + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"result": "result_value1_42"} + + +def test_execute_function_property(worker, simple_execute_function): + assert worker.execute_function == simple_execute_function + + +def test_execute_function_setter(worker): + def new_function(param1: str): + return {"new_result": param1} + + worker.execute_function = new_function + + assert worker.execute_function == new_function + assert worker._is_execute_function_input_parameter_a_task is False + assert worker._is_execute_function_return_value_a_task_result is False + + +def test_execute_function_setter_with_task_input(task_input_execute_function): + worker = Worker(task_definition_name="test_task", execute_function=lambda x: x) + + worker.execute_function = task_input_execute_function + + assert worker._is_execute_function_input_parameter_a_task is True + assert worker._is_execute_function_return_value_a_task_result is False + + +def test_execute_function_setter_with_task_result(task_result_execute_function): + worker = Worker(task_definition_name="test_task", execute_function=lambda x: x) + + worker.execute_function = task_result_execute_function + + assert worker._is_execute_function_input_parameter_a_task is False + assert worker._is_execute_function_return_value_a_task_result is True + + +def test_is_callable_input_parameter_a_task_with_task_input( + task_input_execute_function, +): + result = is_callable_input_parameter_a_task(task_input_execute_function, Task) + assert result is True + + +def test_is_callable_input_parameter_a_task_with_simple_function( + simple_execute_function, +): + result = is_callable_input_parameter_a_task(simple_execute_function, Task) + assert result is False + + +def test_is_callable_input_parameter_a_task_with_multiple_parameters(): + def multi_param_func(param1: str, param2: int): + return param1 + str(param2) + + result = is_callable_input_parameter_a_task(multi_param_func, Task) + assert result is False + + +def test_is_callable_input_parameter_a_task_with_no_parameters(): + def no_param_func(): + return "result" + + result = is_callable_input_parameter_a_task(no_param_func, Task) + assert result is False + + +def test_is_callable_input_parameter_a_task_with_empty_annotation(): + def empty_annotation_func(param): + return param + + result = is_callable_input_parameter_a_task(empty_annotation_func, Task) + assert result is True + + +def test_is_callable_input_parameter_a_task_with_object_annotation(): + def object_annotation_func(param: object): + return param + + result = is_callable_input_parameter_a_task(object_annotation_func, Task) + assert result is True + + +def test_is_callable_return_value_of_type_with_task_result( + task_result_execute_function, +): + result = is_callable_return_value_of_type(task_result_execute_function, TaskResult) + assert result is True + + +def test_is_callable_return_value_of_type_with_simple_function(simple_execute_function): + result = is_callable_return_value_of_type(simple_execute_function, TaskResult) + assert result is False + + +def test_is_callable_return_value_of_type_with_any_return(): + def any_return_func(param1: str) -> Any: + return {"result": param1} + + result = is_callable_return_value_of_type(any_return_func, TaskResult) + assert result is False + + +def test_execute_with_empty_input_data(worker, mock_task): + mock_task.input_data = {} + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"result": "None_10"} + + +def test_execute_with_exception_no_args(worker, mock_task): + def failing_function(param1: str, param2: int): + raise Exception() + + worker.execute_function = failing_function + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.FAILED + assert result.reason_for_incompletion is None + + +def test_execute_with_non_retryable_exception_no_args(worker, mock_task): + def failing_function(param1: str, param2: int): + raise NonRetryableException() + + worker.execute_function = failing_function + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.FAILED_WITH_TERMINAL_ERROR + assert result.reason_for_incompletion is None + + +def test_execute_with_task_result_returning_function(mock_task): + def task_result_function(param1: str, param2: int) -> TaskResult: + result = TaskResult( + task_id="custom_task_id", + workflow_instance_id="custom_workflow_id", + status=TaskResultStatus.IN_PROGRESS, + output_data={"custom_result": f"{param1}_{param2}"}, + ) + return result + + worker = Worker( + task_definition_name="test_task", execute_function=task_result_function + ) + + result = worker.execute(mock_task) + + assert result.task_id == "test_task_id" + assert result.workflow_instance_id == "test_workflow_id" + assert result.status == TaskResultStatus.IN_PROGRESS + assert result.output_data == {"custom_result": "value1_42"} + + +def test_execute_with_complex_input_data(worker, mock_task): + mock_task.input_data = { + "param1": "value1", + "param2": 42, + "param3": "simple_string", + "param4": 123, + } + + def complex_function( + param1: str, param2: int, param3: str = None, param4: int = None + ): + return {"param1": param1, "param2": param2, "param3": param3, "param4": param4} + + worker.execute_function = complex_function + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == { + "param1": "value1", + "param2": 42, + "param3": "simple_string", + "param4": 123, + } + + +def test_execute_with_default_parameter_values(worker, mock_task): + mock_task.input_data = {"param1": "value1"} + + def function_with_defaults(param1: str, param2: int = 100, param3: str = "default"): + return f"{param1}_{param2}_{param3}" + + worker.execute_function = function_with_defaults + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"result": "value1_100_default"} + + +def test_execute_with_serialization_sanitization(worker, mock_task): + class CustomObject: + def __init__(self, value): + self.value = value + + def custom_object_function(param1: str, param2: int): + return CustomObject(f"{param1}_{param2}") + + worker.execute_function = custom_object_function + + with patch.object(worker.api_client, "sanitize_for_serialization") as mock_sanitize: + mock_sanitize.return_value = {"sanitized": "value"} + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + mock_sanitize.assert_called_once() + assert result.output_data == {"sanitized": "value"} + + +def test_execute_with_serialization_sanitization_non_dict_result(worker, mock_task): + def string_function(param1: str, param2: int): + return f"result_{param1}_{param2}" + + worker.execute_function = string_function + + with patch.object(worker.api_client, "sanitize_for_serialization") as mock_sanitize: + mock_sanitize.return_value = "sanitized_string" + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + mock_sanitize.assert_called_once() + assert result.output_data == {"result": "sanitized_string"} + + +def test_worker_identity_generation(): + worker1 = Worker("task1", lambda x: x) + worker2 = Worker("task2", lambda x: x) + + assert worker1.worker_id is not None + assert worker2.worker_id is not None + assert worker1.worker_id == worker2.worker_id # Both use hostname + + +def test_worker_domain_property(): + worker = Worker("task", lambda x: x, domain="test_domain") + assert worker.domain == "test_domain" + + worker.domain = "new_domain" + assert worker.domain == "new_domain" + + +def test_worker_poll_interval_property(): + worker = Worker("task", lambda x: x, poll_interval=500) + assert worker.poll_interval == 500 + + worker.poll_interval = 1000 + assert worker.poll_interval == 1000 + + +def test_execute_with_parameter_annotation_typing(): + def typed_function(param1: str, param2: str = None, param3: str = None): + return {"result": f"{param1}_{param2}_{param3}"} + + worker = Worker("task", typed_function) + mock_task = MagicMock(spec=Task) + mock_task.task_id = "test_task_id" + mock_task.workflow_instance_id = "test_workflow_id" + mock_task.task_def_name = "test_task" + mock_task.input_data = { + "param1": "value1", + "param2": "test_string", + "param3": "another_string", + } + + result = worker.execute(mock_task) + + assert result.status == TaskResultStatus.COMPLETED + assert result.output_data == {"result": "value1_test_string_another_string"} diff --git a/tests/unit/worker/test_worker.py b/tests/unit/worker/test_worker.py index d1a2b3d1..2aa6bbf8 100644 --- a/tests/unit/worker/test_worker.py +++ b/tests/unit/worker/test_worker.py @@ -89,7 +89,7 @@ def test_init_with_defaults(simple_execute_function): assert worker.task_definition_name == "test_task" assert worker.poll_interval == 100 - assert worker.domain is None + assert worker.domain == "default_domain" assert worker.worker_id is not None assert worker.execute_function == simple_execute_function diff --git a/tests/unit/worker/test_worker_task.py b/tests/unit/worker/test_worker_task.py new file mode 100644 index 00000000..73daa666 --- /dev/null +++ b/tests/unit/worker/test_worker_task.py @@ -0,0 +1,458 @@ +from typing import Union, cast +from unittest.mock import patch, MagicMock + +from conductor.client.worker.worker_task import WorkerTask, worker_task +from conductor.client.workflow.task.simple_task import SimpleTask + + +def test_worker_task_decorator_basic(): + @WorkerTask("test_task") + def test_func(param1, param2=10): + return {"result": f"{param1}_{param2}"} + + assert test_func.__name__ == "test_func" + assert callable(test_func) + + +def test_worker_task_decorator_with_parameters(): + @WorkerTask( + task_definition_name="test_task", + poll_interval=200, + domain="test_domain", + worker_id="test_worker", + poll_interval_seconds=5, + ) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + assert callable(test_func) + + +def test_worker_task_decorator_with_config_defaults(): + with patch( + "conductor.client.worker.worker_task.Configuration" + ) as mock_config_class: + mock_config = MagicMock() + mock_config.get_poll_interval.return_value = 150 + mock_config.get_domain.return_value = "config_domain" + mock_config.get_poll_interval_seconds.return_value = 3 + mock_config_class.return_value = mock_config + + @WorkerTask( + "test_task", poll_interval=None, domain=None, poll_interval_seconds=None + ) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + mock_config.get_poll_interval.assert_called_once() + mock_config.get_domain.assert_called_once() + mock_config.get_poll_interval_seconds.assert_called_once() + + +def test_worker_task_decorator_poll_interval_conversion(): + with patch( + "conductor.client.worker.worker_task.Configuration" + ) as mock_config_class: + mock_config = MagicMock() + mock_config.get_poll_interval.return_value = 100 + mock_config.get_domain.return_value = "default_domain" + mock_config.get_poll_interval_seconds.return_value = 0 + mock_config_class.return_value = mock_config + + @WorkerTask("test_task", poll_interval_seconds=2) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + + +def test_worker_task_decorator_poll_interval_seconds_override(): + with patch( + "conductor.client.worker.worker_task.Configuration" + ) as mock_config_class: + mock_config = MagicMock() + mock_config.get_poll_interval.return_value = 100 + mock_config.get_domain.return_value = "default_domain" + mock_config.get_poll_interval_seconds.return_value = 0 + mock_config_class.return_value = mock_config + + @WorkerTask("test_task", poll_interval=200, poll_interval_seconds=3) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + + +def test_worker_task_decorator_registration(): + with patch( + "conductor.client.worker.worker_task.register_decorated_fn" + ) as mock_register: + + @WorkerTask( + "test_task", + poll_interval=300, + domain="test_domain", + worker_id="test_worker", + ) + def test_func(param1): + return {"result": param1} + + mock_register.assert_called_once() + call_args = mock_register.call_args + assert call_args[1]["name"] == "test_task" + assert call_args[1]["poll_interval"] == 300 + assert call_args[1]["domain"] == "test_domain" + assert call_args[1]["worker_id"] == "test_worker" + assert "func" in call_args[1] + + +def test_worker_task_decorator_with_task_ref_name(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @WorkerTask("test_task") + def test_func(param1, param2=10): + return {"result": f"{param1}_{param2}"} + + result: Union[SimpleTask, dict] = test_func( + param1="value1", param2=20, task_ref_name="ref_task" + ) + + assert isinstance(result, SimpleTask) + task_result = cast(SimpleTask, result) + assert hasattr(task_result, "name") + assert hasattr(task_result, "task_reference_name") + assert hasattr(task_result, "input_parameters") + assert task_result.name == "test_task" + assert task_result.task_reference_name == "ref_task" + assert "param1" in task_result.input_parameters + assert "param2" in task_result.input_parameters + assert task_result.input_parameters["param1"] == "value1" + assert task_result.input_parameters["param2"] == 20 + + +def test_worker_task_decorator_without_task_ref_name(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @WorkerTask("test_task") + def test_func(param1, param2=10): + return {"result": f"{param1}_{param2}"} + + result = test_func("value1", param2=20) + + assert result == {"result": "value1_20"} + + +def test_worker_task_decorator_preserves_function_metadata(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @WorkerTask("test_task") + def test_func(param1: str, param2: int = 10) -> dict: + """Test function docstring""" + return {"result": f"{param1}_{param2}"} + + assert test_func.__name__ == "test_func" + assert test_func.__doc__ == "Test function docstring" + assert test_func.__annotations__ == { + "param1": str, + "param2": int, + "return": dict, + } + + +def test_worker_task_simple_decorator_basic(): + @worker_task("test_task") + def test_func(param1, param2=10): + return {"result": f"{param1}_{param2}"} + + assert test_func.__name__ == "test_func" + assert callable(test_func) + + +def test_worker_task_simple_decorator_with_parameters(): + @worker_task( + task_definition_name="test_task", + poll_interval_millis=250, + domain="test_domain", + worker_id="test_worker", + ) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + assert callable(test_func) + + +def test_worker_task_simple_decorator_with_config_defaults(): + with patch( + "conductor.client.worker.worker_task.Configuration" + ) as mock_config_class: + mock_config = MagicMock() + mock_config.get_poll_interval.return_value = 150 + mock_config.get_domain.return_value = "config_domain" + mock_config_class.return_value = mock_config + + @worker_task("test_task", poll_interval_millis=None, domain=None) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + mock_config.get_poll_interval.assert_called_once() + mock_config.get_domain.assert_called_once() + + +def test_worker_task_simple_decorator_registration(): + with patch( + "conductor.client.worker.worker_task.register_decorated_fn" + ) as mock_register: + + @worker_task( + "test_task", + poll_interval_millis=350, + domain="test_domain", + worker_id="test_worker", + ) + def test_func(param1): + return {"result": param1} + + mock_register.assert_called_once() + call_args = mock_register.call_args + assert call_args[1]["name"] == "test_task" + assert call_args[1]["poll_interval"] == 350 + assert call_args[1]["domain"] == "test_domain" + assert call_args[1]["worker_id"] == "test_worker" + assert "func" in call_args[1] + + +def test_worker_task_simple_decorator_with_task_ref_name(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @worker_task("test_task") + def test_func(param1, param2=10): + return {"result": f"{param1}_{param2}"} + + result: Union[SimpleTask, dict] = test_func( + param1="value1", param2=20, task_ref_name="ref_task" + ) + + assert isinstance(result, SimpleTask) + task_result = cast(SimpleTask, result) + assert hasattr(task_result, "name") + assert hasattr(task_result, "task_reference_name") + assert hasattr(task_result, "input_parameters") + assert task_result.name == "test_task" + assert task_result.task_reference_name == "ref_task" + assert "param1" in task_result.input_parameters + assert "param2" in task_result.input_parameters + assert task_result.input_parameters["param1"] == "value1" + assert task_result.input_parameters["param2"] == 20 + + +def test_worker_task_simple_decorator_without_task_ref_name(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @worker_task("test_task") + def test_func(param1, param2=10): + return {"result": f"{param1}_{param2}"} + + result = test_func("value1", param2=20) + + assert result == {"result": "value1_20"} + + +def test_worker_task_simple_decorator_preserves_function_metadata(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @worker_task("test_task") + def test_func(param1: str, param2: int = 10) -> dict: + """Test function docstring""" + return {"result": f"{param1}_{param2}"} + + assert test_func.__name__ == "test_func" + assert test_func.__doc__ == "Test function docstring" + assert test_func.__annotations__ == { + "param1": str, + "param2": int, + "return": dict, + } + + +def test_worker_task_poll_interval_millis_calculation(): + with patch( + "conductor.client.worker.worker_task.Configuration" + ) as mock_config_class: + mock_config = MagicMock() + mock_config.get_poll_interval.return_value = 100 + mock_config.get_domain.return_value = "default_domain" + mock_config.get_poll_interval_seconds.return_value = 0 + mock_config_class.return_value = mock_config + + @WorkerTask("test_task", poll_interval_seconds=2) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + + +def test_worker_task_poll_interval_seconds_zero(): + with patch( + "conductor.client.worker.worker_task.Configuration" + ) as mock_config_class: + mock_config = MagicMock() + mock_config.get_poll_interval.return_value = 100 + mock_config.get_domain.return_value = "default_domain" + mock_config.get_poll_interval_seconds.return_value = 0 + mock_config_class.return_value = mock_config + + @WorkerTask("test_task", poll_interval=200, poll_interval_seconds=0) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + + +def test_worker_task_poll_interval_seconds_positive(): + with patch( + "conductor.client.worker.worker_task.Configuration" + ) as mock_config_class: + mock_config = MagicMock() + mock_config.get_poll_interval.return_value = 100 + mock_config.get_domain.return_value = "default_domain" + mock_config.get_poll_interval_seconds.return_value = 0 + mock_config_class.return_value = mock_config + + @WorkerTask("test_task", poll_interval_seconds=3) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + + +def test_worker_task_none_values(): + with patch( + "conductor.client.worker.worker_task.Configuration" + ) as mock_config_class: + mock_config = MagicMock() + mock_config.get_poll_interval.return_value = 100 + mock_config.get_domain.return_value = "default_domain" + mock_config.get_poll_interval_seconds.return_value = 0 + mock_config_class.return_value = mock_config + + @WorkerTask("test_task", domain=None, worker_id=None) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + + +def test_worker_task_simple_none_values(): + with patch( + "conductor.client.worker.worker_task.Configuration" + ) as mock_config_class: + mock_config = MagicMock() + mock_config.get_poll_interval.return_value = 100 + mock_config.get_domain.return_value = "default_domain" + mock_config_class.return_value = mock_config + + @worker_task("test_task", domain=None, worker_id=None) + def test_func(param1): + return {"result": param1} + + assert test_func.__name__ == "test_func" + + +def test_worker_task_task_ref_name_removal(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @WorkerTask("test_task") + def test_func(param1, param2=10): + return {"result": f"{param1}_{param2}"} + + result: Union[SimpleTask, dict] = test_func( + param1="value1", param2=20, task_ref_name="ref_task" + ) + + assert isinstance(result, SimpleTask) + task_result = cast(SimpleTask, result) + assert hasattr(task_result, "input_parameters") + assert "task_ref_name" not in task_result.input_parameters + + +def test_worker_task_simple_task_ref_name_removal(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @worker_task("test_task") + def test_func(param1, param2=10): + return {"result": f"{param1}_{param2}"} + + result: Union[SimpleTask, dict] = test_func( + param1="value1", param2=20, task_ref_name="ref_task" + ) + + assert isinstance(result, SimpleTask) + task_result = cast(SimpleTask, result) + assert hasattr(task_result, "input_parameters") + assert "task_ref_name" not in task_result.input_parameters + + +def test_worker_task_empty_kwargs(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @WorkerTask("test_task") + def test_func(): + return {"result": "no_params"} + + result: Union[SimpleTask, dict] = test_func(task_ref_name="ref_task") + + assert isinstance(result, SimpleTask) + task_result = cast(SimpleTask, result) + assert hasattr(task_result, "name") + assert hasattr(task_result, "task_reference_name") + assert hasattr(task_result, "input_parameters") + assert task_result.name == "test_task" + assert task_result.task_reference_name == "ref_task" + assert task_result.input_parameters == {} + + +def test_worker_task_simple_empty_kwargs(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @worker_task("test_task") + def test_func(): + return {"result": "no_params"} + + result: Union[SimpleTask, dict] = test_func(task_ref_name="ref_task") + + assert isinstance(result, SimpleTask) + task_result = cast(SimpleTask, result) + assert hasattr(task_result, "name") + assert hasattr(task_result, "task_reference_name") + assert hasattr(task_result, "input_parameters") + assert task_result.name == "test_task" + assert task_result.task_reference_name == "ref_task" + assert task_result.input_parameters == {} + + +def test_worker_task_functools_wraps(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @WorkerTask("test_task") + def test_func(param1: str, param2: int = 10) -> dict: + """Test function docstring""" + return {"result": f"{param1}_{param2}"} + + assert hasattr(test_func, "__wrapped__") + assert test_func.__wrapped__ is not None + + +def test_worker_task_simple_functools_wraps(): + with patch("conductor.client.worker.worker_task.register_decorated_fn"): + + @worker_task("test_task") + def test_func(param1: str, param2: int = 10) -> dict: + """Test function docstring""" + return {"result": f"{param1}_{param2}"} + + assert hasattr(test_func, "__wrapped__") + assert test_func.__wrapped__ is not None