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 TypeMethodDescriptionGet 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.getRoutes
(MethodType methodType, Enum<?> routeName, Map<String, ?> body) Get routes from the YAML file and builds the full URL with a request body and parameters.Get routes from the YAML file and builds the full URL with additional parameters.getRoutes
(MethodType methodType, String routeName) Get routes from the YAML file and builds the full URL.getRoutes
(VersionType versionType, MethodType methodType, Enum<?> routeName) Get routes from the YAML file and builds the full URL with parameters.getRoutes
(VersionType versionType, MethodType methodType, Enum<?> routeName, Map<String, ?> body) Get routes from the YAML file and builds the full URL.getRoutes
(VersionType versionType, MethodType methodType, String routeName) Récupère les routes depuis le fichier YAML et construit l'URL complètegetRoutes
(VersionType versionType, MethodType methodType, String routeName, Map<String, ?> body) Get routes from the YAML file and builds the full URL with a request body.<R> JobGetInfos
getRoutes
(VersionType versionType, MethodType methodType, R routeName, Map<String, ?> body, Map<String, ?> params) Get routes from the YAML file and builds the full URL with additional parameters.
-
Constructor Details
-
JobGetInfos
public JobGetInfos()Constructor of JobGetInfos. Initializes the ApiClient and loads the YAML configuration.
-
-
Method Details
-
getRoutes
public JobGetInfos getRoutes(VersionType versionType, MethodType methodType, Enum<?> routeName, Map<String, ?> body) Get routes from the YAML file and builds the full URL.- Parameters:
versionType
- Version of the API (V1_BRANCH, V2_BRANCH)methodType
- Type of HTTP method (GET, POST)routeName
- Name of the route in the YAML filebody
- Body of the request for POST (can be null for GET)- Returns:
- JobGetInfos for chaining
-
getRoutes
Get routes from the YAML file and builds the full URL with parameters.- Parameters:
versionType
- Version of the API (V1_BRANCH, V2_BRANCH)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:
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 and parameters.- Parameters:
methodType
- Type of HTTP method (GET, POST)routeName
- Name of the route in the YAML filebody
- Body of the request for POST (can be null for GET)- Returns:
- JobGetInfos for chaining
-
getRoutes
public JobGetInfos getRoutes(MethodType methodType, Enum<?> routeName, Map<String, ?> body, Map<String, ?> params) Get routes from the YAML file and builds the full URL with additional parameters.- Parameters:
methodType
- Type of HTTP method (GET, POST)routeName
- Name of the route in the YAML fileparams
- Additional parameters for the request- Returns:
- JobGetInfos for chaining
-
getRoutes
Get routes from the YAML file and builds the full URL.- Parameters:
methodType
- Type of HTTP method (GET, POST)routeName
- Name of the route in the YAML file- Returns:
- JobGetInfos for chaining
-
getRoutes
Récupère les routes depuis le fichier YAML et construit l'URL complète- Parameters:
versionType
- Version de l'API (V1_BRANCH, V2_BRANCH)methodType
- Type de méthode HTTP (GET, POST)routeName
- Nom de la route dans le fichier YAML- Returns:
- JobGetInfos pour chaînage
-
getRoutes
public JobGetInfos getRoutes(VersionType versionType, MethodType methodType, String routeName, Map<String, ?> body) Get routes from the YAML file and builds the full URL with a request body.- Parameters:
versionType
- Version of the API (V1_BRANCH, V2_BRANCH)methodType
- Type of HTTP method (GET, POST)routeName
- Name of the route in the YAML filebody
- Body of the request for POST (can be null for GET)- Returns:
- JobGetInfos for chaining
-
getRoutes
public <R> JobGetInfos getRoutes(VersionType versionType, MethodType methodType, R routeName, Map<String, ?> body, Map<String, ?> params) Get routes from the YAML file and builds the full URL with additional parameters.- Parameters:
versionType
- Version of the API (V1_BRANCH, V2_BRANCH)methodType
- Type of HTTP method (GET, POST)routeName
- Name of the route in the YAML fileparams
- Additional parameters for the request- Returns:
- JobGetInfos for chaining
-
getResponse
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.
-