def create_client(ctx: click.Context, opts: ProxyContext) -> CumulocityClient:
    'Create Cumulocity client and prompt for missing credentials\n    if necessary.\n\n    Args:\n        ctx (click.Context): Click context\n        opts (ProxyContext): Proxy options\n\n    Returns:\n        CumulocityClient: Configured Cumulocity client\n    '
    if ((not opts.disable_prompts) and (not opts.host)):
        opts.host = click.prompt(text='Enter the Cumulocity Host/URL')
    client = CumulocityClient(hostname=opts.host, tenant=opts.tenant, user=opts.user, password=opts.password, tfacode=opts.tfa_code, token=opts.token, ignore_ssl_validate=opts.ignore_ssl_validate)
    if (not client.url):
        opts.show_error('No Cumulocity host was provided. The host can be set viaenvironment variables, arguments or the env-file')
        ctx.exit(ExitCodes.NO_SESSION)
    logging.info('Checking tenant id')
    client.validate_tenant_id()
    retries = 3
    success = False
    while retries:
        try:
            if client.token:
                client.validate_credentials()
            else:
                client.login()
            if (opts.env_file and opts.store_token):
                store_credentials(opts, client)
            success = True
            break
        except CumulocityMissingTFAToken as ex:
            client.tfacode = click.prompt(text='Enter your Cumulocity TFA-Token', hide_input=False)
        except Exception as ex:
            logging.info('unknown exception: %s', ex)
            if (not opts.disable_prompts):
                if (not client.user):
                    client.user = click.prompt(text='Enter your Cumulocity Username')
                if (not client.password):
                    client.password = click.prompt(text='Enter your Cumulocity Password [input hidden]', hide_input=True)
        retries -= 1
    if (not success):
        logging.info('Could not create client')
        ctx.exit(ExitCodes.NO_SESSION)
    return client
Create Cumulocity client and prompt for missing credentials
if necessary.

Args:
    ctx (click.Context): Click context
    opts (ProxyContext): Proxy options

Returns:
    CumulocityClient: Configured Cumulocity client
def create_client(ctx: click.Context, opts: ProxyContext) -> CumulocityClient:
    'Create Cumulocity client and prompt for missing credentials\n    if necessary.\n\n    Args:\n        ctx (click.Context): Click context\n        opts (ProxyContext): Proxy options\n\n    Returns:\n        CumulocityClient: Configured Cumulocity client\n    '
    if ((not opts.disable_prompts) and (not opts.host)):
        opts.host = click.prompt(text='Enter the Cumulocity Host/URL')
    client = CumulocityClient(hostname=opts.host, tenant=opts.tenant, user=opts.user, password=opts.password, tfacode=opts.tfa_code, token=opts.token, ignore_ssl_validate=opts.ignore_ssl_validate)
    if (not client.url):
        opts.show_error('No Cumulocity host was provided. The host can be set viaenvironment variables, arguments or the env-file')
        ctx.exit(ExitCodes.NO_SESSION)
    logging.info('Checking tenant id')
    client.validate_tenant_id()
    retries = 3
    success = False
    while retries:
        try:
            if client.token:
                client.validate_credentials()
            else:
                client.login()
            if (opts.env_file and opts.store_token):
                store_credentials(opts, client)
            success = True
            break
        except CumulocityMissingTFAToken as ex:
            client.tfacode = click.prompt(text='Enter your Cumulocity TFA-Token', hide_input=False)
        except Exception as ex:
            logging.info('unknown exception: %s', ex)
            if (not opts.disable_prompts):
                if (not client.user):
                    client.user = click.prompt(text='Enter your Cumulocity Username')
                if (not client.password):
                    client.password = click.prompt(text='Enter your Cumulocity Password [input hidden]', hide_input=True)
        retries -= 1
    if (not success):
        logging.info('Could not create client')
        ctx.exit(ExitCodes.NO_SESSION)
    return client