Managing Businesses
A Business has a set of suites that can be viewed by an admin user and an unlimited number of viewer users. Managing Businesses with Shimoku’s SDK goes as follows:
The
shimoku.business
object has the following methods:get_business(business_id: str)
to retrieve business dataget_universe_businesses()
to retrieve all the businesses of a universe_find_business_by_name_filter(name: Optional[str])
to find business by namecreate_business(name: str)
to create a new business in your universe owned by the userowner_id
and with nameupdate_business(business_id: str, business_data: Dict)
to update the data of a business. You are allowed only to change thename
field in the business case.get_business_apps(business_id: str)
to retrieve in cascade all suites (apps) that belong to a business.get_business_app_ids(business_id: str)
to retrieve in cascade all suites id (app_id) that belong to a business.get_business_all_apps_with_filter(business_id: str, app_filter: Dict)
to retrieve (filter) all the apps of a businessdelete_business(business_id: str)
to delete permanently a business in cascade with all the suites, paths and reports it contains.rename_business(business_id: str, new_name: str)
Change the name of a business
business Dict[str, Any] = shimoku.business.get_business(business_id)
That returns a dictionary such as:
business = {
'id': 'f74gh9', # business uuid
'name': 'Ikea', # business name
'owner': '38c7f', # user uuid
'createdAt': '2021-01-01',
'updatedAt '2021-09-24',
}
apps: List[Dict[str, Any]] = shimoku.business.get_business_apps(business_id)
That returns a dictionary such as:
apps = [
{
'id': 'aaaa1' # business uuid
'owner': '38c7f', # user uuid
'createdAt': '2021-01-01',
'updatedAt '2021-09-24',
...
},
{
'id': 'bbbb1' # business uuid
'owner': '38c7f # user uuid
'createdAt': '2021-01-01',
'updatedAt '2021-09-24',
...
},
]
app_ids: List[int] = shimoku.business.get_business_app_ids(business_id)
That returns a dictionary such as:
# This business contains 3 suites
app_ids = [
'a19f1', # a Suite UUID
'920a0', # another Suite UUID
'c5d1d', # another Suite UUID
]
Such as in:

business: Dict = shimoku.business.create_business(name)
That returns the business created:
business = {
'id': 'f74gh9', # business uuid
'name': 'Ikea', # business name
'owner': '38c7f', # user uuid
'createdAt': '2021-01-01',
'updatedAt '2021-09-24',
}
business: Dict = shimoku.business.update_business(business_id, business_data)
Where business_data is a dictionary such as:
business_data = {'name': 'NEW NAME'}
That returns the business created:
business = {
'id': 'f74gh9', # business uuid
'name': 'NEW NAME', # updated business name
'owner': '38c7f', # user uuid
'createdAt': '2021-01-01',
'updatedAt '2021-09-24',
}
The only field that can be updated for business is actually the field name
business: Dict = shimoku.business.rename_business(business_id, new_name)
Where
new_name
is a string such as:new_name = 'NEW NAME'
That returns the business created:
business = {
'id': 'f74gh9', # business uuid
'name': 'NEW NAME', # updated business name
'owner': '38c7f', # user uuid
'createdAt': '2021-01-01',
'updatedAt '2021-09-24',
}
The updated name will be available on the
Settings
page of the Front-Endshimoku.business.delete_business(business_id)
It will remove in cascade all data, reports, apps (suites) before remove the business
Last modified 8mo ago