Class EchoApiConnector

java.lang.Object
com.techcognita.javachatx.api.BaseApiConnector
com.techcognita.javachatx.api.EchoApiConnector
All Implemented Interfaces:
ApiConnector

public class EchoApiConnector extends BaseApiConnector
A simple echo API connector for demonstration purposes. This connector simply echoes back the request as the response.
  • Constructor Details

    • EchoApiConnector

      public EchoApiConnector()
  • Method Details

    • sendRequest

      public com.google.gson.JsonObject sendRequest(com.google.gson.JsonObject request) throws ApiException
      Description copied from interface: ApiConnector
      Send a request to the external API and get a response.
      Parameters:
      request - The request data as a JSON object
      Returns:
      The API response as a JSON object
      Throws:
      ApiException - If there's an error communicating with the API
    • configure

      public void configure(com.google.gson.JsonObject configuration)
      Description copied from interface: ApiConnector
      Configure the API connector with necessary credentials and settings.
      Specified by:
      configure in interface ApiConnector
      Overrides:
      configure in class BaseApiConnector
      Parameters:
      configuration - The configuration parameters as a JSON object