forked from loafle/openapi-generator-original
97 lines
3.1 KiB
Go
97 lines
3.1 KiB
Go
/*
|
|
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
|
*
|
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
|
*
|
|
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
|
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
|
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
*/
|
|
|
|
package swagger
|
|
|
|
import (
|
|
"net/url"
|
|
"strings"
|
|
)
|
|
|
|
type FakeApi struct {
|
|
Configuration *Configuration
|
|
}
|
|
|
|
func NewFakeApi() *FakeApi {
|
|
configuration := NewConfiguration()
|
|
return &FakeApi{
|
|
Configuration: configuration,
|
|
}
|
|
}
|
|
|
|
func NewFakeApiWithBasePath(basePath string) *FakeApi {
|
|
configuration := NewConfiguration()
|
|
configuration.BasePath = basePath
|
|
|
|
return &FakeApi{
|
|
Configuration: configuration,
|
|
}
|
|
}
|
|
|
|
/**
|
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
|
*
|
|
* @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
|
* @return void
|
|
*/
|
|
func (a FakeApi) TestCodeInjectEndRnNR(testCodeInjectEndRnNR string) (*APIResponse, error) {
|
|
|
|
var localVarHttpMethod = strings.ToUpper("Put")
|
|
// create path and map variables
|
|
localVarPath := a.Configuration.BasePath + "/fake"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := make(map[string]string)
|
|
var localVarPostBody interface{}
|
|
var localVarFileName string
|
|
var localVarFileBytes []byte
|
|
// add default headers if any
|
|
for key := range a.Configuration.DefaultHeader {
|
|
localVarHeaderParams[key] = a.Configuration.DefaultHeader[key]
|
|
}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "application/json", "*_/ ' =end -- ", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"*_/ ' =end -- ",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
localVarFormParams["testCodeInjectEndRnNR"] = a.Configuration.APIClient.ParameterToString(testCodeInjectEndRnNR, "")
|
|
localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
|
|
var localVarURL, _ = url.Parse(localVarPath)
|
|
localVarURL.RawQuery = localVarQueryParams.Encode()
|
|
var localVarAPIResponse = &APIResponse{Operation: "TestCodeInjectEndRnNR", Method: localVarHttpMethod, RequestURL: localVarURL.String()}
|
|
if localVarHttpResponse != nil {
|
|
localVarAPIResponse.Response = localVarHttpResponse.RawResponse
|
|
localVarAPIResponse.Payload = localVarHttpResponse.Body()
|
|
}
|
|
|
|
if err != nil {
|
|
return localVarAPIResponse, err
|
|
}
|
|
return localVarAPIResponse, err
|
|
}
|
|
|