Files
openapi-generator/samples/client/petstore/c/api/PetAPI.h
Michele Albano fc9d4584ca PR to solve 2 open issues on enums: #5091 and #4293 (#5477)
* PR to solve 2 open issues on enums:
Issue 5091 needs to generate enums also when the enum is directly in a param to a API call, instead than in a model. I did that by copying and adapting enum code from *model* to *api*
Issue 4293 needs to decorate enums, for when enum names or enum values are repeated over the yaml definition.

* PR to solve 2 open issues on enums:
Issue 5091 needs to generate enums also when the enum is directly in a param to a API call, instead than in a model. I did that by copying and adapting enum code from *model* to *api*
Issue 4293 needs to decorate enums, for when enum names or enum values are repeated over the yaml definition.

* Enums decorated: with {{projectName}}_{{classVarName}}_{{enumName}}_ in the models, with {{projectName}}_{{classVarName}}_{{enumName}}_ in the operations.

* Changes to the c client:
- Removed white space.
- Removed ToJSON and FromJSON function for the enums, since they are not used
- Sanitized project name in the .java file. For example, this solves a problem with the issue #2338, where the yaml file had title: "Skycoin REST API."

* Changes to the c client:
- Removed white space.
- Removed ToJSON and FromJSON function for the enums, since they are not used
- Sanitized project name in the .java file. For example, this solves a problem with the issue #2338, where the yaml file had title: "Skycoin REST API."
2020-03-16 13:53:53 +08:00

68 lines
1.6 KiB
C

#include <stdlib.h>
#include <stdio.h>
#include "../include/apiClient.h"
#include "../include/list.h"
#include "../external/cJSON.h"
#include "../include/keyValuePair.h"
#include "../model/api_response.h"
#include "../model/pet.h"
// Enum STATUS for PetAPI_findPetsByStatus
typedef enum { openapi_petstore_findPetsByStatus_STATUS_NULL = 0, openapi_petstore_findPetsByStatus_STATUS_available, openapi_petstore_findPetsByStatus_STATUS_pending, openapi_petstore_findPetsByStatus_STATUS_sold } openapi_petstore_findPetsByStatus_status_e;
// Add a new pet to the store
//
void
PetAPI_addPet(apiClient_t *apiClient ,pet_t * body);
// Deletes a pet
//
void
PetAPI_deletePet(apiClient_t *apiClient ,long petId ,char * api_key);
// Finds Pets by status
//
// Multiple status values can be provided with comma separated strings
//
list_t*
PetAPI_findPetsByStatus(apiClient_t *apiClient ,list_t * status);
// Finds Pets by tags
//
// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
//
list_t*
PetAPI_findPetsByTags(apiClient_t *apiClient ,list_t * tags);
// Find pet by ID
//
// Returns a single pet
//
pet_t*
PetAPI_getPetById(apiClient_t *apiClient ,long petId);
// Update an existing pet
//
void
PetAPI_updatePet(apiClient_t *apiClient ,pet_t * body);
// Updates a pet in the store with form data
//
void
PetAPI_updatePetWithForm(apiClient_t *apiClient ,long petId ,char * name ,char * status);
// uploads an image
//
api_response_t*
PetAPI_uploadFile(apiClient_t *apiClient ,long petId ,char * additionalMetadata ,binary_t* file);