GoogleCloudTranslationService constructor
GoogleCloudTranslationService({})
For more details on arguments see Google Service Accounts documentation:
https://cloud.google.com/iam/docs/service-accounts
projectId - "project_id" field of exported Private Key in JSON
accessToken
- Service Account access token
Implementation
GoogleCloudTranslationService({
required this.projectId,
required String accessToken,
required this.logger,
}) : _httpClient = HttpClient(
baseUrl: 'https://translate.googleapis.com',
authorizationHeaders: {
'Authorization': 'Bearer $accessToken',
},
logger: logger,
);