From 14d8672c35f423f3a985910e0315daa3ac42380d Mon Sep 17 00:00:00 2001 From: Astrid Gealer Date: Sun, 8 Mar 2026 11:27:21 +0000 Subject: [PATCH] chore: Bump version and re-run generation. --- pyproject.toml | 2 +- src/vantage/_async/client.py | 28 ++++++++++++++++++++++++++++ src/vantage/_sync/client.py | 28 ++++++++++++++++++++++++++++ src/vantage/_types.py | 31 ++++++++++++++++++++++++------- 4 files changed, 81 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3cbfbe1..f0eebd5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "vantage-python" -version = "0.4.0" +version = "0.5.0" description = "Python SDK for the Vantage API" readme = "README.md" license = "MIT" diff --git a/src/vantage/_async/client.py b/src/vantage/_async/client.py index 8afce0d..018bb87 100644 --- a/src/vantage/_async/client.py +++ b/src/vantage/_async/client.py @@ -1983,6 +1983,20 @@ async def get(self) -> Me: return Me.model_validate(data) return data + async def update(self, body: UpdateMe) -> Me: + """ + Update authenticated user + + Update the authenticated User. + """ + path = "/v2/me" + params = None + body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body + data = await self._client.request("PUT", path, params=params, body=body_data) + if isinstance(data, dict): + return Me.model_validate(data) + return data + class NetworkFlowReportsAsyncApi: """Async API methods for network_flow_reports resource.""" @@ -2980,6 +2994,20 @@ async def get(self, user_token: str) -> User: return User.model_validate(data) return data + async def update(self, user_token: str, body: UpdateUser) -> User: + """ + Update a user + + Update a specific User. + """ + path = f"/v2/users/{quote(str(user_token), safe='')}" + params = None + body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body + data = await self._client.request("PUT", path, params=params, body=body_data) + if isinstance(data, dict): + return User.model_validate(data) + return data + class VirtualTagConfigsAsyncApi: """Async API methods for virtual_tag_configs resource.""" diff --git a/src/vantage/_sync/client.py b/src/vantage/_sync/client.py index 103881f..14eba16 100644 --- a/src/vantage/_sync/client.py +++ b/src/vantage/_sync/client.py @@ -1983,6 +1983,20 @@ def get(self) -> Me: return Me.model_validate(data) return data + def update(self, body: UpdateMe) -> Me: + """ + Update authenticated user + + Update the authenticated User. + """ + path = "/v2/me" + params = None + body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body + data = self._client.request("PUT", path, params=params, body=body_data) + if isinstance(data, dict): + return Me.model_validate(data) + return data + class NetworkFlowReportsApi: """API methods for network_flow_reports resource.""" @@ -2980,6 +2994,20 @@ def get(self, user_token: str) -> User: return User.model_validate(data) return data + def update(self, user_token: str, body: UpdateUser) -> User: + """ + Update a user + + Update a specific User. + """ + path = f"/v2/users/{quote(str(user_token), safe='')}" + params = None + body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body + data = self._client.request("PUT", path, params=params, body=body_data) + if isinstance(data, dict): + return User.model_validate(data) + return data + class VirtualTagConfigsApi: """API methods for virtual_tag_configs resource.""" diff --git a/src/vantage/_types.py b/src/vantage/_types.py index e95d772..56384af 100644 --- a/src/vantage/_types.py +++ b/src/vantage/_types.py @@ -1176,6 +1176,7 @@ class Me(BaseModel): """Me model""" default_workspace_token: Optional[str] + default_dashboard_token: Optional[str] = Field(default=None, description="The token of the default Dashboard for the User.") workspaces: List[Workspace] bearer_token: BearerToken @@ -1197,6 +1198,12 @@ class BearerToken(BaseModel): scope: List[str] = Field(description="The scopes applied to the BearerToken used to authenticate this request.") +class UpdateMe(BaseModel): + """Update the authenticated User.""" + + default_dashboard_token: Optional[str] = Field(default=None, description="The token of a Dashboard to set as the User default. Send null to clear.") + + class CostProviders(BaseModel): """CostProviders model""" @@ -1672,6 +1679,7 @@ class Team(BaseModel): workspace_tokens: List[str] = Field(description="The tokens for any Workspaces that the Team belongs to") user_emails: List[str] = Field(description="The email addresses for Users that belong to the Team") user_tokens: List[str] = Field(description="The tokens for Users that belong to the Team") + default_dashboard_token: Optional[str] = Field(description="The token of the default Dashboard for the Team.") class CreateTeam(BaseModel): @@ -1683,6 +1691,7 @@ class CreateTeam(BaseModel): user_tokens: Optional[List[str]] = Field(default=None, description="The User tokens to associate to the Team.") user_emails: Optional[List[str]] = Field(default=None, description="The User emails to associate to the Team.") role: Optional[str] = Field(default=None, description="The role to assign to the provided Users. Defaults to 'editor' which has editor permissions.") + default_dashboard_token: Optional[str] = Field(default=None, description="The token of a Dashboard to set as the Team default. Send null to clear.") class UpdateTeam(BaseModel): @@ -1694,6 +1703,7 @@ class UpdateTeam(BaseModel): user_tokens: Optional[List[str]] = Field(default=None, description="The User tokens to associate to the Team.") user_emails: Optional[List[str]] = Field(default=None, description="The User emails to associate to the Team.") role: Optional[str] = Field(default=None, description="The role to assign to the provided Users. Defaults to 'editor' which has editor permissions.") + default_dashboard_token: Optional[str] = Field(default=None, description="The token of a Dashboard to set as the Team default. Send null to clear.") class TeamMembers(BaseModel): @@ -1760,9 +1770,16 @@ class User(BaseModel): name: Optional[str] = Field(description="The name of the User.") email: str = Field(description="The email of the User.") role: str = Field(description="The role of the User.") + default_dashboard_token: Optional[str] = Field(default=None, description="The token of the default Dashboard for the User.") last_seen_at: Optional[str] = Field(default=None, description="The last time the User logged in.") +class UpdateUser(BaseModel): + """Update a specific User.""" + + default_dashboard_token: Optional[str] = Field(default=None, description="The token of a Dashboard to set as the User default. Send null to clear.") + + class VirtualTagConfigs(BaseModel): """VirtualTagConfigs model""" @@ -1847,6 +1864,13 @@ class UpdateVirtualTagConfig(BaseModel): values: Optional[List[VirtualTagConfigValue]] = Field(default=None, description="Values for the VirtualTagConfig, with match precedence determined by order in the list.") +class AsyncVirtualTagConfigUpdate(BaseModel): + """AsyncVirtualTagConfigUpdate model""" + + request_id: str = Field(description="The request ID of the async virtual tag config update.") + status_url: str = Field(description="The status path of the async virtual tag config update.") + + class UpdateAsyncVirtualTagConfig(BaseModel): """Asynchronously updates an existing VirtualTagConfig.""" @@ -1857,13 +1881,6 @@ class UpdateAsyncVirtualTagConfig(BaseModel): values: Optional[List[VirtualTagConfigValue]] = Field(default=None, description="Values for the VirtualTagConfig, with match precedence determined by order in the list.") -class AsyncVirtualTagConfigUpdate(BaseModel): - """AsyncVirtualTagConfigUpdate model""" - - request_id: str = Field(description="The request ID of the async virtual tag config update.") - status_url: str = Field(description="The status path of the async virtual tag config update.") - - class Workspaces(BaseModel): """Workspaces model"""