Get the google service object to use to query the API
()
| 10 | |
| 11 | |
| 12 | def get_service(): # type: ignore[no-untyped-def] |
| 13 | """ |
| 14 | Get the google service object to use to query the API |
| 15 | """ |
| 16 | credentials = service_account.Credentials.from_service_account_info( # type: ignore[no-untyped-call] |
| 17 | json.loads(settings.GOOGLE_SERVICE_ACCOUNT), # type: ignore[arg-type] |
| 18 | scopes=GA_SCOPES, |
| 19 | ) |
| 20 | |
| 21 | # Build the service object. |
| 22 | return build(GA_API_NAME, GA_API_VERSION, credentials=credentials) |
| 23 | |
| 24 | |
| 25 | def get_events_for_organisation(organisation): # type: ignore[no-untyped-def] |
no outgoing calls
no test coverage detected
searching dependent graphs…