def create_tenant(self, name: str, slug: str=None) -> str:
    '\n        Creates a new tenant.\n\n        Note this route only works when run against Prefect Server.\n\n        Args:\n            - name (str): the name of the tenant to create\n            - slug (str, optional): the slug of the tenant to create; defaults to name\n\n        Returns:\n            - str: the ID of the newly created tenant, or the ID of the currently active tenant\n\n        Raises:\n            - ValueError: if run against Prefect Cloud\n        '
    if (prefect.config.backend != 'server'):
        msg = 'To create a tenant with Prefect Cloud, please signup at https://cloud.prefect.io/'
        raise ValueError(msg)
    if (slug is None):
        slug = slugify(name)
    tenant_info = self.graphql({'mutation($input: create_tenant_input!)': {'create_tenant(input: $input)': {'id'}}}, variables=dict(input=dict(name=name, slug=slug)))
    return tenant_info.data.create_tenant.id
Creates a new tenant.

Note this route only works when run against Prefect Server.

Args:
    - name (str): the name of the tenant to create
    - slug (str, optional): the slug of the tenant to create; defaults to name

Returns:
    - str: the ID of the newly created tenant, or the ID of the currently active tenant

Raises:
    - ValueError: if run against Prefect Cloud
def create_tenant(self, name: str, slug: str=None) -> str:
    '\n        Creates a new tenant.\n\n        Note this route only works when run against Prefect Server.\n\n        Args:\n            - name (str): the name of the tenant to create\n            - slug (str, optional): the slug of the tenant to create; defaults to name\n\n        Returns:\n            - str: the ID of the newly created tenant, or the ID of the currently active tenant\n\n        Raises:\n            - ValueError: if run against Prefect Cloud\n        '
    if (prefect.config.backend != 'server'):
        msg = 'To create a tenant with Prefect Cloud, please signup at https://cloud.prefect.io/'
        raise ValueError(msg)
    if (slug is None):
        slug = slugify(name)
    tenant_info = self.graphql({'mutation($input: create_tenant_input!)': {'create_tenant(input: $input)': {'id'}}}, variables=dict(input=dict(name=name, slug=slug)))
    return tenant_info.data.create_tenant.id