def _generate_install_token()

in functions/source/LicenseVerificationAndTokenGenerator/lambda_function.py [0:0]


def _generate_install_token(username, password, account_id, token_type, timeout):
    _headers = _create_auth_headers(username, password, account_id)
    API_URL = f"https://api.boomi.com/api/rest/v1/{account_id}/InstallerToken/"
    payload = {
        "installType": token_type,
        "durationMinutes": int(timeout)
    }
    logger.info(payload)
    resp = requests.post(API_URL, headers=_headers, json=payload)
    resp.raise_for_status()
    rj = resp.json()

    return rj['token']