def credentials_to_dict(credentials):
    """
    Convert credentials from google to dict.
    :param credentials: Credentials from google_auth_oauthlib.flow.
    :return: Credentials as dict.
    """
    return {
        'service': 'calendar-service',
        'type': 'credentials',
        'token': credentials.token,
        'refresh_token': credentials.refresh_token,
        'token_uri': credentials.token_uri,
        'client_id': credentials.client_id,
        'client_secret': credentials.client_secret,
        'scopes': credentials.scopes,
    }