Skip to content

Commit

Permalink
PLAT-1092: Add connection config field to API
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 1bc8e0f7496f6f427edf33ea498e2e8a88eed546
  • Loading branch information
drew committed Sep 20, 2023
1 parent 1f4f30b commit 50fd8ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/gretel_client/rest_v1/models/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class Connection(BaseModel):
"""
Next available tag: 10
Next available tag: 11
"""

id: StrictStr = Field(
Expand All @@ -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."
Expand All @@ -59,6 +63,7 @@ class Connection(BaseModel):
"name",
"validation_status",
"credentials",
"config",
"encrypted_credentials",
"created_at",
"project_id",
Expand Down Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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
9 changes: 7 additions & 2 deletions src/gretel_client/rest_v1/models/update_connection_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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

0 comments on commit 50fd8ed

Please sign in to comment.