From 09ea2862320d9d27c19005de3c2ced2c0aafda69 Mon Sep 17 00:00:00 2001 From: "Joseph T. French" Date: Sun, 5 Apr 2026 23:38:19 -0500 Subject: [PATCH] Remove change repository plan API endpoint and related models - Deleted the `change_repository_plan.py` file, which included the implementation for upgrading or downgrading shared repository subscription plans. - Updated the `get_graph_subscription.py` file to reflect changes in the subscription retrieval documentation, clarifying that it now handles both graph and shared repository subscriptions. - Enhanced the `GraphSubscriptionResponse` model by adding an `operation_id` field for tracking asynchronous tier changes. These changes streamline the API by removing unused functionality and improving the clarity of existing endpoints. --- ...ry_plan.py => change_subscription_plan.py} | 88 ++++++++++++------- .../subscriptions/get_graph_subscription.py | 8 +- .../models/graph_subscription_response.py | 20 +++++ 3 files changed, 80 insertions(+), 36 deletions(-) rename robosystems_client/api/subscriptions/{change_repository_plan.py => change_subscription_plan.py} (64%) diff --git a/robosystems_client/api/subscriptions/change_repository_plan.py b/robosystems_client/api/subscriptions/change_subscription_plan.py similarity index 64% rename from robosystems_client/api/subscriptions/change_repository_plan.py rename to robosystems_client/api/subscriptions/change_subscription_plan.py index cf28ffb..42cc832 100644 --- a/robosystems_client/api/subscriptions/change_repository_plan.py +++ b/robosystems_client/api/subscriptions/change_subscription_plan.py @@ -78,23 +78,29 @@ def sync_detailed( client: AuthenticatedClient, body: UpgradeSubscriptionRequest, ) -> Response[Any | GraphSubscriptionResponse | HTTPValidationError]: - """Change Repository Plan + """Change Subscription Plan - Upgrade or downgrade a shared repository subscription plan. + Change the plan on an existing subscription. - Changes the plan on an existing subscription (e.g., SEC starter -> advanced). - Stripe handles proration automatically. + **For shared repositories** (sec, industry, etc.): Changes access tier (e.g., starter -> advanced). + Synchronous — takes effect immediately. - **Only for shared repositories** - graph subscriptions do not support plan changes - (cancel and re-subscribe instead). + **For user graphs** (kg*): Changes infrastructure tier (e.g., ladybug-standard -> ladybug-large). + Asynchronous — returns an `operation_id` for tracking the EBS volume migration via SSE. + + Stripe handles proration automatically for both types. **Requirements:** - User must be an OWNER of their organization - Subscription must be active - - New plan must exist in the repository's manifest + - New plan must be valid for the resource type + + **Downgrade restrictions (graphs only):** + - Subgraph count must fit the target tier's limit + - Storage usage must fit the target tier's limit Args: - graph_id (str): Repository name (e.g., 'sec') + graph_id (str): Graph ID or repository name body (UpgradeSubscriptionRequest): Request to upgrade a subscription. Raises: @@ -123,23 +129,29 @@ def sync( client: AuthenticatedClient, body: UpgradeSubscriptionRequest, ) -> Any | GraphSubscriptionResponse | HTTPValidationError | None: - """Change Repository Plan + """Change Subscription Plan - Upgrade or downgrade a shared repository subscription plan. + Change the plan on an existing subscription. - Changes the plan on an existing subscription (e.g., SEC starter -> advanced). - Stripe handles proration automatically. + **For shared repositories** (sec, industry, etc.): Changes access tier (e.g., starter -> advanced). + Synchronous — takes effect immediately. - **Only for shared repositories** - graph subscriptions do not support plan changes - (cancel and re-subscribe instead). + **For user graphs** (kg*): Changes infrastructure tier (e.g., ladybug-standard -> ladybug-large). + Asynchronous — returns an `operation_id` for tracking the EBS volume migration via SSE. + + Stripe handles proration automatically for both types. **Requirements:** - User must be an OWNER of their organization - Subscription must be active - - New plan must exist in the repository's manifest + - New plan must be valid for the resource type + + **Downgrade restrictions (graphs only):** + - Subgraph count must fit the target tier's limit + - Storage usage must fit the target tier's limit Args: - graph_id (str): Repository name (e.g., 'sec') + graph_id (str): Graph ID or repository name body (UpgradeSubscriptionRequest): Request to upgrade a subscription. Raises: @@ -163,23 +175,29 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpgradeSubscriptionRequest, ) -> Response[Any | GraphSubscriptionResponse | HTTPValidationError]: - """Change Repository Plan + """Change Subscription Plan - Upgrade or downgrade a shared repository subscription plan. + Change the plan on an existing subscription. - Changes the plan on an existing subscription (e.g., SEC starter -> advanced). - Stripe handles proration automatically. + **For shared repositories** (sec, industry, etc.): Changes access tier (e.g., starter -> advanced). + Synchronous — takes effect immediately. - **Only for shared repositories** - graph subscriptions do not support plan changes - (cancel and re-subscribe instead). + **For user graphs** (kg*): Changes infrastructure tier (e.g., ladybug-standard -> ladybug-large). + Asynchronous — returns an `operation_id` for tracking the EBS volume migration via SSE. + + Stripe handles proration automatically for both types. **Requirements:** - User must be an OWNER of their organization - Subscription must be active - - New plan must exist in the repository's manifest + - New plan must be valid for the resource type + + **Downgrade restrictions (graphs only):** + - Subgraph count must fit the target tier's limit + - Storage usage must fit the target tier's limit Args: - graph_id (str): Repository name (e.g., 'sec') + graph_id (str): Graph ID or repository name body (UpgradeSubscriptionRequest): Request to upgrade a subscription. Raises: @@ -206,23 +224,29 @@ async def asyncio( client: AuthenticatedClient, body: UpgradeSubscriptionRequest, ) -> Any | GraphSubscriptionResponse | HTTPValidationError | None: - """Change Repository Plan + """Change Subscription Plan - Upgrade or downgrade a shared repository subscription plan. + Change the plan on an existing subscription. - Changes the plan on an existing subscription (e.g., SEC starter -> advanced). - Stripe handles proration automatically. + **For shared repositories** (sec, industry, etc.): Changes access tier (e.g., starter -> advanced). + Synchronous — takes effect immediately. - **Only for shared repositories** - graph subscriptions do not support plan changes - (cancel and re-subscribe instead). + **For user graphs** (kg*): Changes infrastructure tier (e.g., ladybug-standard -> ladybug-large). + Asynchronous — returns an `operation_id` for tracking the EBS volume migration via SSE. + + Stripe handles proration automatically for both types. **Requirements:** - User must be an OWNER of their organization - Subscription must be active - - New plan must exist in the repository's manifest + - New plan must be valid for the resource type + + **Downgrade restrictions (graphs only):** + - Subgraph count must fit the target tier's limit + - Storage usage must fit the target tier's limit Args: - graph_id (str): Repository name (e.g., 'sec') + graph_id (str): Graph ID or repository name body (UpgradeSubscriptionRequest): Request to upgrade a subscription. Raises: diff --git a/robosystems_client/api/subscriptions/get_graph_subscription.py b/robosystems_client/api/subscriptions/get_graph_subscription.py index f25ea6d..5806a27 100644 --- a/robosystems_client/api/subscriptions/get_graph_subscription.py +++ b/robosystems_client/api/subscriptions/get_graph_subscription.py @@ -63,7 +63,7 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[Any | GraphSubscriptionResponse | HTTPValidationError]: - """Get Subscription + """Get Graph and Shared Repository Subscription Get subscription details for a graph or shared repository. @@ -101,7 +101,7 @@ def sync( *, client: AuthenticatedClient, ) -> Any | GraphSubscriptionResponse | HTTPValidationError | None: - """Get Subscription + """Get Graph and Shared Repository Subscription Get subscription details for a graph or shared repository. @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[Any | GraphSubscriptionResponse | HTTPValidationError]: - """Get Subscription + """Get Graph and Shared Repository Subscription Get subscription details for a graph or shared repository. @@ -170,7 +170,7 @@ async def asyncio( *, client: AuthenticatedClient, ) -> Any | GraphSubscriptionResponse | HTTPValidationError | None: - """Get Subscription + """Get Graph and Shared Repository Subscription Get subscription details for a graph or shared repository. diff --git a/robosystems_client/models/graph_subscription_response.py b/robosystems_client/models/graph_subscription_response.py index 0d231c1..e45515a 100644 --- a/robosystems_client/models/graph_subscription_response.py +++ b/robosystems_client/models/graph_subscription_response.py @@ -31,6 +31,7 @@ class GraphSubscriptionResponse: canceled_at (None | str | Unset): Cancellation date ends_at (None | str | Unset): Subscription end date (when access will be revoked, especially relevant for cancelled subscriptions) + operation_id (None | str | Unset): Operation ID for tracking async tier changes via SSE """ id: str @@ -47,6 +48,7 @@ class GraphSubscriptionResponse: started_at: None | str | Unset = UNSET canceled_at: None | str | Unset = UNSET ends_at: None | str | Unset = UNSET + operation_id: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -98,6 +100,12 @@ def to_dict(self) -> dict[str, Any]: else: ends_at = self.ends_at + operation_id: None | str | Unset + if isinstance(self.operation_id, Unset): + operation_id = UNSET + else: + operation_id = self.operation_id + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -123,6 +131,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["canceled_at"] = canceled_at if ends_at is not UNSET: field_dict["ends_at"] = ends_at + if operation_id is not UNSET: + field_dict["operation_id"] = operation_id return field_dict @@ -194,6 +204,15 @@ def _parse_ends_at(data: object) -> None | str | Unset: ends_at = _parse_ends_at(d.pop("ends_at", UNSET)) + def _parse_operation_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + operation_id = _parse_operation_id(d.pop("operation_id", UNSET)) + graph_subscription_response = cls( id=id, resource_type=resource_type, @@ -209,6 +228,7 @@ def _parse_ends_at(data: object) -> None | str | Unset: started_at=started_at, canceled_at=canceled_at, ends_at=ends_at, + operation_id=operation_id, ) graph_subscription_response.additional_properties = d