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
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
20 changes: 20 additions & 0 deletions robosystems_client/models/graph_subscription_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]:
Expand Down Expand Up @@ -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(
Expand All @@ -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

Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
Loading