Package com.skava.marketplace.util
Class GCPCloudFunctionUtil
java.lang.Object
com.skava.marketplace.util.GCPCloudFunctionUtil
This class is used to invoke the GCP Cloud Function.
- Author:
- Infosys Equinox
-
Constructor Summary
ConstructorsConstructorDescriptionGCPCloudFunctionUtil
(org.springframework.web.client.RestTemplate restTemplate) RestTemplate -
Method Summary
Modifier and TypeMethodDescriptioncallCloudFunction
(String functionUrl, String idToken, String requestBody) This method is used to call the GCP cloud function.getIdToken
(String functionUrl) This method is used to return the id token.invokeGCPCloudFunction
(String functionURL, String payload) This method is used to call the GCP Cloud function
-
Constructor Details
-
GCPCloudFunctionUtil
@Autowired public GCPCloudFunctionUtil(org.springframework.web.client.RestTemplate restTemplate) RestTemplate
-
-
Method Details
-
callCloudFunction
public String callCloudFunction(String functionUrl, String idToken, String requestBody) throws IOException This method is used to call the GCP cloud function.- Parameters:
functionUrl
-idToken
-requestBody
-- Throws:
Exception
IOException
-
invokeGCPCloudFunction
This method is used to call the GCP Cloud function- Parameters:
functionURL
- holds the valid GCP functionpayload
- holds the requestPayload.- Returns:
- String callCloudResult
-
getIdToken
This method is used to return the id token.- Parameters:
functionUrl
-- Returns:
- response
-