Class JobGetInfos

java.lang.Object
fr.sandro642.github.jobs.JobGetInfos

public class JobGetInfos extends Object
JobGetInfos is a utility class for managing API requests in the connectLib library. It provides methods to construct API routes based on the configuration defined in a YAML file.
Since:
1.0
  • Constructor Details

    • JobGetInfos

      public JobGetInfos()
      Constructor of JobGetInfos. Initializes the ApiClient and loads the YAML configuration.
  • Method Details

    • getRoutes

      public JobGetInfos getRoutes(MethodType methodType, Enum<?> routeName)
      Get routes from the YAML file and builds the full URL with a request body.
      Parameters:
      methodType - Type of HTTP method (GET, POST)
      routeName - Name of the route in the YAML file
      Returns:
      JobGetInfos for chaining
    • getRoutes

      public <R> JobGetInfos getRoutes(VersionProvider versionType, MethodType methodType, R routeName)
      Get routes from the YAML file and builds the full URL with a request body.
      Parameters:
      versionType - VersionProvider to specify API versioning
      methodType - Type of HTTP method (GET, POST)
      routeName - Name of the route in the YAML file
      Returns:
      JobGetInfos for chaining
    • body

      public JobGetInfos body(Map<?,?> body)
    • params

      public JobGetInfos params(Map<?,?> params)
    • query

      public JobGetInfos query(Map<?,?> query)
    • urlBranch

      public JobGetInfos urlBranch(URLProvider urlBranch)
      Set a custom URL branch for the API calls. If not set, the default URL from the configuration will be used.
      Parameters:
      urlBranch - The URLProvider instance providing the custom URL branch.
      Returns:
      JobGetInfos for chaining
    • execute

      public CompletableFuture<ApiFactory> execute()
      Get the response from the API based on the current route and method. This method retrieves the stored route, method, and body from the store, makes the API call, and returns the response as an ApiFactory object.
      Returns:
      ApiFactory containing the response from the API, or null if an error occurs.