clients/c/generated/api/BlueOceanAPI.c
pipeline_run_t*
BlueOceanAPI_putPipelineRun(apiClient_t *apiClient, char * organization , char * pipeline , char * run , char * blocking , int timeOutInSecs )
{
    list_t    *localVarQueryParameters = list_createList();
    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}/pipelines/{pipeline}/runs/{run}/stop")+1;
    char *localVarPath = malloc(sizeOfPath);
    snprintf(localVarPath, sizeOfPath, "/blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run}/stop");


    // Path Params
    long sizeOfPathParams_organization = strlen(organization)+3 + strlen(pipeline)+3 + strlen(run)+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_pipeline = strlen(organization)+3 + strlen(pipeline)+3 + strlen(run)+3 + strlen("{ pipeline }");
    if(pipeline == NULL) {
        goto end;
    }
    char* localVarToReplace_pipeline = malloc(sizeOfPathParams_pipeline);
    sprintf(localVarToReplace_pipeline, "{%s}", "pipeline");

    localVarPath = strReplace(localVarPath, localVarToReplace_pipeline, pipeline);

    // Path Params
    long sizeOfPathParams_run = strlen(organization)+3 + strlen(pipeline)+3 + strlen(run)+3 + strlen("{ run }");
    if(run == NULL) {
        goto end;
    }
    char* localVarToReplace_run = malloc(sizeOfPathParams_run);
    sprintf(localVarToReplace_run, "{%s}", "run");

    localVarPath = strReplace(localVarPath, localVarToReplace_run, run);



    // query parameters
    char *keyQuery_blocking = NULL;
    char * valueQuery_blocking = NULL;
    keyValuePair_t *keyPairQuery_blocking = 0;
    if (blocking)
    {
        keyQuery_blocking = strdup("blocking");
        valueQuery_blocking = strdup((blocking));
        keyPairQuery_blocking = keyValuePair_create(keyQuery_blocking, valueQuery_blocking);
        list_addElement(localVarQueryParameters,keyPairQuery_blocking);
    }

    // query parameters
    char *keyQuery_timeOutInSecs = NULL;
    char * valueQuery_timeOutInSecs = NULL;
    keyValuePair_t *keyPairQuery_timeOutInSecs = 0;
    if (timeOutInSecs)
    {
        keyQuery_timeOutInSecs = strdup("timeOutInSecs");
        valueQuery_timeOutInSecs = calloc(1,MAX_NUMBER_LENGTH);
        snprintf(valueQuery_timeOutInSecs, MAX_NUMBER_LENGTH, "%d", timeOutInSecs);
        keyPairQuery_timeOutInSecs = keyValuePair_create(keyQuery_timeOutInSecs, valueQuery_timeOutInSecs);
        list_addElement(localVarQueryParameters,keyPairQuery_timeOutInSecs);
    }
    list_addElement(localVarHeaderType,"application/json"); //produces
    apiClient_invoke(apiClient,
                    localVarPath,
                    localVarQueryParameters,
                    localVarHeaderParameters,
                    localVarFormParameters,
                    localVarHeaderType,
                    localVarContentType,
                    localVarBodyParameters,
                    "PUT");

    if (apiClient->response_code == 200) {
        printf("%s\n","Successfully stopped a build");
    }
    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);
    pipeline_run_t *elementToReturn = pipeline_run_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(localVarQueryParameters);
    
    
    list_freeList(localVarHeaderType);
    
    free(localVarPath);
    free(localVarToReplace_organization);
    free(localVarToReplace_pipeline);
    free(localVarToReplace_run);
    if(keyQuery_blocking){
        free(keyQuery_blocking);
        keyQuery_blocking = NULL;
    }
    if(valueQuery_blocking){
        free(valueQuery_blocking);
        valueQuery_blocking = NULL;
    }
    if(keyPairQuery_blocking){
        keyValuePair_free(keyPairQuery_blocking);
        keyPairQuery_blocking = NULL;
    }
    if(keyQuery_timeOutInSecs){
        free(keyQuery_timeOutInSecs);
        keyQuery_timeOutInSecs = NULL;
    }
    if(valueQuery_timeOutInSecs){
        free(valueQuery_timeOutInSecs);
        valueQuery_timeOutInSecs = NULL;
    }
    if(keyPairQuery_timeOutInSecs){
        keyValuePair_free(keyPairQuery_timeOutInSecs);
        keyPairQuery_timeOutInSecs = NULL;
    }
    return elementToReturn;
end:
    free(localVarPath);
    return NULL;

}
// Stop a build of an organization pipeline
//
Stop a build of an organization pipeline
Stop a build of an organization pipeline
pipeline_run_t*
BlueOceanAPI_putPipelineRun(apiClient_t *apiClient, char * organization , char * pipeline , char * run , char * blocking , int timeOutInSecs )
{
    list_t    *localVarQueryParameters = list_createList();
    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}/pipelines/{pipeline}/runs/{run}/stop")+1;
    char *localVarPath = malloc(sizeOfPath);
    snprintf(localVarPath, sizeOfPath, "/blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run}/stop");
    long sizeOfPathParams_organization = strlen(organization)+3 + strlen(pipeline)+3 + strlen(run)+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_pipeline = strlen(organization)+3 + strlen(pipeline)+3 + strlen(run)+3 + strlen("{ pipeline }");
    if(pipeline == NULL) {
        goto end;
    }
    char* localVarToReplace_pipeline = malloc(sizeOfPathParams_pipeline);
    sprintf(localVarToReplace_pipeline, "{%s}", "pipeline");
    localVarPath = strReplace(localVarPath, localVarToReplace_pipeline, pipeline);
    long sizeOfPathParams_run = strlen(organization)+3 + strlen(pipeline)+3 + strlen(run)+3 + strlen("{ run }");
    if(run == NULL) {
        goto end;
    }
    char* localVarToReplace_run = malloc(sizeOfPathParams_run);
    sprintf(localVarToReplace_run, "{%s}", "run");
    localVarPath = strReplace(localVarPath, localVarToReplace_run, run);
    char *keyQuery_blocking = NULL;
    char * valueQuery_blocking = NULL;
    keyValuePair_t *keyPairQuery_blocking = 0;
    if (blocking)
    {
        keyQuery_blocking = strdup("blocking");
        valueQuery_blocking = strdup((blocking));
        keyPairQuery_blocking = keyValuePair_create(keyQuery_blocking, valueQuery_blocking);
        list_addElement(localVarQueryParameters,keyPairQuery_blocking);
    }
    char *keyQuery_timeOutInSecs = NULL;
    char * valueQuery_timeOutInSecs = NULL;
    keyValuePair_t *keyPairQuery_timeOutInSecs = 0;
    if (timeOutInSecs)
    {
        keyQuery_timeOutInSecs = strdup("timeOutInSecs");
        valueQuery_timeOutInSecs = calloc(1,MAX_NUMBER_LENGTH);
        snprintf(valueQuery_timeOutInSecs, MAX_NUMBER_LENGTH, "%d", timeOutInSecs);
        keyPairQuery_timeOutInSecs = keyValuePair_create(keyQuery_timeOutInSecs, valueQuery_timeOutInSecs);
        list_addElement(localVarQueryParameters,keyPairQuery_timeOutInSecs);
    }
    list_addElement(localVarHeaderType,"application/json"); 
    apiClient_invoke(apiClient,
                    localVarPath,
                    localVarQueryParameters,
                    localVarHeaderParameters,
                    localVarFormParameters,
                    localVarHeaderType,
                    localVarContentType,
                    localVarBodyParameters,
                    "PUT");
    if (apiClient->response_code == 200) {
        printf("%s\n","Successfully stopped a build");
    }
    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);
    pipeline_run_t *elementToReturn = pipeline_run_parseFromJSON(BlueOceanAPIlocalVarJSON);
    cJSON_Delete(BlueOceanAPIlocalVarJSON);
    if(elementToReturn == NULL) {
    }
    if (apiClient->dataReceived) {
        free(apiClient->dataReceived);
        apiClient->dataReceived = NULL;
        apiClient->dataReceivedLen = 0;
    }
    list_freeList(localVarQueryParameters);
    list_freeList(localVarHeaderType);
    free(localVarPath);
    free(localVarToReplace_organization);
    free(localVarToReplace_pipeline);
    free(localVarToReplace_run);
    if(keyQuery_blocking){
        free(keyQuery_blocking);
        keyQuery_blocking = NULL;
    }
    if(valueQuery_blocking){
        free(valueQuery_blocking);
        valueQuery_blocking = NULL;
    }
    if(keyPairQuery_blocking){
        keyValuePair_free(keyPairQuery_blocking);
        keyPairQuery_blocking = NULL;
    }
    if(keyQuery_timeOutInSecs){
        free(keyQuery_timeOutInSecs);
        keyQuery_timeOutInSecs = NULL;
    }
    if(valueQuery_timeOutInSecs){
        free(valueQuery_timeOutInSecs);
        valueQuery_timeOutInSecs = NULL;
    }
    if(keyPairQuery_timeOutInSecs){
        keyValuePair_free(keyPairQuery_timeOutInSecs);
        keyPairQuery_timeOutInSecs = NULL;
    }
    return elementToReturn;
end:
    free(localVarPath);
    return NULL;
}
pipeline_run_t * BlueOceanAPI_putPipelineRun ( apiClient_t * apiClient , char * organization , char * pipeline , char * run , char * blocking , int timeOutInSecs ) { list_t * localVarQueryParameters = list_createList ( ) ; 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 ( pipeline ) + 3 + strlen ( run ) + 3 + strlen ( " " ) ; if ( organization == NULL ) { goto end ; } char * localVarToReplace_organization = malloc ( sizeOfPathParams_organization ) ; sprintf ( localVarToReplace_organization , " " , " " ) ; localVarPath = strReplace ( localVarPath , localVarToReplace_organization , organization ) ; long sizeOfPathParams_pipeline = strlen ( organization ) + 3 + strlen ( pipeline ) + 3 + strlen ( run ) + 3 + strlen ( " " ) ; if ( pipeline == NULL ) { goto end ; } char * localVarToReplace_pipeline = malloc ( sizeOfPathParams_pipeline ) ; sprintf ( localVarToReplace_pipeline , " " , " " ) ; localVarPath = strReplace ( localVarPath , localVarToReplace_pipeline , pipeline ) ; long sizeOfPathParams_run = strlen ( organization ) + 3 + strlen ( pipeline ) + 3 + strlen ( run ) + 3 + strlen ( " " ) ; if ( run == NULL ) { goto end ; } char * localVarToReplace_run = malloc ( sizeOfPathParams_run ) ; sprintf ( localVarToReplace_run , " " , " " ) ; localVarPath = strReplace ( localVarPath , localVarToReplace_run , run ) ; char * keyQuery_blocking = NULL ; char * valueQuery_blocking = NULL ; keyValuePair_t * keyPairQuery_blocking = 0 ; if ( blocking ) { keyQuery_blocking = strdup ( " " ) ; valueQuery_blocking = strdup ( ( blocking ) ) ; keyPairQuery_blocking = keyValuePair_create ( keyQuery_blocking , valueQuery_blocking ) ; list_addElement ( localVarQueryParameters , keyPairQuery_blocking ) ; } char * keyQuery_timeOutInSecs = NULL ; char * valueQuery_timeOutInSecs = NULL ; keyValuePair_t * keyPairQuery_timeOutInSecs = 0 ; if ( timeOutInSecs ) { keyQuery_timeOutInSecs = strdup ( " " ) ; valueQuery_timeOutInSecs = calloc ( 1 , MAX_NUMBER_LENGTH ) ; snprintf ( valueQuery_timeOutInSecs , MAX_NUMBER_LENGTH , " " , timeOutInSecs ) ; keyPairQuery_timeOutInSecs = keyValuePair_create ( keyQuery_timeOutInSecs , valueQuery_timeOutInSecs ) ; list_addElement ( localVarQueryParameters , keyPairQuery_timeOutInSecs ) ; } 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 ) ; pipeline_run_t * elementToReturn = pipeline_run_parseFromJSON ( BlueOceanAPIlocalVarJSON ) ; cJSON_Delete ( BlueOceanAPIlocalVarJSON ) ; if ( elementToReturn == NULL ) { } if ( apiClient -> dataReceived ) { free ( apiClient -> dataReceived ) ; apiClient -> dataReceived = NULL ; apiClient -> dataReceivedLen = 0 ; } list_freeList ( localVarQueryParameters ) ; list_freeList ( localVarHeaderType ) ; free ( localVarPath ) ; free ( localVarToReplace_organization ) ; free ( localVarToReplace_pipeline ) ; free ( localVarToReplace_run ) ; if ( keyQuery_blocking ) { free ( keyQuery_blocking ) ; keyQuery_blocking = NULL ; } if ( valueQuery_blocking ) { free ( valueQuery_blocking ) ; valueQuery_blocking = NULL ; } if ( keyPairQuery_blocking ) { keyValuePair_free ( keyPairQuery_blocking ) ; keyPairQuery_blocking = NULL ; } if ( keyQuery_timeOutInSecs ) { free ( keyQuery_timeOutInSecs ) ; keyQuery_timeOutInSecs = NULL ; } if ( valueQuery_timeOutInSecs ) { free ( valueQuery_timeOutInSecs ) ; valueQuery_timeOutInSecs = NULL ; } if ( keyPairQuery_timeOutInSecs ) { keyValuePair_free ( keyPairQuery_timeOutInSecs ) ; keyPairQuery_timeOutInSecs = NULL ; } return elementToReturn ; end : free ( localVarPath ) ; return NULL ; }
Stop a build of an organization pipeline
Stop a build of an organization pipeline
// create the path // Path Params // Path Params // Path Params // query parameters // query parameters //produces //nonprimitive not container // return 0; //return type