clients/c/generated/api/BlueOceanAPI.c
user_t*
BlueOceanAPI_getUser(apiClient_t *apiClient, char * organization , char * user )
{
    list_t    *localVarQueryParameters = NULL;
    list_t    *localVarHeaderParameters = NULL;
    list_t    *localVarFormParameters = NULL;
    list_t *localVarHeaderType = list_createList();
    list_t *localVarContentType = NULL;
    char      *localVarBodyParameters = NULL;

    // create the path
    long sizeOfPath = strlen("/blue/rest/organizations/{organization}/users/{user}")+1;
    char *localVarPath = malloc(sizeOfPath);
    snprintf(localVarPath, sizeOfPath, "/blue/rest/organizations/{organization}/users/{user}");


    // Path Params
    long sizeOfPathParams_organization = strlen(organization)+3 + strlen(user)+3 + strlen("{ organization }");
    if(organization == NULL) {
        goto end;
    }
    char* localVarToReplace_organization = malloc(sizeOfPathParams_organization);
    sprintf(localVarToReplace_organization, "{%s}", "organization");

    localVarPath = strReplace(localVarPath, localVarToReplace_organization, organization);

    // Path Params
    long sizeOfPathParams_user = strlen(organization)+3 + strlen(user)+3 + strlen("{ user }");
    if(user == NULL) {
        goto end;
    }
    char* localVarToReplace_user = malloc(sizeOfPathParams_user);
    sprintf(localVarToReplace_user, "{%s}", "user");

    localVarPath = strReplace(localVarPath, localVarToReplace_user, user);


    list_addElement(localVarHeaderType,"application/json"); //produces
    apiClient_invoke(apiClient,
                    localVarPath,
                    localVarQueryParameters,
                    localVarHeaderParameters,
                    localVarFormParameters,
                    localVarHeaderType,
                    localVarContentType,
                    localVarBodyParameters,
                    "GET");

    if (apiClient->response_code == 200) {
        printf("%s\n","Successfully retrieved users details");
    }
    if (apiClient->response_code == 401) {
        printf("%s\n","Authentication failed - incorrect username and/or password");
    }
    if (apiClient->response_code == 403) {
        printf("%s\n","Jenkins requires authentication - please set username and password");
    }
    //nonprimitive not container
    cJSON *BlueOceanAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
    user_t *elementToReturn = user_parseFromJSON(BlueOceanAPIlocalVarJSON);
    cJSON_Delete(BlueOceanAPIlocalVarJSON);
    if(elementToReturn == NULL) {
        // return 0;
    }

    //return type
    if (apiClient->dataReceived) {
        free(apiClient->dataReceived);
        apiClient->dataReceived = NULL;
        apiClient->dataReceivedLen = 0;
    }
    
    
    
    list_freeList(localVarHeaderType);
    
    free(localVarPath);
    free(localVarToReplace_organization);
    free(localVarToReplace_user);
    return elementToReturn;
end:
    free(localVarPath);
    return NULL;

}
// Retrieve user details for an organization
//
Retrieve user details for an organization
Retrieve user details for an organization
user_t*
BlueOceanAPI_getUser(apiClient_t *apiClient, char * organization , char * user )
{
    list_t    *localVarQueryParameters = NULL;
    list_t    *localVarHeaderParameters = NULL;
    list_t    *localVarFormParameters = NULL;
    list_t *localVarHeaderType = list_createList();
    list_t *localVarContentType = NULL;
    char      *localVarBodyParameters = NULL;
    long sizeOfPath = strlen("/blue/rest/organizations/{organization}/users/{user}")+1;
    char *localVarPath = malloc(sizeOfPath);
    snprintf(localVarPath, sizeOfPath, "/blue/rest/organizations/{organization}/users/{user}");
    long sizeOfPathParams_organization = strlen(organization)+3 + strlen(user)+3 + strlen("{ organization }");
    if(organization == NULL) {
        goto end;
    }
    char* localVarToReplace_organization = malloc(sizeOfPathParams_organization);
    sprintf(localVarToReplace_organization, "{%s}", "organization");
    localVarPath = strReplace(localVarPath, localVarToReplace_organization, organization);
    long sizeOfPathParams_user = strlen(organization)+3 + strlen(user)+3 + strlen("{ user }");
    if(user == NULL) {
        goto end;
    }
    char* localVarToReplace_user = malloc(sizeOfPathParams_user);
    sprintf(localVarToReplace_user, "{%s}", "user");
    localVarPath = strReplace(localVarPath, localVarToReplace_user, user);
    list_addElement(localVarHeaderType,"application/json"); 
    apiClient_invoke(apiClient,
                    localVarPath,
                    localVarQueryParameters,
                    localVarHeaderParameters,
                    localVarFormParameters,
                    localVarHeaderType,
                    localVarContentType,
                    localVarBodyParameters,
                    "GET");
    if (apiClient->response_code == 200) {
        printf("%s\n","Successfully retrieved users details");
    }
    if (apiClient->response_code == 401) {
        printf("%s\n","Authentication failed - incorrect username and/or password");
    }
    if (apiClient->response_code == 403) {
        printf("%s\n","Jenkins requires authentication - please set username and password");
    }
    cJSON *BlueOceanAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
    user_t *elementToReturn = user_parseFromJSON(BlueOceanAPIlocalVarJSON);
    cJSON_Delete(BlueOceanAPIlocalVarJSON);
    if(elementToReturn == NULL) {
    }
    if (apiClient->dataReceived) {
        free(apiClient->dataReceived);
        apiClient->dataReceived = NULL;
        apiClient->dataReceivedLen = 0;
    }
    list_freeList(localVarHeaderType);
    free(localVarPath);
    free(localVarToReplace_organization);
    free(localVarToReplace_user);
    return elementToReturn;
end:
    free(localVarPath);
    return NULL;
}
user_t * BlueOceanAPI_getUser ( apiClient_t * apiClient , char * organization , char * user ) { list_t * localVarQueryParameters = NULL ; list_t * localVarHeaderParameters = NULL ; list_t * localVarFormParameters = NULL ; list_t * localVarHeaderType = list_createList ( ) ; list_t * localVarContentType = NULL ; char * localVarBodyParameters = NULL ; long sizeOfPath = strlen ( " " ) + 1 ; char * localVarPath = malloc ( sizeOfPath ) ; snprintf ( localVarPath , sizeOfPath , " " ) ; long sizeOfPathParams_organization = strlen ( organization ) + 3 + strlen ( user ) + 3 + strlen ( " " ) ; if ( organization == NULL ) { goto end ; } char * localVarToReplace_organization = malloc ( sizeOfPathParams_organization ) ; sprintf ( localVarToReplace_organization , " " , " " ) ; localVarPath = strReplace ( localVarPath , localVarToReplace_organization , organization ) ; long sizeOfPathParams_user = strlen ( organization ) + 3 + strlen ( user ) + 3 + strlen ( " " ) ; if ( user == NULL ) { goto end ; } char * localVarToReplace_user = malloc ( sizeOfPathParams_user ) ; sprintf ( localVarToReplace_user , " " , " " ) ; localVarPath = strReplace ( localVarPath , localVarToReplace_user , user ) ; list_addElement ( localVarHeaderType , " " ) ; apiClient_invoke ( apiClient , localVarPath , localVarQueryParameters , localVarHeaderParameters , localVarFormParameters , localVarHeaderType , localVarContentType , localVarBodyParameters , " " ) ; if ( apiClient -> response_code == 200 ) { printf ( " \n " , " " ) ; } if ( apiClient -> response_code == 401 ) { printf ( " \n " , " " ) ; } if ( apiClient -> response_code == 403 ) { printf ( " \n " , " " ) ; } cJSON * BlueOceanAPIlocalVarJSON = cJSON_Parse ( apiClient -> dataReceived ) ; user_t * elementToReturn = user_parseFromJSON ( BlueOceanAPIlocalVarJSON ) ; cJSON_Delete ( BlueOceanAPIlocalVarJSON ) ; if ( elementToReturn == NULL ) { } if ( apiClient -> dataReceived ) { free ( apiClient -> dataReceived ) ; apiClient -> dataReceived = NULL ; apiClient -> dataReceivedLen = 0 ; } list_freeList ( localVarHeaderType ) ; free ( localVarPath ) ; free ( localVarToReplace_organization ) ; free ( localVarToReplace_user ) ; return elementToReturn ; end : free ( localVarPath ) ; return NULL ; }
Retrieve user details for an organization
Retrieve user details for an organization
// create the path // Path Params // Path Params //produces //nonprimitive not container // return 0; //return type