fixed merge conflict

This commit is contained in:
Guo Huang 2016-05-03 10:16:47 -07:00
parent 3168de5f74
commit a5b08a8ce7
5 changed files with 85 additions and 85 deletions

View File

@ -37,7 +37,7 @@ func New{{classname}}WithBasePath(basePath string) *{{classname}} {
{{#allParams}} * @param {{paramName}} {{description}} {{#allParams}} * @param {{paramName}} {{description}}
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
*/ */
func (a {{classname}}) {{nickname}}({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}APIResponse, error) { func (a {{classname}}) {{nickname}}({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}*{{{returnType}}}, {{/returnType}}*APIResponse, error) {
var httpMethod = "{{httpMethod}}" var httpMethod = "{{httpMethod}}"
// create path and map variables // create path and map variables
@ -46,7 +46,7 @@ func (a {{classname}}) {{nickname}}({{#allParams}}{{paramName}} {{{dataType}}}{{
{{#allParams}}{{#required}} {{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set // verify the required parameter '{{paramName}}' is set
if &{{paramName}} == nil { if &{{paramName}} == nil {
return {{#returnType}}*new({{{returnType}}}), {{/returnType}}*NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") return {{#returnType}}new({{{returnType}}}), {{/returnType}}nil, errors.New("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}")
}{{/required}}{{/allParams}} }{{/required}}{{/allParams}}
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -113,10 +113,10 @@ func (a {{classname}}) {{nickname}}({{#allParams}}{{paramName}} {{{dataType}}}{{
{{#returnType}} var successPayload = new({{returnType}}){{/returnType}} {{#returnType}} var successPayload = new({{returnType}}){{/returnType}}
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return {{#returnType}}*successPayload, {{/returnType}}*NewAPIResponse(httpResponse.RawResponse), err return {{#returnType}}successPayload, {{/returnType}}NewAPIResponse(httpResponse.RawResponse), err
} }
{{#returnType}} {{#returnType}}
err = json.Unmarshal(httpResponse.Body(), &successPayload){{/returnType}} err = json.Unmarshal(httpResponse.Body(), &successPayload){{/returnType}}
return {{#returnType}}*successPayload, {{/returnType}}*NewAPIResponse(httpResponse.RawResponse), err return {{#returnType}}successPayload, {{/returnType}}NewAPIResponse(httpResponse.RawResponse), err
} }
{{/operation}}{{/operations}} {{/operation}}{{/operations}}

View File

@ -7,7 +7,7 @@ This API client was generated by the [swagger-codegen](https://github.com/swagge
- API version: 1.0.0 - API version: 1.0.0
- Package version: 1.0.0 - Package version: 1.0.0
- Build date: 2016-05-02T15:51:26.331+01:00 - Build date: 2016-05-03T10:14:09.589-07:00
- Build package: class io.swagger.codegen.languages.GoClientCodegen - Build package: class io.swagger.codegen.languages.GoClientCodegen
## Installation ## Installation

View File

@ -36,7 +36,7 @@ func NewPetApiWithBasePath(basePath string) *PetApi {
* @param body Pet object that needs to be added to the store * @param body Pet object that needs to be added to the store
* @return void * @return void
*/ */
func (a PetApi) AddPet(body Pet) (APIResponse, error) { func (a PetApi) AddPet(body Pet) (*APIResponse, error) {
var httpMethod = "Post" var httpMethod = "Post"
// create path and map variables // create path and map variables
@ -44,7 +44,7 @@ func (a PetApi) AddPet(body Pet) (APIResponse, error) {
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if &body == nil { if &body == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling PetApi->AddPet") return nil, errors.New("Missing required parameter 'body' when calling PetApi->AddPet")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -89,10 +89,10 @@ func (a PetApi) AddPet(body Pet) (APIResponse, error) {
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -103,7 +103,7 @@ func (a PetApi) AddPet(body Pet) (APIResponse, error) {
* @param apiKey * @param apiKey
* @return void * @return void
*/ */
func (a PetApi) DeletePet(petId int64, apiKey string) (APIResponse, error) { func (a PetApi) DeletePet(petId int64, apiKey string) (*APIResponse, error) {
var httpMethod = "Delete" var httpMethod = "Delete"
// create path and map variables // create path and map variables
@ -112,7 +112,7 @@ func (a PetApi) DeletePet(petId int64, apiKey string) (APIResponse, error) {
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if &petId == nil { if &petId == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'petId' when calling PetApi->DeletePet") return nil, errors.New("Missing required parameter 'petId' when calling PetApi->DeletePet")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -158,10 +158,10 @@ func (a PetApi) DeletePet(petId int64, apiKey string) (APIResponse, error) {
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -171,7 +171,7 @@ func (a PetApi) DeletePet(petId int64, apiKey string) (APIResponse, error) {
* @param status Status values that need to be considered for filter * @param status Status values that need to be considered for filter
* @return []Pet * @return []Pet
*/ */
func (a PetApi) FindPetsByStatus(status []string) ([]Pet, APIResponse, error) { func (a PetApi) FindPetsByStatus(status []string) (*[]Pet, *APIResponse, error) {
var httpMethod = "Get" var httpMethod = "Get"
// create path and map variables // create path and map variables
@ -179,7 +179,7 @@ func (a PetApi) FindPetsByStatus(status []string) ([]Pet, APIResponse, error) {
// verify the required parameter 'status' is set // verify the required parameter 'status' is set
if &status == nil { if &status == nil {
return *new([]Pet), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'status' when calling PetApi->FindPetsByStatus") return new([]Pet), nil, errors.New("Missing required parameter 'status' when calling PetApi->FindPetsByStatus")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -224,10 +224,10 @@ func (a PetApi) FindPetsByStatus(status []string) ([]Pet, APIResponse, error) {
var successPayload = new([]Pet) var successPayload = new([]Pet)
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
err = json.Unmarshal(httpResponse.Body(), &successPayload) err = json.Unmarshal(httpResponse.Body(), &successPayload)
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -237,7 +237,7 @@ func (a PetApi) FindPetsByStatus(status []string) ([]Pet, APIResponse, error) {
* @param tags Tags to filter by * @param tags Tags to filter by
* @return []Pet * @return []Pet
*/ */
func (a PetApi) FindPetsByTags(tags []string) ([]Pet, APIResponse, error) { func (a PetApi) FindPetsByTags(tags []string) (*[]Pet, *APIResponse, error) {
var httpMethod = "Get" var httpMethod = "Get"
// create path and map variables // create path and map variables
@ -245,7 +245,7 @@ func (a PetApi) FindPetsByTags(tags []string) ([]Pet, APIResponse, error) {
// verify the required parameter 'tags' is set // verify the required parameter 'tags' is set
if &tags == nil { if &tags == nil {
return *new([]Pet), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'tags' when calling PetApi->FindPetsByTags") return new([]Pet), nil, errors.New("Missing required parameter 'tags' when calling PetApi->FindPetsByTags")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -290,10 +290,10 @@ func (a PetApi) FindPetsByTags(tags []string) ([]Pet, APIResponse, error) {
var successPayload = new([]Pet) var successPayload = new([]Pet)
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
err = json.Unmarshal(httpResponse.Body(), &successPayload) err = json.Unmarshal(httpResponse.Body(), &successPayload)
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -303,7 +303,7 @@ func (a PetApi) FindPetsByTags(tags []string) ([]Pet, APIResponse, error) {
* @param petId ID of pet to return * @param petId ID of pet to return
* @return Pet * @return Pet
*/ */
func (a PetApi) GetPetById(petId int64) (Pet, APIResponse, error) { func (a PetApi) GetPetById(petId int64) (*Pet, *APIResponse, error) {
var httpMethod = "Get" var httpMethod = "Get"
// create path and map variables // create path and map variables
@ -312,7 +312,7 @@ func (a PetApi) GetPetById(petId int64) (Pet, APIResponse, error) {
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if &petId == nil { if &petId == nil {
return *new(Pet), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'petId' when calling PetApi->GetPetById") return new(Pet), nil, errors.New("Missing required parameter 'petId' when calling PetApi->GetPetById")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -353,10 +353,10 @@ func (a PetApi) GetPetById(petId int64) (Pet, APIResponse, error) {
var successPayload = new(Pet) var successPayload = new(Pet)
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
err = json.Unmarshal(httpResponse.Body(), &successPayload) err = json.Unmarshal(httpResponse.Body(), &successPayload)
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -366,7 +366,7 @@ func (a PetApi) GetPetById(petId int64) (Pet, APIResponse, error) {
* @param body Pet object that needs to be added to the store * @param body Pet object that needs to be added to the store
* @return void * @return void
*/ */
func (a PetApi) UpdatePet(body Pet) (APIResponse, error) { func (a PetApi) UpdatePet(body Pet) (*APIResponse, error) {
var httpMethod = "Put" var httpMethod = "Put"
// create path and map variables // create path and map variables
@ -374,7 +374,7 @@ func (a PetApi) UpdatePet(body Pet) (APIResponse, error) {
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if &body == nil { if &body == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling PetApi->UpdatePet") return nil, errors.New("Missing required parameter 'body' when calling PetApi->UpdatePet")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -419,10 +419,10 @@ func (a PetApi) UpdatePet(body Pet) (APIResponse, error) {
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -434,7 +434,7 @@ func (a PetApi) UpdatePet(body Pet) (APIResponse, error) {
* @param status Updated status of the pet * @param status Updated status of the pet
* @return void * @return void
*/ */
func (a PetApi) UpdatePetWithForm(petId int64, name string, status string) (APIResponse, error) { func (a PetApi) UpdatePetWithForm(petId int64, name string, status string) (*APIResponse, error) {
var httpMethod = "Post" var httpMethod = "Post"
// create path and map variables // create path and map variables
@ -443,7 +443,7 @@ func (a PetApi) UpdatePetWithForm(petId int64, name string, status string) (APIR
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if &petId == nil { if &petId == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm") return nil, errors.New("Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -488,10 +488,10 @@ func (a PetApi) UpdatePetWithForm(petId int64, name string, status string) (APIR
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -503,7 +503,7 @@ func (a PetApi) UpdatePetWithForm(petId int64, name string, status string) (APIR
* @param file file to upload * @param file file to upload
* @return ModelApiResponse * @return ModelApiResponse
*/ */
func (a PetApi) UploadFile(petId int64, additionalMetadata string, file *os.File) (ModelApiResponse, APIResponse, error) { func (a PetApi) UploadFile(petId int64, additionalMetadata string, file *os.File) (*ModelApiResponse, *APIResponse, error) {
var httpMethod = "Post" var httpMethod = "Post"
// create path and map variables // create path and map variables
@ -512,7 +512,7 @@ func (a PetApi) UploadFile(petId int64, additionalMetadata string, file *os.File
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if &petId == nil { if &petId == nil {
return *new(ModelApiResponse), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'petId' when calling PetApi->UploadFile") return new(ModelApiResponse), nil, errors.New("Missing required parameter 'petId' when calling PetApi->UploadFile")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -559,9 +559,9 @@ func (a PetApi) UploadFile(petId int64, additionalMetadata string, file *os.File
var successPayload = new(ModelApiResponse) var successPayload = new(ModelApiResponse)
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
err = json.Unmarshal(httpResponse.Body(), &successPayload) err = json.Unmarshal(httpResponse.Body(), &successPayload)
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }

View File

@ -34,7 +34,7 @@ func NewStoreApiWithBasePath(basePath string) *StoreApi {
* @param orderId ID of the order that needs to be deleted * @param orderId ID of the order that needs to be deleted
* @return void * @return void
*/ */
func (a StoreApi) DeleteOrder(orderId string) (APIResponse, error) { func (a StoreApi) DeleteOrder(orderId string) (*APIResponse, error) {
var httpMethod = "Delete" var httpMethod = "Delete"
// create path and map variables // create path and map variables
@ -43,7 +43,7 @@ func (a StoreApi) DeleteOrder(orderId string) (APIResponse, error) {
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
if &orderId == nil { if &orderId == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'orderId' when calling StoreApi->DeleteOrder") return nil, errors.New("Missing required parameter 'orderId' when calling StoreApi->DeleteOrder")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -80,10 +80,10 @@ func (a StoreApi) DeleteOrder(orderId string) (APIResponse, error) {
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -92,7 +92,7 @@ func (a StoreApi) DeleteOrder(orderId string) (APIResponse, error) {
* *
* @return map[string]int32 * @return map[string]int32
*/ */
func (a StoreApi) GetInventory() (map[string]int32, APIResponse, error) { func (a StoreApi) GetInventory() (*map[string]int32, *APIResponse, error) {
var httpMethod = "Get" var httpMethod = "Get"
// create path and map variables // create path and map variables
@ -136,10 +136,10 @@ func (a StoreApi) GetInventory() (map[string]int32, APIResponse, error) {
var successPayload = new(map[string]int32) var successPayload = new(map[string]int32)
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
err = json.Unmarshal(httpResponse.Body(), &successPayload) err = json.Unmarshal(httpResponse.Body(), &successPayload)
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -149,7 +149,7 @@ func (a StoreApi) GetInventory() (map[string]int32, APIResponse, error) {
* @param orderId ID of pet that needs to be fetched * @param orderId ID of pet that needs to be fetched
* @return Order * @return Order
*/ */
func (a StoreApi) GetOrderById(orderId int64) (Order, APIResponse, error) { func (a StoreApi) GetOrderById(orderId int64) (*Order, *APIResponse, error) {
var httpMethod = "Get" var httpMethod = "Get"
// create path and map variables // create path and map variables
@ -158,7 +158,7 @@ func (a StoreApi) GetOrderById(orderId int64) (Order, APIResponse, error) {
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
if &orderId == nil { if &orderId == nil {
return *new(Order), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'orderId' when calling StoreApi->GetOrderById") return new(Order), nil, errors.New("Missing required parameter 'orderId' when calling StoreApi->GetOrderById")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -195,10 +195,10 @@ func (a StoreApi) GetOrderById(orderId int64) (Order, APIResponse, error) {
var successPayload = new(Order) var successPayload = new(Order)
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
err = json.Unmarshal(httpResponse.Body(), &successPayload) err = json.Unmarshal(httpResponse.Body(), &successPayload)
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -208,7 +208,7 @@ func (a StoreApi) GetOrderById(orderId int64) (Order, APIResponse, error) {
* @param body order placed for purchasing the pet * @param body order placed for purchasing the pet
* @return Order * @return Order
*/ */
func (a StoreApi) PlaceOrder(body Order) (Order, APIResponse, error) { func (a StoreApi) PlaceOrder(body Order) (*Order, *APIResponse, error) {
var httpMethod = "Post" var httpMethod = "Post"
// create path and map variables // create path and map variables
@ -216,7 +216,7 @@ func (a StoreApi) PlaceOrder(body Order) (Order, APIResponse, error) {
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if &body == nil { if &body == nil {
return *new(Order), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling StoreApi->PlaceOrder") return new(Order), nil, errors.New("Missing required parameter 'body' when calling StoreApi->PlaceOrder")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -256,9 +256,9 @@ func (a StoreApi) PlaceOrder(body Order) (Order, APIResponse, error) {
var successPayload = new(Order) var successPayload = new(Order)
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
err = json.Unmarshal(httpResponse.Body(), &successPayload) err = json.Unmarshal(httpResponse.Body(), &successPayload)
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }

View File

@ -34,7 +34,7 @@ func NewUserApiWithBasePath(basePath string) *UserApi {
* @param body Created user object * @param body Created user object
* @return void * @return void
*/ */
func (a UserApi) CreateUser(body User) (APIResponse, error) { func (a UserApi) CreateUser(body User) (*APIResponse, error) {
var httpMethod = "Post" var httpMethod = "Post"
// create path and map variables // create path and map variables
@ -42,7 +42,7 @@ func (a UserApi) CreateUser(body User) (APIResponse, error) {
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if &body == nil { if &body == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling UserApi->CreateUser") return nil, errors.New("Missing required parameter 'body' when calling UserApi->CreateUser")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -82,10 +82,10 @@ func (a UserApi) CreateUser(body User) (APIResponse, error) {
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -95,7 +95,7 @@ func (a UserApi) CreateUser(body User) (APIResponse, error) {
* @param body List of user object * @param body List of user object
* @return void * @return void
*/ */
func (a UserApi) CreateUsersWithArrayInput(body []User) (APIResponse, error) { func (a UserApi) CreateUsersWithArrayInput(body []User) (*APIResponse, error) {
var httpMethod = "Post" var httpMethod = "Post"
// create path and map variables // create path and map variables
@ -103,7 +103,7 @@ func (a UserApi) CreateUsersWithArrayInput(body []User) (APIResponse, error) {
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if &body == nil { if &body == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput") return nil, errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -143,10 +143,10 @@ func (a UserApi) CreateUsersWithArrayInput(body []User) (APIResponse, error) {
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -156,7 +156,7 @@ func (a UserApi) CreateUsersWithArrayInput(body []User) (APIResponse, error) {
* @param body List of user object * @param body List of user object
* @return void * @return void
*/ */
func (a UserApi) CreateUsersWithListInput(body []User) (APIResponse, error) { func (a UserApi) CreateUsersWithListInput(body []User) (*APIResponse, error) {
var httpMethod = "Post" var httpMethod = "Post"
// create path and map variables // create path and map variables
@ -164,7 +164,7 @@ func (a UserApi) CreateUsersWithListInput(body []User) (APIResponse, error) {
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if &body == nil { if &body == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput") return nil, errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -204,10 +204,10 @@ func (a UserApi) CreateUsersWithListInput(body []User) (APIResponse, error) {
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -217,7 +217,7 @@ func (a UserApi) CreateUsersWithListInput(body []User) (APIResponse, error) {
* @param username The name that needs to be deleted * @param username The name that needs to be deleted
* @return void * @return void
*/ */
func (a UserApi) DeleteUser(username string) (APIResponse, error) { func (a UserApi) DeleteUser(username string) (*APIResponse, error) {
var httpMethod = "Delete" var httpMethod = "Delete"
// create path and map variables // create path and map variables
@ -226,7 +226,7 @@ func (a UserApi) DeleteUser(username string) (APIResponse, error) {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if &username == nil { if &username == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'username' when calling UserApi->DeleteUser") return nil, errors.New("Missing required parameter 'username' when calling UserApi->DeleteUser")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -263,10 +263,10 @@ func (a UserApi) DeleteUser(username string) (APIResponse, error) {
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -276,7 +276,7 @@ func (a UserApi) DeleteUser(username string) (APIResponse, error) {
* @param username The name that needs to be fetched. Use user1 for testing. * @param username The name that needs to be fetched. Use user1 for testing.
* @return User * @return User
*/ */
func (a UserApi) GetUserByName(username string) (User, APIResponse, error) { func (a UserApi) GetUserByName(username string) (*User, *APIResponse, error) {
var httpMethod = "Get" var httpMethod = "Get"
// create path and map variables // create path and map variables
@ -285,7 +285,7 @@ func (a UserApi) GetUserByName(username string) (User, APIResponse, error) {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if &username == nil { if &username == nil {
return *new(User), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'username' when calling UserApi->GetUserByName") return new(User), nil, errors.New("Missing required parameter 'username' when calling UserApi->GetUserByName")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -322,10 +322,10 @@ func (a UserApi) GetUserByName(username string) (User, APIResponse, error) {
var successPayload = new(User) var successPayload = new(User)
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
err = json.Unmarshal(httpResponse.Body(), &successPayload) err = json.Unmarshal(httpResponse.Body(), &successPayload)
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -336,7 +336,7 @@ func (a UserApi) GetUserByName(username string) (User, APIResponse, error) {
* @param password The password for login in clear text * @param password The password for login in clear text
* @return string * @return string
*/ */
func (a UserApi) LoginUser(username string, password string) (string, APIResponse, error) { func (a UserApi) LoginUser(username string, password string) (*string, *APIResponse, error) {
var httpMethod = "Get" var httpMethod = "Get"
// create path and map variables // create path and map variables
@ -344,11 +344,11 @@ func (a UserApi) LoginUser(username string, password string) (string, APIRespons
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if &username == nil { if &username == nil {
return *new(string), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'username' when calling UserApi->LoginUser") return new(string), nil, errors.New("Missing required parameter 'username' when calling UserApi->LoginUser")
} }
// verify the required parameter 'password' is set // verify the required parameter 'password' is set
if &password == nil { if &password == nil {
return *new(string), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'password' when calling UserApi->LoginUser") return new(string), nil, errors.New("Missing required parameter 'password' when calling UserApi->LoginUser")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -391,10 +391,10 @@ func (a UserApi) LoginUser(username string, password string) (string, APIRespons
var successPayload = new(string) var successPayload = new(string)
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
err = json.Unmarshal(httpResponse.Body(), &successPayload) err = json.Unmarshal(httpResponse.Body(), &successPayload)
return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err return successPayload, NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -403,7 +403,7 @@ func (a UserApi) LoginUser(username string, password string) (string, APIRespons
* *
* @return void * @return void
*/ */
func (a UserApi) LogoutUser() (APIResponse, error) { func (a UserApi) LogoutUser() (*APIResponse, error) {
var httpMethod = "Get" var httpMethod = "Get"
// create path and map variables // create path and map variables
@ -444,10 +444,10 @@ func (a UserApi) LogoutUser() (APIResponse, error) {
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
/** /**
@ -458,7 +458,7 @@ func (a UserApi) LogoutUser() (APIResponse, error) {
* @param body Updated user object * @param body Updated user object
* @return void * @return void
*/ */
func (a UserApi) UpdateUser(username string, body User) (APIResponse, error) { func (a UserApi) UpdateUser(username string, body User) (*APIResponse, error) {
var httpMethod = "Put" var httpMethod = "Put"
// create path and map variables // create path and map variables
@ -467,11 +467,11 @@ func (a UserApi) UpdateUser(username string, body User) (APIResponse, error) {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if &username == nil { if &username == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'username' when calling UserApi->UpdateUser") return nil, errors.New("Missing required parameter 'username' when calling UserApi->UpdateUser")
} }
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if &body == nil { if &body == nil {
return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling UserApi->UpdateUser") return nil, errors.New("Missing required parameter 'body' when calling UserApi->UpdateUser")
} }
headerParams := make(map[string]string) headerParams := make(map[string]string)
@ -511,9 +511,9 @@ func (a UserApi) UpdateUser(username string, body User) (APIResponse, error) {
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
if err != nil { if err != nil {
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }
return *NewAPIResponse(httpResponse.RawResponse), err return NewAPIResponse(httpResponse.RawResponse), err
} }