From 50fd8ed8a0278c817260341cc2eec277573d5fb9 Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Wed, 20 Sep 2023 09:03:26 -0700 Subject: [PATCH] PLAT-1092: Add connection config field to API GitOrigin-RevId: 1bc8e0f7496f6f427edf33ea498e2e8a88eed546 --- src/gretel_client/rest_v1/models/connection.py | 10 ++++++++-- .../rest_v1/models/create_connection_request.py | 4 +++- .../rest_v1/models/update_connection_request.py | 9 +++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/gretel_client/rest_v1/models/connection.py b/src/gretel_client/rest_v1/models/connection.py index 0bc44f09..12162c55 100755 --- a/src/gretel_client/rest_v1/models/connection.py +++ b/src/gretel_client/rest_v1/models/connection.py @@ -26,7 +26,7 @@ class Connection(BaseModel): """ - Next available tag: 10 + Next available tag: 11 """ id: StrictStr = Field( @@ -41,7 +41,11 @@ class Connection(BaseModel): ..., description="Validation status: COMPLETED, ERROR, NONE." ) credentials: Optional[Dict[str, Any]] = Field( - None, description="Connection credentials." + None, + description="Connection credentials. These values are encrypted and can only be decrypted from the data plane.", + ) + config: Optional[Dict[str, Any]] = Field( + None, description="Connection config. These values are returned by the API." ) encrypted_credentials: Optional[Dict[str, Any]] = Field( None, description="Connection credentials in encrypted form." @@ -59,6 +63,7 @@ class Connection(BaseModel): "name", "validation_status", "credentials", + "config", "encrypted_credentials", "created_at", "project_id", @@ -119,6 +124,7 @@ def from_dict(cls, obj: dict) -> Connection: "name": obj.get("name"), "validation_status": obj.get("validation_status"), "credentials": obj.get("credentials"), + "config": obj.get("config"), "encrypted_credentials": obj.get("encrypted_credentials"), "created_at": obj.get("created_at"), "project_id": obj.get("project_id"), diff --git a/src/gretel_client/rest_v1/models/create_connection_request.py b/src/gretel_client/rest_v1/models/create_connection_request.py index 139bb0ac..cebc7993 100755 --- a/src/gretel_client/rest_v1/models/create_connection_request.py +++ b/src/gretel_client/rest_v1/models/create_connection_request.py @@ -32,7 +32,8 @@ class CreateConnectionRequest(BaseModel): name: Optional[StrictStr] = None type: StrictStr = Field(...) credentials: Dict[str, Any] = Field(...) - __properties = ["project_id", "name", "type", "credentials"] + config: Optional[Dict[str, Any]] = None + __properties = ["project_id", "name", "type", "credentials", "config"] class Config: """Pydantic configuration""" @@ -73,6 +74,7 @@ def from_dict(cls, obj: dict) -> CreateConnectionRequest: "name": obj.get("name"), "type": obj.get("type"), "credentials": obj.get("credentials"), + "config": obj.get("config"), } ) return _obj diff --git a/src/gretel_client/rest_v1/models/update_connection_request.py b/src/gretel_client/rest_v1/models/update_connection_request.py index 4b101f22..60b7ca25 100755 --- a/src/gretel_client/rest_v1/models/update_connection_request.py +++ b/src/gretel_client/rest_v1/models/update_connection_request.py @@ -30,7 +30,8 @@ class UpdateConnectionRequest(BaseModel): name: Optional[StrictStr] = None credentials: Optional[Dict[str, Any]] = None - __properties = ["name", "credentials"] + config: Optional[Dict[str, Any]] = None + __properties = ["name", "credentials", "config"] class Config: """Pydantic configuration""" @@ -66,6 +67,10 @@ def from_dict(cls, obj: dict) -> UpdateConnectionRequest: return UpdateConnectionRequest.parse_obj(obj) _obj = UpdateConnectionRequest.parse_obj( - {"name": obj.get("name"), "credentials": obj.get("credentials")} + { + "name": obj.get("name"), + "credentials": obj.get("credentials"), + "config": obj.get("config"), + } ) return _obj