Skip to content

Commit 5c5a76f

Browse files
author
Marian Ganisin
committed
plan_upgrade and access to account from Tenant
Interface for new call plan_upgrade in Tenant. Interface to get account directly from Tenant, not necessary to search by name.
1 parent c7b5dc0 commit 5c5a76f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

threescale_api/resources.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,18 @@ def trigger_billing_account(self, account: Union['Account', int], date: str) ->
12761276
"""
12771277
return self.threescale_client.tenants.trigger_billing_account(self, account, date)
12781278

1279+
def plan_upgrade(self, plan_id):
1280+
"""Upgrade plan to given plan_id"""
1281+
return self.client.rest.put(f"{self.url}/plan_upgrade", params={"plan_id": plan_id})
1282+
1283+
@property
1284+
def account(self):
1285+
"""Return account of this tenant"""
1286+
return Account(
1287+
client=self.threescale_client.accounts,
1288+
entity=self.entity["signup"]["account"]
1289+
)
1290+
12791291

12801292
class Application(DefaultResource):
12811293
def __init__(self, entity_name='name', **kwargs):

0 commit comments

Comments
 (0)