Package fr.sandro642.github.jobs
Class JobGetInfos
java.lang.Object
fr.sandro642.github.jobs.JobGetInfos
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute()Get the response from the API based on the current route and method.getRoutes(MethodType methodType, Enum<?> routeName) Get routes from the YAML file and builds the full URL with a request body.<R> JobGetInfosgetRoutes(VersionProvider versionType, MethodType methodType, R routeName) Get routes from the YAML file and builds the full URL with a request body.urlBranch(URLProvider urlBranch) Set a custom URL branch for the API calls.
-
Constructor Details
-
JobGetInfos
public JobGetInfos()Constructor of JobGetInfos. Initializes the ApiClient and loads the YAML configuration.
-
-
Method Details
-
getRoutes
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
Get routes from the YAML file and builds the full URL with a request body.- Parameters:
versionType- VersionProvider to specify API versioningmethodType- Type of HTTP method (GET, POST)routeName- Name of the route in the YAML file- Returns:
- JobGetInfos for chaining
-
body
-
params
-
query
-
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
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.
-