vectorize_client.models.pipeline_configuration_schema
Vectorize API (Beta)
API for Vectorize services
The version of the OpenAPI document: 0.0.1 Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
1# coding: utf-8 2 3""" 4 Vectorize API (Beta) 5 6 API for Vectorize services 7 8 The version of the OpenAPI document: 0.0.1 9 Generated by OpenAPI Generator (https://openapi-generator.tech) 10 11 Do not edit the class manually. 12""" # noqa: E501 13 14 15from __future__ import annotations 16import pprint 17import re # noqa: F401 18import json 19 20from pydantic import BaseModel, ConfigDict, Field 21from typing import Any, ClassVar, Dict, List 22from typing_extensions import Annotated 23from vectorize_client.models.ai_platform_schema import AIPlatformSchema 24from vectorize_client.models.destination_connector_schema import DestinationConnectorSchema 25from vectorize_client.models.schedule_schema import ScheduleSchema 26from vectorize_client.models.source_connector_schema import SourceConnectorSchema 27from typing import Optional, Set 28from typing_extensions import Self 29 30class PipelineConfigurationSchema(BaseModel): 31 """ 32 PipelineConfigurationSchema 33 """ # noqa: E501 34 source_connectors: Annotated[List[SourceConnectorSchema], Field(min_length=1)] = Field(alias="sourceConnectors") 35 destination_connector: DestinationConnectorSchema = Field(alias="destinationConnector") 36 ai_platform: AIPlatformSchema = Field(alias="aiPlatform") 37 pipeline_name: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="pipelineName") 38 schedule: ScheduleSchema 39 __properties: ClassVar[List[str]] = ["sourceConnectors", "destinationConnector", "aiPlatform", "pipelineName", "schedule"] 40 41 model_config = ConfigDict( 42 populate_by_name=True, 43 validate_assignment=True, 44 protected_namespaces=(), 45 ) 46 47 48 def to_str(self) -> str: 49 """Returns the string representation of the model using alias""" 50 return pprint.pformat(self.model_dump(by_alias=True)) 51 52 def to_json(self) -> str: 53 """Returns the JSON representation of the model using alias""" 54 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 55 return json.dumps(self.to_dict()) 56 57 @classmethod 58 def from_json(cls, json_str: str) -> Optional[Self]: 59 """Create an instance of PipelineConfigurationSchema from a JSON string""" 60 return cls.from_dict(json.loads(json_str)) 61 62 def to_dict(self) -> Dict[str, Any]: 63 """Return the dictionary representation of the model using alias. 64 65 This has the following differences from calling pydantic's 66 `self.model_dump(by_alias=True)`: 67 68 * `None` is only added to the output dict for nullable fields that 69 were set at model initialization. Other fields with value `None` 70 are ignored. 71 """ 72 excluded_fields: Set[str] = set([ 73 ]) 74 75 _dict = self.model_dump( 76 by_alias=True, 77 exclude=excluded_fields, 78 exclude_none=True, 79 ) 80 # override the default output from pydantic by calling `to_dict()` of each item in source_connectors (list) 81 _items = [] 82 if self.source_connectors: 83 for _item_source_connectors in self.source_connectors: 84 if _item_source_connectors: 85 _items.append(_item_source_connectors.to_dict()) 86 _dict['sourceConnectors'] = _items 87 # override the default output from pydantic by calling `to_dict()` of destination_connector 88 if self.destination_connector: 89 _dict['destinationConnector'] = self.destination_connector.to_dict() 90 # override the default output from pydantic by calling `to_dict()` of ai_platform 91 if self.ai_platform: 92 _dict['aiPlatform'] = self.ai_platform.to_dict() 93 # override the default output from pydantic by calling `to_dict()` of schedule 94 if self.schedule: 95 _dict['schedule'] = self.schedule.to_dict() 96 return _dict 97 98 @classmethod 99 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 100 """Create an instance of PipelineConfigurationSchema from a dict""" 101 if obj is None: 102 return None 103 104 if not isinstance(obj, dict): 105 return cls.model_validate(obj) 106 107 _obj = cls.model_validate({ 108 "sourceConnectors": [SourceConnectorSchema.from_dict(_item) for _item in obj["sourceConnectors"]] if obj.get("sourceConnectors") is not None else None, 109 "destinationConnector": DestinationConnectorSchema.from_dict(obj["destinationConnector"]) if obj.get("destinationConnector") is not None else None, 110 "aiPlatform": AIPlatformSchema.from_dict(obj["aiPlatform"]) if obj.get("aiPlatform") is not None else None, 111 "pipelineName": obj.get("pipelineName"), 112 "schedule": ScheduleSchema.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None 113 }) 114 return _obj
class
PipelineConfigurationSchema(pydantic.main.BaseModel):
31class PipelineConfigurationSchema(BaseModel): 32 """ 33 PipelineConfigurationSchema 34 """ # noqa: E501 35 source_connectors: Annotated[List[SourceConnectorSchema], Field(min_length=1)] = Field(alias="sourceConnectors") 36 destination_connector: DestinationConnectorSchema = Field(alias="destinationConnector") 37 ai_platform: AIPlatformSchema = Field(alias="aiPlatform") 38 pipeline_name: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="pipelineName") 39 schedule: ScheduleSchema 40 __properties: ClassVar[List[str]] = ["sourceConnectors", "destinationConnector", "aiPlatform", "pipelineName", "schedule"] 41 42 model_config = ConfigDict( 43 populate_by_name=True, 44 validate_assignment=True, 45 protected_namespaces=(), 46 ) 47 48 49 def to_str(self) -> str: 50 """Returns the string representation of the model using alias""" 51 return pprint.pformat(self.model_dump(by_alias=True)) 52 53 def to_json(self) -> str: 54 """Returns the JSON representation of the model using alias""" 55 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 56 return json.dumps(self.to_dict()) 57 58 @classmethod 59 def from_json(cls, json_str: str) -> Optional[Self]: 60 """Create an instance of PipelineConfigurationSchema from a JSON string""" 61 return cls.from_dict(json.loads(json_str)) 62 63 def to_dict(self) -> Dict[str, Any]: 64 """Return the dictionary representation of the model using alias. 65 66 This has the following differences from calling pydantic's 67 `self.model_dump(by_alias=True)`: 68 69 * `None` is only added to the output dict for nullable fields that 70 were set at model initialization. Other fields with value `None` 71 are ignored. 72 """ 73 excluded_fields: Set[str] = set([ 74 ]) 75 76 _dict = self.model_dump( 77 by_alias=True, 78 exclude=excluded_fields, 79 exclude_none=True, 80 ) 81 # override the default output from pydantic by calling `to_dict()` of each item in source_connectors (list) 82 _items = [] 83 if self.source_connectors: 84 for _item_source_connectors in self.source_connectors: 85 if _item_source_connectors: 86 _items.append(_item_source_connectors.to_dict()) 87 _dict['sourceConnectors'] = _items 88 # override the default output from pydantic by calling `to_dict()` of destination_connector 89 if self.destination_connector: 90 _dict['destinationConnector'] = self.destination_connector.to_dict() 91 # override the default output from pydantic by calling `to_dict()` of ai_platform 92 if self.ai_platform: 93 _dict['aiPlatform'] = self.ai_platform.to_dict() 94 # override the default output from pydantic by calling `to_dict()` of schedule 95 if self.schedule: 96 _dict['schedule'] = self.schedule.to_dict() 97 return _dict 98 99 @classmethod 100 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 101 """Create an instance of PipelineConfigurationSchema from a dict""" 102 if obj is None: 103 return None 104 105 if not isinstance(obj, dict): 106 return cls.model_validate(obj) 107 108 _obj = cls.model_validate({ 109 "sourceConnectors": [SourceConnectorSchema.from_dict(_item) for _item in obj["sourceConnectors"]] if obj.get("sourceConnectors") is not None else None, 110 "destinationConnector": DestinationConnectorSchema.from_dict(obj["destinationConnector"]) if obj.get("destinationConnector") is not None else None, 111 "aiPlatform": AIPlatformSchema.from_dict(obj["aiPlatform"]) if obj.get("aiPlatform") is not None else None, 112 "pipelineName": obj.get("pipelineName"), 113 "schedule": ScheduleSchema.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None 114 }) 115 return _obj
PipelineConfigurationSchema
source_connectors: Annotated[List[vectorize_client.models.source_connector_schema.SourceConnectorSchema], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])]
destination_connector: vectorize_client.models.destination_connector_schema.DestinationConnectorSchema
pipeline_name: typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True), MinLen(min_length=1)])]
model_config =
{'populate_by_name': True, 'validate_assignment': True, 'protected_namespaces': ()}
Configuration for the model, should be a dictionary conforming to [ConfigDict
][pydantic.config.ConfigDict].
def
to_str(self) -> str:
49 def to_str(self) -> str: 50 """Returns the string representation of the model using alias""" 51 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
def
to_json(self) -> str:
53 def to_json(self) -> str: 54 """Returns the JSON representation of the model using alias""" 55 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 56 return json.dumps(self.to_dict())
Returns the JSON representation of the model using alias
@classmethod
def
from_json(cls, json_str: str) -> Optional[Self]:
58 @classmethod 59 def from_json(cls, json_str: str) -> Optional[Self]: 60 """Create an instance of PipelineConfigurationSchema from a JSON string""" 61 return cls.from_dict(json.loads(json_str))
Create an instance of PipelineConfigurationSchema from a JSON string
def
to_dict(self) -> Dict[str, Any]:
63 def to_dict(self) -> Dict[str, Any]: 64 """Return the dictionary representation of the model using alias. 65 66 This has the following differences from calling pydantic's 67 `self.model_dump(by_alias=True)`: 68 69 * `None` is only added to the output dict for nullable fields that 70 were set at model initialization. Other fields with value `None` 71 are ignored. 72 """ 73 excluded_fields: Set[str] = set([ 74 ]) 75 76 _dict = self.model_dump( 77 by_alias=True, 78 exclude=excluded_fields, 79 exclude_none=True, 80 ) 81 # override the default output from pydantic by calling `to_dict()` of each item in source_connectors (list) 82 _items = [] 83 if self.source_connectors: 84 for _item_source_connectors in self.source_connectors: 85 if _item_source_connectors: 86 _items.append(_item_source_connectors.to_dict()) 87 _dict['sourceConnectors'] = _items 88 # override the default output from pydantic by calling `to_dict()` of destination_connector 89 if self.destination_connector: 90 _dict['destinationConnector'] = self.destination_connector.to_dict() 91 # override the default output from pydantic by calling `to_dict()` of ai_platform 92 if self.ai_platform: 93 _dict['aiPlatform'] = self.ai_platform.to_dict() 94 # override the default output from pydantic by calling `to_dict()` of schedule 95 if self.schedule: 96 _dict['schedule'] = self.schedule.to_dict() 97 return _dict
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 valueNone
are ignored.
@classmethod
def
from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99 @classmethod 100 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 101 """Create an instance of PipelineConfigurationSchema from a dict""" 102 if obj is None: 103 return None 104 105 if not isinstance(obj, dict): 106 return cls.model_validate(obj) 107 108 _obj = cls.model_validate({ 109 "sourceConnectors": [SourceConnectorSchema.from_dict(_item) for _item in obj["sourceConnectors"]] if obj.get("sourceConnectors") is not None else None, 110 "destinationConnector": DestinationConnectorSchema.from_dict(obj["destinationConnector"]) if obj.get("destinationConnector") is not None else None, 111 "aiPlatform": AIPlatformSchema.from_dict(obj["aiPlatform"]) if obj.get("aiPlatform") is not None else None, 112 "pipelineName": obj.get("pipelineName"), 113 "schedule": ScheduleSchema.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None 114 }) 115 return _obj
Create an instance of PipelineConfigurationSchema from a dict