Skip to content

Commit

Permalink
workflow python updates for v2.1.122
Browse files Browse the repository at this point in the history
Signed-off-by: Concourse <[email protected]>
  • Loading branch information
Concourse committed Nov 28, 2024
1 parent 5b3a81a commit 9b7e9fa
Show file tree
Hide file tree
Showing 13 changed files with 316 additions and 30 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ This code is automatically generated by the [OpenAPI Generator](https://openapi-

## Versions

- API version: 0.1.1339
- SDK version: 2.1.121
- API version: 0.1.1347
- SDK version: 2.1.122

## Requirements

Expand Down
2 changes: 2 additions & 0 deletions sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Class | Method | HTTP request | Description
- [FailResponse](docs/FailResponse.md)
- [FieldMapping](docs/FieldMapping.md)
- [GetWorkerResultResponse](docs/GetWorkerResultResponse.md)
- [GroupReconciliation](docs/GroupReconciliation.md)
- [GroupReconciliationResponse](docs/GroupReconciliationResponse.md)
- [HealthCheck](docs/HealthCheck.md)
- [HealthCheckResponse](docs/HealthCheckResponse.md)
- [IdSelectorDefinition](docs/IdSelectorDefinition.md)
Expand Down
29 changes: 29 additions & 0 deletions sdk/docs/GroupReconciliation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# GroupReconciliation

Configuration for a Worker that calls runs a Group Reconciliation in LUSID

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | The type of worker |

## Example

```python
from lusid_workflow.models.group_reconciliation import GroupReconciliation

# TODO update the JSON string below
json = "{}"
# create an instance of GroupReconciliation from a JSON string
group_reconciliation_instance = GroupReconciliation.from_json(json)
# print the JSON string representation of the object
print GroupReconciliation.to_json()

# convert the object into a dict
group_reconciliation_dict = group_reconciliation_instance.to_dict()
# create an instance of GroupReconciliation from a dict
group_reconciliation_form_dict = group_reconciliation.from_dict(group_reconciliation_dict)
```
[Back to Model list](../README.md#documentation-for-models) &#8226; [Back to API list](../README.md#documentation-for-api-endpoints) &#8226; [Back to README](../README.md)


29 changes: 29 additions & 0 deletions sdk/docs/GroupReconciliationResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# GroupReconciliationResponse

Readonly configuration for the Group Reconciliation Worker

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | The type of worker | [optional]

## Example

```python
from lusid_workflow.models.group_reconciliation_response import GroupReconciliationResponse

# TODO update the JSON string below
json = "{}"
# create an instance of GroupReconciliationResponse from a JSON string
group_reconciliation_response_instance = GroupReconciliationResponse.from_json(json)
# print the JSON string representation of the object
print GroupReconciliationResponse.to_json()

# convert the object into a dict
group_reconciliation_response_dict = group_reconciliation_response_instance.to_dict()
# create an instance of GroupReconciliationResponse from a dict
group_reconciliation_response_form_dict = group_reconciliation_response.from_dict(group_reconciliation_response_dict)
```
[Back to Model list](../README.md#documentation-for-models) &#8226; [Back to API list](../README.md#documentation-for-api-endpoints) &#8226; [Back to README](../README.md)


4 changes: 4 additions & 0 deletions sdk/lusid_workflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
from lusid_workflow.models.fail_response import FailResponse
from lusid_workflow.models.field_mapping import FieldMapping
from lusid_workflow.models.get_worker_result_response import GetWorkerResultResponse
from lusid_workflow.models.group_reconciliation import GroupReconciliation
from lusid_workflow.models.group_reconciliation_response import GroupReconciliationResponse
from lusid_workflow.models.health_check import HealthCheck
from lusid_workflow.models.health_check_response import HealthCheckResponse
from lusid_workflow.models.id_selector_definition import IdSelectorDefinition
Expand Down Expand Up @@ -171,6 +173,8 @@
"FailResponse",
"FieldMapping",
"GetWorkerResultResponse",
"GroupReconciliation",
"GroupReconciliationResponse",
"HealthCheck",
"HealthCheckResponse",
"IdSelectorDefinition",
Expand Down
2 changes: 1 addition & 1 deletion sdk/lusid_workflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def to_debug_report(self):
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 0.1.1339\n"\
"Version of the API: 0.1.1347\n"\
"SDK Package Version: {package_version}".\
format(env=sys.platform, pyversion=sys.version, package_version=package_version)

Expand Down
4 changes: 4 additions & 0 deletions sdk/lusid_workflow/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
from lusid_workflow.models.fail_response import FailResponse
from lusid_workflow.models.field_mapping import FieldMapping
from lusid_workflow.models.get_worker_result_response import GetWorkerResultResponse
from lusid_workflow.models.group_reconciliation import GroupReconciliation
from lusid_workflow.models.group_reconciliation_response import GroupReconciliationResponse
from lusid_workflow.models.health_check import HealthCheck
from lusid_workflow.models.health_check_response import HealthCheckResponse
from lusid_workflow.models.id_selector_definition import IdSelectorDefinition
Expand Down Expand Up @@ -134,6 +136,8 @@
"FailResponse",
"FieldMapping",
"GetWorkerResultResponse",
"GroupReconciliation",
"GroupReconciliationResponse",
"HealthCheck",
"HealthCheckResponse",
"IdSelectorDefinition",
Expand Down
76 changes: 76 additions & 0 deletions sdk/lusid_workflow/models/group_reconciliation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# coding: utf-8

"""
FINBOURNE Workflow API
FINBOURNE Technology # noqa: E501
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""


from __future__ import annotations
import pprint
import re # noqa: F401
import json


from typing import Any, Dict
from pydantic.v1 import BaseModel, Field, constr, validator

class GroupReconciliation(BaseModel):
"""
Configuration for a Worker that calls runs a Group Reconciliation in LUSID # noqa: E501
"""
type: constr(strict=True, min_length=1) = Field(..., description="The type of worker")
__properties = ["type"]

@validator('type')
def type_validate_enum(cls, value):
"""Validates the enum"""
if value not in ('GroupReconciliation'):
raise ValueError("must be one of enum values ('GroupReconciliation')")
return value

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.dict(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> GroupReconciliation:
"""Create an instance of GroupReconciliation from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self):
"""Returns the dictionary representation of the model using alias"""
_dict = self.dict(by_alias=True,
exclude={
},
exclude_none=True)
return _dict

@classmethod
def from_dict(cls, obj: dict) -> GroupReconciliation:
"""Create an instance of GroupReconciliation from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return GroupReconciliation.parse_obj(obj)

_obj = GroupReconciliation.parse_obj({
"type": obj.get("type")
})
return _obj
84 changes: 84 additions & 0 deletions sdk/lusid_workflow/models/group_reconciliation_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# coding: utf-8

"""
FINBOURNE Workflow API
FINBOURNE Technology # noqa: E501
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""


from __future__ import annotations
import pprint
import re # noqa: F401
import json


from typing import Any, Dict, Optional
from pydantic.v1 import BaseModel, Field, StrictStr, validator

class GroupReconciliationResponse(BaseModel):
"""
Readonly configuration for the Group Reconciliation Worker # noqa: E501
"""
type: Optional[StrictStr] = Field(None, description="The type of worker")
__properties = ["type"]

@validator('type')
def type_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value

if value not in ('GroupReconciliation'):
raise ValueError("must be one of enum values ('GroupReconciliation')")
return value

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.dict(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> GroupReconciliationResponse:
"""Create an instance of GroupReconciliationResponse from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self):
"""Returns the dictionary representation of the model using alias"""
_dict = self.dict(by_alias=True,
exclude={
},
exclude_none=True)
# set to None if type (nullable) is None
# and __fields_set__ contains the field
if self.type is None and "type" in self.__fields_set__:
_dict['type'] = None

return _dict

@classmethod
def from_dict(cls, obj: dict) -> GroupReconciliationResponse:
"""Create an instance of GroupReconciliationResponse from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return GroupReconciliationResponse.parse_obj(obj)

_obj = GroupReconciliationResponse.parse_obj({
"type": obj.get("type")
})
return _obj
34 changes: 24 additions & 10 deletions sdk/lusid_workflow/models/worker_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,34 @@
from typing import Any, List, Optional
from pydantic.v1 import BaseModel, Field, StrictStr, ValidationError, validator
from lusid_workflow.models.fail import Fail
from lusid_workflow.models.group_reconciliation import GroupReconciliation
from lusid_workflow.models.health_check import HealthCheck
from lusid_workflow.models.luminesce_view import LuminesceView
from lusid_workflow.models.scheduler_job import SchedulerJob
from lusid_workflow.models.sleep import Sleep
from typing import Union, Any, List, TYPE_CHECKING
from pydantic.v1 import StrictStr, Field

WORKERCONFIGURATION_ONE_OF_SCHEMAS = ["Fail", "HealthCheck", "LuminesceView", "SchedulerJob", "Sleep"]
WORKERCONFIGURATION_ONE_OF_SCHEMAS = ["Fail", "GroupReconciliation", "HealthCheck", "LuminesceView", "SchedulerJob", "Sleep"]

class WorkerConfiguration(BaseModel):
"""
Information about how the worker should be executed
"""
# data type: Fail
oneof_schema_1_validator: Optional[Fail] = None
# data type: GroupReconciliation
oneof_schema_2_validator: Optional[GroupReconciliation] = None
# data type: HealthCheck
oneof_schema_2_validator: Optional[HealthCheck] = None
oneof_schema_3_validator: Optional[HealthCheck] = None
# data type: LuminesceView
oneof_schema_3_validator: Optional[LuminesceView] = None
oneof_schema_4_validator: Optional[LuminesceView] = None
# data type: SchedulerJob
oneof_schema_4_validator: Optional[SchedulerJob] = None
oneof_schema_5_validator: Optional[SchedulerJob] = None
# data type: Sleep
oneof_schema_5_validator: Optional[Sleep] = None
oneof_schema_6_validator: Optional[Sleep] = None
if TYPE_CHECKING:
actual_instance: Union[Fail, HealthCheck, LuminesceView, SchedulerJob, Sleep]
actual_instance: Union[Fail, GroupReconciliation, HealthCheck, LuminesceView, SchedulerJob, Sleep]
else:
actual_instance: Any
one_of_schemas: List[str] = Field(WORKERCONFIGURATION_ONE_OF_SCHEMAS, const=True)
Expand Down Expand Up @@ -73,6 +76,11 @@ def actual_instance_must_validate_oneof(cls, v):
error_messages.append(f"Error! Input type `{type(v)}` is not `Fail`")
else:
match += 1
# validate data type: GroupReconciliation
if not isinstance(v, GroupReconciliation):
error_messages.append(f"Error! Input type `{type(v)}` is not `GroupReconciliation`")
else:
match += 1
# validate data type: HealthCheck
if not isinstance(v, HealthCheck):
error_messages.append(f"Error! Input type `{type(v)}` is not `HealthCheck`")
Expand All @@ -95,10 +103,10 @@ def actual_instance_must_validate_oneof(cls, v):
match += 1
if match > 1:
# more than 1 match
raise ValueError("Multiple matches found when setting `actual_instance` in WorkerConfiguration with oneOf schemas: Fail, HealthCheck, LuminesceView, SchedulerJob, Sleep. Details: " + ", ".join(error_messages))
raise ValueError("Multiple matches found when setting `actual_instance` in WorkerConfiguration with oneOf schemas: Fail, GroupReconciliation, HealthCheck, LuminesceView, SchedulerJob, Sleep. Details: " + ", ".join(error_messages))
elif match == 0:
# no match
raise ValueError("No match found when setting `actual_instance` in WorkerConfiguration with oneOf schemas: Fail, HealthCheck, LuminesceView, SchedulerJob, Sleep. Details: " + ", ".join(error_messages))
raise ValueError("No match found when setting `actual_instance` in WorkerConfiguration with oneOf schemas: Fail, GroupReconciliation, HealthCheck, LuminesceView, SchedulerJob, Sleep. Details: " + ", ".join(error_messages))
else:
return v

Expand All @@ -119,6 +127,12 @@ def from_json(cls, json_str: str) -> WorkerConfiguration:
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into GroupReconciliation
try:
instance.actual_instance = GroupReconciliation.from_json(json_str)
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into HealthCheck
try:
instance.actual_instance = HealthCheck.from_json(json_str)
Expand Down Expand Up @@ -146,10 +160,10 @@ def from_json(cls, json_str: str) -> WorkerConfiguration:

if match > 1:
# more than 1 match
raise ValueError("Multiple matches found when deserializing the JSON string into WorkerConfiguration with oneOf schemas: Fail, HealthCheck, LuminesceView, SchedulerJob, Sleep. Details: " + ", ".join(error_messages))
raise ValueError("Multiple matches found when deserializing the JSON string into WorkerConfiguration with oneOf schemas: Fail, GroupReconciliation, HealthCheck, LuminesceView, SchedulerJob, Sleep. Details: " + ", ".join(error_messages))
elif match == 0:
# no match
raise ValueError("No match found when deserializing the JSON string into WorkerConfiguration with oneOf schemas: Fail, HealthCheck, LuminesceView, SchedulerJob, Sleep. Details: " + ", ".join(error_messages))
raise ValueError("No match found when deserializing the JSON string into WorkerConfiguration with oneOf schemas: Fail, GroupReconciliation, HealthCheck, LuminesceView, SchedulerJob, Sleep. Details: " + ", ".join(error_messages))
else:
return instance

Expand Down
Loading

0 comments on commit 9b7e9fa

Please sign in to comment.