Files
c/kubernetes/api/AutoscalingAPI.c
Brendan Burns d72a1c8566 Automated openapi generation from release-1.32
Signed-off-by: Kubernetes Prow Robot <k8s.ci.robot@gmail.com>
2025-02-11 19:36:46 +00:00

84 lines
2.4 KiB
C

#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "AutoscalingAPI.h"
#define MAX_NUMBER_LENGTH 16
#define MAX_BUFFER_LENGTH 4096
// get information of a group
//
v1_api_group_t*
AutoscalingAPI_getAPIGroup(apiClient_t *apiClient)
{
list_t *localVarQueryParameters = NULL;
list_t *localVarHeaderParameters = NULL;
list_t *localVarFormParameters = NULL;
list_t *localVarHeaderType = list_createList();
list_t *localVarContentType = NULL;
char *localVarBodyParameters = NULL;
size_t localVarBodyLength = 0;
// clear the error code from the previous api call
apiClient->response_code = 0;
// create the path
char *localVarPath = strdup("/apis/autoscaling/");
list_addElement(localVarHeaderType,"application/json"); //produces
list_addElement(localVarHeaderType,"application/yaml"); //produces
list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces
apiClient_invoke(apiClient,
localVarPath,
localVarQueryParameters,
localVarHeaderParameters,
localVarFormParameters,
localVarHeaderType,
localVarContentType,
localVarBodyParameters,
localVarBodyLength,
"GET");
// uncomment below to debug the error response
//if (apiClient->response_code == 200) {
// printf("%s\n","OK");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 401) {
// printf("%s\n","Unauthorized");
//}
//nonprimitive not container
v1_api_group_t *elementToReturn = NULL;
if(apiClient->response_code >= 200 && apiClient->response_code < 300) {
cJSON *AutoscalingAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
elementToReturn = v1_api_group_parseFromJSON(AutoscalingAPIlocalVarJSON);
cJSON_Delete(AutoscalingAPIlocalVarJSON);
if(elementToReturn == NULL) {
// return 0;
}
}
//return type
if (apiClient->dataReceived) {
free(apiClient->dataReceived);
apiClient->dataReceived = NULL;
apiClient->dataReceivedLen = 0;
}
list_freeList(localVarHeaderType);
free(localVarPath);
return elementToReturn;
end:
free(localVarPath);
return NULL;
}