# coding: utf-8
"""
Amorphic Data Platform
Amorphic Data Platform - API Definition documentation
The version of the OpenAPI document: 0.3.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from openapi_client.models.dataset_access import DatasetAccess
from openapi_client.models.domain_access import DomainAccess
from openapi_client.models.tbac_tag import TbacTag
from typing import Optional, Set
from typing_extensions import Self
[docs]
class ETLJobPost(BaseModel):
"""
ETLJobPost
""" # noqa: E501
job_name: Optional[StrictStr] = Field(default=None, alias="JobName")
description: Optional[StrictStr] = Field(default=None, alias="Description")
allocated_capacity: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="AllocatedCapacity")
default_arguments: Optional[Dict[str, StrictStr]] = Field(default=None, alias="DefaultArguments")
etl_job_type: Optional[StrictStr] = Field(default=None, alias="ETLJobType")
dataset_access: Optional[DatasetAccess] = Field(default=None, alias="DatasetAccess")
tags_attached: Optional[List[TbacTag]] = Field(default=None, alias="TagsAttached")
parameter_access: Optional[List[StrictStr]] = Field(default=None, alias="ParameterAccess")
max_retries: Optional[StrictInt] = Field(default=None, alias="MaxRetries")
timeout: Optional[StrictInt] = Field(default=None, alias="Timeout")
max_concurrent_runs: Optional[StrictInt] = Field(default=None, alias="MaxConcurrentRuns")
notify_delay_after: Optional[StrictInt] = Field(default=None, alias="NotifyDelayAfter")
python_version: Optional[StrictStr] = Field(default=None, alias="PythonVersion")
glue_version: Optional[StrictStr] = Field(default=None, alias="GlueVersion")
worker_type: Optional[StrictStr] = Field(default=None, alias="WorkerType")
number_of_workers: Optional[StrictInt] = Field(default=None, alias="NumberOfWorkers")
network_configuration: Optional[StrictStr] = Field(default=None, alias="NetworkConfiguration")
domain_access: Optional[DomainAccess] = Field(default=None, alias="DomainAccess")
is_auto_scaling_enabled: Optional[StrictBool] = Field(default=None, alias="IsAutoScalingEnabled")
is_data_lineage_enabled: Optional[StrictStr] = Field(default=None, alias="IsDataLineageEnabled")
__properties: ClassVar[List[str]] = ["JobName", "Description", "AllocatedCapacity", "DefaultArguments", "ETLJobType", "DatasetAccess", "TagsAttached", "ParameterAccess", "MaxRetries", "Timeout", "MaxConcurrentRuns", "NotifyDelayAfter", "PythonVersion", "GlueVersion", "WorkerType", "NumberOfWorkers", "NetworkConfiguration", "DomainAccess", "IsAutoScalingEnabled", "IsDataLineageEnabled"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
[docs]
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
[docs]
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
[docs]
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of ETLJobPost from a JSON string"""
return cls.from_dict(json.loads(json_str))
[docs]
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of dataset_access
if self.dataset_access:
_dict['DatasetAccess'] = self.dataset_access.to_dict()
# override the default output from pydantic by calling `to_dict()` of each item in tags_attached (list)
_items = []
if self.tags_attached:
for _item_tags_attached in self.tags_attached:
if _item_tags_attached:
_items.append(_item_tags_attached.to_dict())
_dict['TagsAttached'] = _items
# override the default output from pydantic by calling `to_dict()` of domain_access
if self.domain_access:
_dict['DomainAccess'] = self.domain_access.to_dict()
return _dict
[docs]
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of ETLJobPost from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"JobName": obj.get("JobName"),
"Description": obj.get("Description"),
"AllocatedCapacity": obj.get("AllocatedCapacity"),
"DefaultArguments": obj.get("DefaultArguments"),
"ETLJobType": obj.get("ETLJobType"),
"DatasetAccess": DatasetAccess.from_dict(obj["DatasetAccess"]) if obj.get("DatasetAccess") is not None else None,
"TagsAttached": [TbacTag.from_dict(_item) for _item in obj["TagsAttached"]] if obj.get("TagsAttached") is not None else None,
"ParameterAccess": obj.get("ParameterAccess"),
"MaxRetries": obj.get("MaxRetries"),
"Timeout": obj.get("Timeout"),
"MaxConcurrentRuns": obj.get("MaxConcurrentRuns"),
"NotifyDelayAfter": obj.get("NotifyDelayAfter"),
"PythonVersion": obj.get("PythonVersion"),
"GlueVersion": obj.get("GlueVersion"),
"WorkerType": obj.get("WorkerType"),
"NumberOfWorkers": obj.get("NumberOfWorkers"),
"NetworkConfiguration": obj.get("NetworkConfiguration"),
"DomainAccess": DomainAccess.from_dict(obj["DomainAccess"]) if obj.get("DomainAccess") is not None else None,
"IsAutoScalingEnabled": obj.get("IsAutoScalingEnabled"),
"IsDataLineageEnabled": obj.get("IsDataLineageEnabled")
})
return _obj