You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
416 B
Python

from googleapiclient.discovery import build
from google.oauth2.credentials import Credentials
from app.google.auth import creds_from_token_json
def get_service(api_name: str, api_version: str, token_json: str):
creds: Credentials = creds_from_token_json(token_json)
# cache_discovery=False evita warnings en algunos entornos
return build(api_name, api_version, credentials=creds, cache_discovery=False)