GoogleCloudService class can be used to connect to various Google Cloud API Services like Google Translate, Dialogflow, GoogleMaps, etc
The constructor initializes the GoogleCloudService class. It must be called before you perform any method calls.
To connect to a chatbot you can set the following properties for an GoogleCloudService class object.
REST URL endpoint of the API
Google Cloud Project ID
Google Project service account. A service account is identified by its email address, which is unique to the account.
Service Account Private Key.
An event listener to be called when a response is received from the service endpoint.
The result value to the request will be nonzero if the request was unsuccessful. To check the error you can inspect this value.
JSON Response received from the cloud service.
Send data to the API endpoint.
An object of the class GoogleCloudService cannot be instantiated in global context. Ensure that you are creating the instance inside a scoped area or function.