Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/otari/_client/models/activation_api_key_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class ActivationApiKeyPublic(BaseModel):
key_id: StrictStr
key_name: Optional[StrictStr]
key_prefix: Optional[StrictStr]
__properties: ClassVar[List[str]] = ["key", "key_id", "key_name", "key_prefix"]
key_suffix: Optional[StrictStr]
__properties: ClassVar[List[str]] = ["key", "key_id", "key_name", "key_prefix", "key_suffix"]

model_config = ConfigDict(
validate_by_name=True,
Expand Down Expand Up @@ -82,6 +83,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.key_prefix is None and "key_prefix" in self.model_fields_set:
_dict['key_prefix'] = None

# set to None if key_suffix (nullable) is None
# and model_fields_set contains the field
if self.key_suffix is None and "key_suffix" in self.model_fields_set:
_dict['key_suffix'] = None

return _dict

@classmethod
Expand All @@ -97,7 +103,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"key": obj.get("key"),
"key_id": obj.get("key_id"),
"key_name": obj.get("key_name"),
"key_prefix": obj.get("key_prefix")
"key_prefix": obj.get("key_prefix"),
"key_suffix": obj.get("key_suffix")
})
return _obj

Expand Down
9 changes: 8 additions & 1 deletion src/otari/_client/models/create_key_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ class CreateKeyResponse(BaseModel):
key: StrictStr
key_name: Optional[StrictStr]
key_prefix: Optional[StrictStr]
key_suffix: Optional[StrictStr]
metadata: Dict[str, Any]
reject_user_mismatch: Optional[StrictBool]
user_id: Optional[StrictStr]
__properties: ClassVar[List[str]] = ["allowed_models", "capture_agent_telemetry", "created_at", "exclude_from_budget", "expires_at", "id", "is_active", "key", "key_name", "key_prefix", "metadata", "reject_user_mismatch", "user_id"]
__properties: ClassVar[List[str]] = ["allowed_models", "capture_agent_telemetry", "created_at", "exclude_from_budget", "expires_at", "id", "is_active", "key", "key_name", "key_prefix", "key_suffix", "metadata", "reject_user_mismatch", "user_id"]

model_config = ConfigDict(
validate_by_name=True,
Expand Down Expand Up @@ -106,6 +107,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.key_prefix is None and "key_prefix" in self.model_fields_set:
_dict['key_prefix'] = None

# set to None if key_suffix (nullable) is None
# and model_fields_set contains the field
if self.key_suffix is None and "key_suffix" in self.model_fields_set:
_dict['key_suffix'] = None

# set to None if reject_user_mismatch (nullable) is None
# and model_fields_set contains the field
if self.reject_user_mismatch is None and "reject_user_mismatch" in self.model_fields_set:
Expand Down Expand Up @@ -138,6 +144,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"key": obj.get("key"),
"key_name": obj.get("key_name"),
"key_prefix": obj.get("key_prefix"),
"key_suffix": obj.get("key_suffix"),
"metadata": obj.get("metadata"),
"reject_user_mismatch": obj.get("reject_user_mismatch"),
"user_id": obj.get("user_id")
Expand Down
9 changes: 8 additions & 1 deletion src/otari/_client/models/key_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ class KeyInfo(BaseModel):
is_active: StrictBool
key_name: Optional[StrictStr]
key_prefix: Optional[StrictStr]
key_suffix: Optional[StrictStr]
last_used_at: Optional[StrictStr]
metadata: Dict[str, Any]
reject_user_mismatch: Optional[StrictBool]
user_id: Optional[StrictStr]
workspace_id: UUID
__properties: ClassVar[List[str]] = ["allowed_models", "capture_agent_telemetry", "created_at", "exclude_from_budget", "expires_at", "id", "is_active", "key_name", "key_prefix", "last_used_at", "metadata", "reject_user_mismatch", "user_id", "workspace_id"]
__properties: ClassVar[List[str]] = ["allowed_models", "capture_agent_telemetry", "created_at", "exclude_from_budget", "expires_at", "id", "is_active", "key_name", "key_prefix", "key_suffix", "last_used_at", "metadata", "reject_user_mismatch", "user_id", "workspace_id"]

model_config = ConfigDict(
validate_by_name=True,
Expand Down Expand Up @@ -108,6 +109,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.key_prefix is None and "key_prefix" in self.model_fields_set:
_dict['key_prefix'] = None

# set to None if key_suffix (nullable) is None
# and model_fields_set contains the field
if self.key_suffix is None and "key_suffix" in self.model_fields_set:
_dict['key_suffix'] = None

# set to None if last_used_at (nullable) is None
# and model_fields_set contains the field
if self.last_used_at is None and "last_used_at" in self.model_fields_set:
Expand Down Expand Up @@ -144,6 +150,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"is_active": obj.get("is_active"),
"key_name": obj.get("key_name"),
"key_prefix": obj.get("key_prefix"),
"key_suffix": obj.get("key_suffix"),
"last_used_at": obj.get("last_used_at"),
"metadata": obj.get("metadata"),
"reject_user_mismatch": obj.get("reject_user_mismatch"),
Expand Down
Loading