forked from loafle/openapi-generator-original
Import Go package with leading underscore (#3634)
* escape import with underscore in go client * revert changes to test spec
This commit is contained in:
parent
94d4e0cfac
commit
55786119e7
@ -3,17 +3,17 @@ package {{packageName}}
|
||||
|
||||
{{#operations}}
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
{{#imports}} "{{import}}"
|
||||
{{/imports}}
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type {{classname}}Service service
|
||||
@ -24,7 +24,7 @@ type {{classname}}Service service
|
||||
{{#notes}}
|
||||
{{notes}}
|
||||
{{/notes}}
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
{{#allParams}}
|
||||
{{#required}}
|
||||
* @param {{paramName}}{{#description}} {{{.}}}{{/description}}
|
||||
@ -63,9 +63,9 @@ type {{{nickname}}}Opts struct {
|
||||
}
|
||||
|
||||
{{/hasOptionalParams}}
|
||||
func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*http.Response, error) {
|
||||
func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.Method{{httpMethod}}
|
||||
localVarHttpMethod = _nethttp.Method{{httpMethod}}
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -80,8 +80,8 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", fmt.Sprintf("%v", {{paramName}}), -1){{/pathParams}}
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
{{#allParams}}
|
||||
{{#required}}
|
||||
{{#minItems}}
|
||||
@ -218,7 +218,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
|
||||
}
|
||||
{{/required}}
|
||||
if localVarFile != nil {
|
||||
fbs, _ := ioutil.ReadAll(localVarFile)
|
||||
fbs, _ := _ioutil.ReadAll(localVarFile)
|
||||
localVarFileBytes = fbs
|
||||
localVarFileName = localVarFile.Name()
|
||||
localVarFile.Close()
|
||||
@ -303,7 +303,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
|
||||
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err
|
||||
|
@ -11,15 +11,15 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type AnotherFakeApiService service
|
||||
@ -27,13 +27,13 @@ type AnotherFakeApiService service
|
||||
/*
|
||||
AnotherFakeApiService To test special tags
|
||||
To test special tags and operation ID starting with number
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body client model
|
||||
@return Client
|
||||
*/
|
||||
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body Client) (Client, *http.Response, error) {
|
||||
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPatch
|
||||
localVarHttpMethod = _nethttp.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -45,8 +45,8 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body
|
||||
localVarPath := a.client.cfg.BasePath + "/another-fake/dummy"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
@ -77,7 +77,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
|
@ -11,17 +11,17 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
"github.com/antihax/optional"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type FakeApiService service
|
||||
@ -29,12 +29,12 @@ type FakeApiService service
|
||||
/*
|
||||
FakeApiService creates an XmlItem
|
||||
this route creates an XmlItem
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param xmlItem XmlItem Body
|
||||
*/
|
||||
func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*http.Response, error) {
|
||||
func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -45,8 +45,8 @@ func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*h
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/create_xml_item"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"}
|
||||
@ -77,7 +77,7 @@ func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*h
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -97,7 +97,7 @@ func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*h
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of outer boolean types
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.Bool) - Input boolean as post body
|
||||
@return bool
|
||||
@ -107,9 +107,9 @@ type FakeOuterBooleanSerializeOpts struct {
|
||||
Body optional.Bool
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -121,8 +121,8 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -156,7 +156,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -195,7 +195,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of object with outer number type
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.Interface of OuterComposite) - Input composite as post body
|
||||
@return OuterComposite
|
||||
@ -205,9 +205,9 @@ type FakeOuterCompositeSerializeOpts struct {
|
||||
Body optional.Interface
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -219,8 +219,8 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/outer/composite"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -258,7 +258,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -297,7 +297,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of outer number types
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.Float32) - Input number as post body
|
||||
@return float32
|
||||
@ -307,9 +307,9 @@ type FakeOuterNumberSerializeOpts struct {
|
||||
Body optional.Float32
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -321,8 +321,8 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/outer/number"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -356,7 +356,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -395,7 +395,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of outer string types
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.String) - Input string as post body
|
||||
@return string
|
||||
@ -405,9 +405,9 @@ type FakeOuterStringSerializeOpts struct {
|
||||
Body optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -419,8 +419,8 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/outer/string"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -454,7 +454,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -493,12 +493,12 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
/*
|
||||
FakeApiService
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body
|
||||
*/
|
||||
func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSchemaTestClass) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileSchemaTestClass) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPut
|
||||
localVarHttpMethod = _nethttp.MethodPut
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -509,8 +509,8 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSc
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
@ -541,7 +541,7 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSc
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -560,13 +560,13 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSc
|
||||
|
||||
/*
|
||||
FakeApiService
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param query
|
||||
* @param body
|
||||
*/
|
||||
func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, body User) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, body User) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPut
|
||||
localVarHttpMethod = _nethttp.MethodPut
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -577,8 +577,8 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
localVarQueryParams.Add("query", parameterToString(query, ""))
|
||||
// to determine the Content-Type header
|
||||
@ -610,7 +610,7 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -630,13 +630,13 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri
|
||||
/*
|
||||
FakeApiService To test \"client\" model
|
||||
To test \"client\" model
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body client model
|
||||
@return Client
|
||||
*/
|
||||
func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Client, *http.Response, error) {
|
||||
func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPatch
|
||||
localVarHttpMethod = _nethttp.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -648,8 +648,8 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie
|
||||
localVarPath := a.client.cfg.BasePath + "/fake"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
@ -680,7 +680,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -719,7 +719,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie
|
||||
/*
|
||||
FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param number None
|
||||
* @param double None
|
||||
* @param patternWithoutDelimiter None
|
||||
@ -750,9 +750,9 @@ type TestEndpointParametersOpts struct {
|
||||
Callback optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -763,8 +763,8 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
localVarPath := a.client.cfg.BasePath + "/fake"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
if number < 32.1 {
|
||||
return nil, reportError("number must be greater than 32.1")
|
||||
}
|
||||
@ -824,7 +824,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
}
|
||||
}
|
||||
if localVarFile != nil {
|
||||
fbs, _ := ioutil.ReadAll(localVarFile)
|
||||
fbs, _ := _ioutil.ReadAll(localVarFile)
|
||||
localVarFileBytes = fbs
|
||||
localVarFileName = localVarFile.Name()
|
||||
localVarFile.Close()
|
||||
@ -855,7 +855,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -875,7 +875,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
/*
|
||||
FakeApiService To test enum parameters
|
||||
To test enum parameters
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *TestEnumParametersOpts - Optional Parameters:
|
||||
* @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array)
|
||||
* @param "EnumHeaderString" (optional.String) - Header parameter enum test (string)
|
||||
@ -898,9 +898,9 @@ type TestEnumParametersOpts struct {
|
||||
EnumFormString optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -911,8 +911,8 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
localVarPath := a.client.cfg.BasePath + "/fake"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() {
|
||||
localVarQueryParams.Add("enum_query_string_array", parameterToString(localVarOptionals.EnumQueryStringArray.Value(), "csv"))
|
||||
@ -965,7 +965,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -985,7 +985,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
/*
|
||||
FakeApiService Fake endpoint to test group parameters (optional)
|
||||
Fake endpoint to test group parameters (optional)
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param requiredStringGroup Required String in group parameters
|
||||
* @param requiredBooleanGroup Required Boolean in group parameters
|
||||
* @param requiredInt64Group Required Integer in group parameters
|
||||
@ -1001,9 +1001,9 @@ type TestGroupParametersOpts struct {
|
||||
Int64Group optional.Int64
|
||||
}
|
||||
|
||||
func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodDelete
|
||||
localVarHttpMethod = _nethttp.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -1014,8 +1014,8 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString
|
||||
localVarPath := a.client.cfg.BasePath + "/fake"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, ""))
|
||||
localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, ""))
|
||||
@ -1056,7 +1056,7 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -1075,12 +1075,12 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString
|
||||
|
||||
/*
|
||||
FakeApiService test inline additionalProperties
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param param request body
|
||||
*/
|
||||
func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, param map[string]string) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, param map[string]string) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -1091,8 +1091,8 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
@ -1123,7 +1123,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -1142,13 +1142,13 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par
|
||||
|
||||
/*
|
||||
FakeApiService test json serialization of form data
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param param field1
|
||||
* @param param2 field2
|
||||
*/
|
||||
func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -1159,8 +1159,8 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"}
|
||||
@ -1191,7 +1191,7 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
|
@ -11,15 +11,15 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type FakeClassnameTags123ApiService service
|
||||
@ -27,13 +27,13 @@ type FakeClassnameTags123ApiService service
|
||||
/*
|
||||
FakeClassnameTags123ApiService To test class name in snake case
|
||||
To test class name in snake case
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body client model
|
||||
@return Client
|
||||
*/
|
||||
func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body Client) (Client, *http.Response, error) {
|
||||
func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPatch
|
||||
localVarHttpMethod = _nethttp.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -45,8 +45,8 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body
|
||||
localVarPath := a.client.cfg.BasePath + "/fake_classname_test"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
@ -89,7 +89,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
|
@ -11,10 +11,10 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
"fmt"
|
||||
"strings"
|
||||
"github.com/antihax/optional"
|
||||
@ -23,19 +23,19 @@ import (
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type PetApiService service
|
||||
|
||||
/*
|
||||
PetApiService Add a new pet to the store
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body Pet object that needs to be added to the store
|
||||
*/
|
||||
func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, error) {
|
||||
func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -46,8 +46,8 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e
|
||||
localVarPath := a.client.cfg.BasePath + "/pet"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json", "application/xml"}
|
||||
@ -78,7 +78,7 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -97,7 +97,7 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e
|
||||
|
||||
/*
|
||||
PetApiService Deletes a pet
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId Pet id to delete
|
||||
* @param optional nil or *DeletePetOpts - Optional Parameters:
|
||||
* @param "ApiKey" (optional.String) -
|
||||
@ -107,9 +107,9 @@ type DeletePetOpts struct {
|
||||
ApiKey optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) {
|
||||
func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodDelete
|
||||
localVarHttpMethod = _nethttp.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -121,8 +121,8 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -154,7 +154,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -174,13 +174,13 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
/*
|
||||
PetApiService Finds Pets by status
|
||||
Multiple status values can be provided with comma separated strings
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param status Status values that need to be considered for filter
|
||||
@return []Pet
|
||||
*/
|
||||
func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) {
|
||||
func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -192,8 +192,8 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
localVarPath := a.client.cfg.BasePath + "/pet/findByStatus"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
localVarQueryParams.Add("status", parameterToString(status, "csv"))
|
||||
// to determine the Content-Type header
|
||||
@ -223,7 +223,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -262,13 +262,13 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
/*
|
||||
PetApiService Finds Pets by tags
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param tags Tags to filter by
|
||||
@return []Pet
|
||||
*/
|
||||
func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) {
|
||||
func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -280,8 +280,8 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
localVarPath := a.client.cfg.BasePath + "/pet/findByTags"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
localVarQueryParams.Add("tags", parameterToString(tags, "csv"))
|
||||
// to determine the Content-Type header
|
||||
@ -311,7 +311,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -350,13 +350,13 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
/*
|
||||
PetApiService Find pet by ID
|
||||
Returns a single pet
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet to return
|
||||
@return Pet
|
||||
*/
|
||||
func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) {
|
||||
func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -369,8 +369,8 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -411,7 +411,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -449,12 +449,12 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
|
||||
/*
|
||||
PetApiService Update an existing pet
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body Pet object that needs to be added to the store
|
||||
*/
|
||||
func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response, error) {
|
||||
func (a *PetApiService) UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPut
|
||||
localVarHttpMethod = _nethttp.MethodPut
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -465,8 +465,8 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response
|
||||
localVarPath := a.client.cfg.BasePath + "/pet"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json", "application/xml"}
|
||||
@ -497,7 +497,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -516,7 +516,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response
|
||||
|
||||
/*
|
||||
PetApiService Updates a pet in the store with form data
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param optional nil or *UpdatePetWithFormOpts - Optional Parameters:
|
||||
* @param "Name" (optional.String) - Updated name of the pet
|
||||
@ -528,9 +528,9 @@ type UpdatePetWithFormOpts struct {
|
||||
Status optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) {
|
||||
func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -542,8 +542,8 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"}
|
||||
@ -578,7 +578,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -597,7 +597,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
|
||||
/*
|
||||
PetApiService uploads an image
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet to update
|
||||
* @param optional nil or *UploadFileOpts - Optional Parameters:
|
||||
* @param "AdditionalMetadata" (optional.String) - Additional data to pass to server
|
||||
@ -610,9 +610,9 @@ type UploadFileOpts struct {
|
||||
File optional.Interface
|
||||
}
|
||||
|
||||
func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error) {
|
||||
func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -625,8 +625,8 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"multipart/form-data"}
|
||||
@ -658,7 +658,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
}
|
||||
}
|
||||
if localVarFile != nil {
|
||||
fbs, _ := ioutil.ReadAll(localVarFile)
|
||||
fbs, _ := _ioutil.ReadAll(localVarFile)
|
||||
localVarFileBytes = fbs
|
||||
localVarFileName = localVarFile.Name()
|
||||
localVarFile.Close()
|
||||
@ -673,7 +673,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -711,7 +711,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
|
||||
/*
|
||||
PetApiService uploads an image (required)
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet to update
|
||||
* @param requiredFile file to upload
|
||||
* @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters:
|
||||
@ -723,9 +723,9 @@ type UploadFileWithRequiredFileOpts struct {
|
||||
AdditionalMetadata optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) {
|
||||
func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -738,8 +738,8 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"multipart/form-data"}
|
||||
@ -764,7 +764,7 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in
|
||||
localVarFormFileName = "requiredFile"
|
||||
localVarFile := requiredFile
|
||||
if localVarFile != nil {
|
||||
fbs, _ := ioutil.ReadAll(localVarFile)
|
||||
fbs, _ := _ioutil.ReadAll(localVarFile)
|
||||
localVarFileBytes = fbs
|
||||
localVarFileName = localVarFile.Name()
|
||||
localVarFile.Close()
|
||||
@ -779,7 +779,7 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
|
@ -11,17 +11,17 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type StoreApiService service
|
||||
@ -29,12 +29,12 @@ type StoreApiService service
|
||||
/*
|
||||
StoreApiService Delete purchase order by ID
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) {
|
||||
func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodDelete
|
||||
localVarHttpMethod = _nethttp.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -46,8 +46,8 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -76,7 +76,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -96,12 +96,12 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
/*
|
||||
StoreApiService Returns pet inventories by status
|
||||
Returns a map of status codes to quantities
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return map[string]int32
|
||||
*/
|
||||
func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) {
|
||||
func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -113,8 +113,8 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
localVarPath := a.client.cfg.BasePath + "/store/inventory"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -155,7 +155,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -194,13 +194,13 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
/*
|
||||
StoreApiService Find purchase order by ID
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
@return Order
|
||||
*/
|
||||
func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) {
|
||||
func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -213,8 +213,8 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
if orderId < 1 {
|
||||
return localVarReturnValue, nil, reportError("orderId must be greater than 1")
|
||||
}
|
||||
@ -249,7 +249,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -287,13 +287,13 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
|
||||
/*
|
||||
StoreApiService Place an order for a pet
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body order placed for purchasing the pet
|
||||
@return Order
|
||||
*/
|
||||
func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *http.Response, error) {
|
||||
func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -305,8 +305,8 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h
|
||||
localVarPath := a.client.cfg.BasePath + "/store/order"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -337,7 +337,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
|
@ -11,17 +11,17 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type UserApiService service
|
||||
@ -29,12 +29,12 @@ type UserApiService service
|
||||
/*
|
||||
UserApiService Create user
|
||||
This can only be done by the logged in user.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body Created user object
|
||||
*/
|
||||
func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Response, error) {
|
||||
func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -45,8 +45,8 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo
|
||||
localVarPath := a.client.cfg.BasePath + "/user"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -77,7 +77,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -96,12 +96,12 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo
|
||||
|
||||
/*
|
||||
UserApiService Creates list of users with given input array
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body List of user object
|
||||
*/
|
||||
func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []User) (*http.Response, error) {
|
||||
func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -112,8 +112,8 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U
|
||||
localVarPath := a.client.cfg.BasePath + "/user/createWithArray"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -144,7 +144,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -163,12 +163,12 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U
|
||||
|
||||
/*
|
||||
UserApiService Creates list of users with given input array
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body List of user object
|
||||
*/
|
||||
func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []User) (*http.Response, error) {
|
||||
func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -179,8 +179,8 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us
|
||||
localVarPath := a.client.cfg.BasePath + "/user/createWithList"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -211,7 +211,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -231,12 +231,12 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us
|
||||
/*
|
||||
UserApiService Delete user
|
||||
This can only be done by the logged in user.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) {
|
||||
func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodDelete
|
||||
localVarHttpMethod = _nethttp.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -248,8 +248,8 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -278,7 +278,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -297,13 +297,13 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
|
||||
/*
|
||||
UserApiService Get user by user name
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
@return User
|
||||
*/
|
||||
func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) {
|
||||
func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -316,8 +316,8 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -346,7 +346,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -384,14 +384,14 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
|
||||
/*
|
||||
UserApiService Logs user into the system
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
@return string
|
||||
*/
|
||||
func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) {
|
||||
func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -403,8 +403,8 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
localVarPath := a.client.cfg.BasePath + "/user/login"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
localVarQueryParams.Add("username", parameterToString(username, ""))
|
||||
localVarQueryParams.Add("password", parameterToString(password, ""))
|
||||
@ -435,7 +435,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -473,11 +473,11 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
|
||||
/*
|
||||
UserApiService Logs out current logged in user session
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
*/
|
||||
func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) {
|
||||
func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -488,8 +488,8 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
localVarPath := a.client.cfg.BasePath + "/user/logout"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -518,7 +518,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -538,13 +538,13 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
/*
|
||||
UserApiService Updated user
|
||||
This can only be done by the logged in user.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
*/
|
||||
func (a *UserApiService) UpdateUser(ctx context.Context, username string, body User) (*http.Response, error) {
|
||||
func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPut
|
||||
localVarHttpMethod = _nethttp.MethodPut
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -556,8 +556,8 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -588,7 +588,7 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
|
@ -10,15 +10,15 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type AnotherFakeApiService service
|
||||
@ -26,13 +26,13 @@ type AnotherFakeApiService service
|
||||
/*
|
||||
AnotherFakeApiService To test special tags
|
||||
To test special tags and operation ID starting with number
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body client model
|
||||
@return Client
|
||||
*/
|
||||
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body Client) (Client, *http.Response, error) {
|
||||
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPatch
|
||||
localVarHttpMethod = _nethttp.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -44,8 +44,8 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body
|
||||
localVarPath := a.client.cfg.BasePath + "/another-fake/dummy"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
@ -76,7 +76,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
|
@ -10,17 +10,17 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
"github.com/antihax/optional"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type FakeApiService service
|
||||
@ -28,12 +28,12 @@ type FakeApiService service
|
||||
/*
|
||||
FakeApiService creates an XmlItem
|
||||
this route creates an XmlItem
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param xmlItem XmlItem Body
|
||||
*/
|
||||
func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*http.Response, error) {
|
||||
func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -44,8 +44,8 @@ func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*h
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/create_xml_item"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"}
|
||||
@ -76,7 +76,7 @@ func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*h
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -96,7 +96,7 @@ func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*h
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of outer boolean types
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.Bool) - Input boolean as post body
|
||||
@return bool
|
||||
@ -106,9 +106,9 @@ type FakeOuterBooleanSerializeOpts struct {
|
||||
Body optional.Bool
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -120,8 +120,8 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -155,7 +155,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -194,7 +194,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of object with outer number type
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.Interface of OuterComposite) - Input composite as post body
|
||||
@return OuterComposite
|
||||
@ -204,9 +204,9 @@ type FakeOuterCompositeSerializeOpts struct {
|
||||
Body optional.Interface
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -218,8 +218,8 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/outer/composite"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -257,7 +257,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -296,7 +296,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of outer number types
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.Float32) - Input number as post body
|
||||
@return float32
|
||||
@ -306,9 +306,9 @@ type FakeOuterNumberSerializeOpts struct {
|
||||
Body optional.Float32
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -320,8 +320,8 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/outer/number"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -355,7 +355,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -394,7 +394,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of outer string types
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.String) - Input string as post body
|
||||
@return string
|
||||
@ -404,9 +404,9 @@ type FakeOuterStringSerializeOpts struct {
|
||||
Body optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -418,8 +418,8 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/outer/string"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -453,7 +453,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -492,12 +492,12 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
/*
|
||||
FakeApiService
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body
|
||||
*/
|
||||
func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSchemaTestClass) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileSchemaTestClass) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPut
|
||||
localVarHttpMethod = _nethttp.MethodPut
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -508,8 +508,8 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSc
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
@ -540,7 +540,7 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSc
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -559,13 +559,13 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSc
|
||||
|
||||
/*
|
||||
FakeApiService
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param query
|
||||
* @param body
|
||||
*/
|
||||
func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, body User) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, body User) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPut
|
||||
localVarHttpMethod = _nethttp.MethodPut
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -576,8 +576,8 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
localVarQueryParams.Add("query", parameterToString(query, ""))
|
||||
// to determine the Content-Type header
|
||||
@ -609,7 +609,7 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -629,13 +629,13 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri
|
||||
/*
|
||||
FakeApiService To test \"client\" model
|
||||
To test \"client\" model
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body client model
|
||||
@return Client
|
||||
*/
|
||||
func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Client, *http.Response, error) {
|
||||
func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPatch
|
||||
localVarHttpMethod = _nethttp.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -647,8 +647,8 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie
|
||||
localVarPath := a.client.cfg.BasePath + "/fake"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
@ -679,7 +679,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -718,7 +718,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie
|
||||
/*
|
||||
FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param number None
|
||||
* @param double None
|
||||
* @param patternWithoutDelimiter None
|
||||
@ -749,9 +749,9 @@ type TestEndpointParametersOpts struct {
|
||||
Callback optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -762,8 +762,8 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
localVarPath := a.client.cfg.BasePath + "/fake"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
if number < 32.1 {
|
||||
return nil, reportError("number must be greater than 32.1")
|
||||
}
|
||||
@ -823,7 +823,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
}
|
||||
}
|
||||
if localVarFile != nil {
|
||||
fbs, _ := ioutil.ReadAll(localVarFile)
|
||||
fbs, _ := _ioutil.ReadAll(localVarFile)
|
||||
localVarFileBytes = fbs
|
||||
localVarFileName = localVarFile.Name()
|
||||
localVarFile.Close()
|
||||
@ -854,7 +854,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -874,7 +874,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
/*
|
||||
FakeApiService To test enum parameters
|
||||
To test enum parameters
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *TestEnumParametersOpts - Optional Parameters:
|
||||
* @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array)
|
||||
* @param "EnumHeaderString" (optional.String) - Header parameter enum test (string)
|
||||
@ -897,9 +897,9 @@ type TestEnumParametersOpts struct {
|
||||
EnumFormString optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -910,8 +910,8 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
localVarPath := a.client.cfg.BasePath + "/fake"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() {
|
||||
localVarQueryParams.Add("enum_query_string_array", parameterToString(localVarOptionals.EnumQueryStringArray.Value(), "csv"))
|
||||
@ -964,7 +964,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -984,7 +984,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
/*
|
||||
FakeApiService Fake endpoint to test group parameters (optional)
|
||||
Fake endpoint to test group parameters (optional)
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param requiredStringGroup Required String in group parameters
|
||||
* @param requiredBooleanGroup Required Boolean in group parameters
|
||||
* @param requiredInt64Group Required Integer in group parameters
|
||||
@ -1000,9 +1000,9 @@ type TestGroupParametersOpts struct {
|
||||
Int64Group optional.Int64
|
||||
}
|
||||
|
||||
func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodDelete
|
||||
localVarHttpMethod = _nethttp.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -1013,8 +1013,8 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString
|
||||
localVarPath := a.client.cfg.BasePath + "/fake"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, ""))
|
||||
localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, ""))
|
||||
@ -1055,7 +1055,7 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -1074,12 +1074,12 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString
|
||||
|
||||
/*
|
||||
FakeApiService test inline additionalProperties
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param param request body
|
||||
*/
|
||||
func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, param map[string]string) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, param map[string]string) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -1090,8 +1090,8 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
@ -1122,7 +1122,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -1141,13 +1141,13 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par
|
||||
|
||||
/*
|
||||
FakeApiService test json serialization of form data
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param param field1
|
||||
* @param param2 field2
|
||||
*/
|
||||
func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -1158,8 +1158,8 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"}
|
||||
@ -1190,7 +1190,7 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
|
@ -10,15 +10,15 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type FakeClassnameTags123ApiService service
|
||||
@ -26,13 +26,13 @@ type FakeClassnameTags123ApiService service
|
||||
/*
|
||||
FakeClassnameTags123ApiService To test class name in snake case
|
||||
To test class name in snake case
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body client model
|
||||
@return Client
|
||||
*/
|
||||
func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body Client) (Client, *http.Response, error) {
|
||||
func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPatch
|
||||
localVarHttpMethod = _nethttp.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -44,8 +44,8 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body
|
||||
localVarPath := a.client.cfg.BasePath + "/fake_classname_test"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
@ -88,7 +88,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
|
@ -10,10 +10,10 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
"fmt"
|
||||
"strings"
|
||||
"github.com/antihax/optional"
|
||||
@ -22,19 +22,19 @@ import (
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type PetApiService service
|
||||
|
||||
/*
|
||||
PetApiService Add a new pet to the store
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body Pet object that needs to be added to the store
|
||||
*/
|
||||
func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, error) {
|
||||
func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -45,8 +45,8 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e
|
||||
localVarPath := a.client.cfg.BasePath + "/pet"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json", "application/xml"}
|
||||
@ -77,7 +77,7 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -96,7 +96,7 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e
|
||||
|
||||
/*
|
||||
PetApiService Deletes a pet
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId Pet id to delete
|
||||
* @param optional nil or *DeletePetOpts - Optional Parameters:
|
||||
* @param "ApiKey" (optional.String) -
|
||||
@ -106,9 +106,9 @@ type DeletePetOpts struct {
|
||||
ApiKey optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) {
|
||||
func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodDelete
|
||||
localVarHttpMethod = _nethttp.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -120,8 +120,8 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -153,7 +153,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -173,13 +173,13 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
/*
|
||||
PetApiService Finds Pets by status
|
||||
Multiple status values can be provided with comma separated strings
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param status Status values that need to be considered for filter
|
||||
@return []Pet
|
||||
*/
|
||||
func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) {
|
||||
func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -191,8 +191,8 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
localVarPath := a.client.cfg.BasePath + "/pet/findByStatus"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
localVarQueryParams.Add("status", parameterToString(status, "csv"))
|
||||
// to determine the Content-Type header
|
||||
@ -222,7 +222,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -261,13 +261,13 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
/*
|
||||
PetApiService Finds Pets by tags
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param tags Tags to filter by
|
||||
@return []Pet
|
||||
*/
|
||||
func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) {
|
||||
func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -279,8 +279,8 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
localVarPath := a.client.cfg.BasePath + "/pet/findByTags"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
localVarQueryParams.Add("tags", parameterToString(tags, "csv"))
|
||||
// to determine the Content-Type header
|
||||
@ -310,7 +310,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -349,13 +349,13 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
/*
|
||||
PetApiService Find pet by ID
|
||||
Returns a single pet
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet to return
|
||||
@return Pet
|
||||
*/
|
||||
func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) {
|
||||
func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -368,8 +368,8 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -410,7 +410,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -448,12 +448,12 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
|
||||
/*
|
||||
PetApiService Update an existing pet
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body Pet object that needs to be added to the store
|
||||
*/
|
||||
func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response, error) {
|
||||
func (a *PetApiService) UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPut
|
||||
localVarHttpMethod = _nethttp.MethodPut
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -464,8 +464,8 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response
|
||||
localVarPath := a.client.cfg.BasePath + "/pet"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json", "application/xml"}
|
||||
@ -496,7 +496,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -515,7 +515,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response
|
||||
|
||||
/*
|
||||
PetApiService Updates a pet in the store with form data
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param optional nil or *UpdatePetWithFormOpts - Optional Parameters:
|
||||
* @param "Name" (optional.String) - Updated name of the pet
|
||||
@ -527,9 +527,9 @@ type UpdatePetWithFormOpts struct {
|
||||
Status optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) {
|
||||
func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -541,8 +541,8 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"}
|
||||
@ -577,7 +577,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -596,7 +596,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
|
||||
/*
|
||||
PetApiService uploads an image
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet to update
|
||||
* @param optional nil or *UploadFileOpts - Optional Parameters:
|
||||
* @param "AdditionalMetadata" (optional.String) - Additional data to pass to server
|
||||
@ -609,9 +609,9 @@ type UploadFileOpts struct {
|
||||
File optional.Interface
|
||||
}
|
||||
|
||||
func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error) {
|
||||
func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -624,8 +624,8 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"multipart/form-data"}
|
||||
@ -657,7 +657,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
}
|
||||
}
|
||||
if localVarFile != nil {
|
||||
fbs, _ := ioutil.ReadAll(localVarFile)
|
||||
fbs, _ := _ioutil.ReadAll(localVarFile)
|
||||
localVarFileBytes = fbs
|
||||
localVarFileName = localVarFile.Name()
|
||||
localVarFile.Close()
|
||||
@ -672,7 +672,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -710,7 +710,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
|
||||
/*
|
||||
PetApiService uploads an image (required)
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet to update
|
||||
* @param requiredFile file to upload
|
||||
* @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters:
|
||||
@ -722,9 +722,9 @@ type UploadFileWithRequiredFileOpts struct {
|
||||
AdditionalMetadata optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) {
|
||||
func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -737,8 +737,8 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"multipart/form-data"}
|
||||
@ -763,7 +763,7 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in
|
||||
localVarFormFileName = "requiredFile"
|
||||
localVarFile := requiredFile
|
||||
if localVarFile != nil {
|
||||
fbs, _ := ioutil.ReadAll(localVarFile)
|
||||
fbs, _ := _ioutil.ReadAll(localVarFile)
|
||||
localVarFileBytes = fbs
|
||||
localVarFileName = localVarFile.Name()
|
||||
localVarFile.Close()
|
||||
@ -778,7 +778,7 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
|
@ -10,17 +10,17 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type StoreApiService service
|
||||
@ -28,12 +28,12 @@ type StoreApiService service
|
||||
/*
|
||||
StoreApiService Delete purchase order by ID
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) {
|
||||
func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodDelete
|
||||
localVarHttpMethod = _nethttp.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -45,8 +45,8 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -75,7 +75,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -95,12 +95,12 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
/*
|
||||
StoreApiService Returns pet inventories by status
|
||||
Returns a map of status codes to quantities
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return map[string]int32
|
||||
*/
|
||||
func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) {
|
||||
func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -112,8 +112,8 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
localVarPath := a.client.cfg.BasePath + "/store/inventory"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -154,7 +154,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -193,13 +193,13 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
/*
|
||||
StoreApiService Find purchase order by ID
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
@return Order
|
||||
*/
|
||||
func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) {
|
||||
func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -212,8 +212,8 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
if orderId < 1 {
|
||||
return localVarReturnValue, nil, reportError("orderId must be greater than 1")
|
||||
}
|
||||
@ -248,7 +248,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -286,13 +286,13 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
|
||||
/*
|
||||
StoreApiService Place an order for a pet
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body order placed for purchasing the pet
|
||||
@return Order
|
||||
*/
|
||||
func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *http.Response, error) {
|
||||
func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -304,8 +304,8 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h
|
||||
localVarPath := a.client.cfg.BasePath + "/store/order"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -336,7 +336,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
|
@ -10,17 +10,17 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_context "context"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ context.Context
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type UserApiService service
|
||||
@ -28,12 +28,12 @@ type UserApiService service
|
||||
/*
|
||||
UserApiService Create user
|
||||
This can only be done by the logged in user.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body Created user object
|
||||
*/
|
||||
func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Response, error) {
|
||||
func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -44,8 +44,8 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo
|
||||
localVarPath := a.client.cfg.BasePath + "/user"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -76,7 +76,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -95,12 +95,12 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo
|
||||
|
||||
/*
|
||||
UserApiService Creates list of users with given input array
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body List of user object
|
||||
*/
|
||||
func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []User) (*http.Response, error) {
|
||||
func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -111,8 +111,8 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U
|
||||
localVarPath := a.client.cfg.BasePath + "/user/createWithArray"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -143,7 +143,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -162,12 +162,12 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U
|
||||
|
||||
/*
|
||||
UserApiService Creates list of users with given input array
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body List of user object
|
||||
*/
|
||||
func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []User) (*http.Response, error) {
|
||||
func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPost
|
||||
localVarHttpMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -178,8 +178,8 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us
|
||||
localVarPath := a.client.cfg.BasePath + "/user/createWithList"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -210,7 +210,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -230,12 +230,12 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us
|
||||
/*
|
||||
UserApiService Delete user
|
||||
This can only be done by the logged in user.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) {
|
||||
func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodDelete
|
||||
localVarHttpMethod = _nethttp.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -247,8 +247,8 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -277,7 +277,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -296,13 +296,13 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
|
||||
/*
|
||||
UserApiService Get user by user name
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
@return User
|
||||
*/
|
||||
func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) {
|
||||
func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -315,8 +315,8 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -345,7 +345,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -383,14 +383,14 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
|
||||
/*
|
||||
UserApiService Logs user into the system
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
@return string
|
||||
*/
|
||||
func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) {
|
||||
func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -402,8 +402,8 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
localVarPath := a.client.cfg.BasePath + "/user/login"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
localVarQueryParams.Add("username", parameterToString(username, ""))
|
||||
localVarQueryParams.Add("password", parameterToString(password, ""))
|
||||
@ -434,7 +434,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
@ -472,11 +472,11 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
|
||||
/*
|
||||
UserApiService Logs out current logged in user session
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
*/
|
||||
func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) {
|
||||
func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodGet
|
||||
localVarHttpMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -487,8 +487,8 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
localVarPath := a.client.cfg.BasePath + "/user/logout"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -517,7 +517,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
@ -537,13 +537,13 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
/*
|
||||
UserApiService Updated user
|
||||
This can only be done by the logged in user.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
*/
|
||||
func (a *UserApiService) UpdateUser(ctx context.Context, username string, body User) (*http.Response, error) {
|
||||
func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = http.MethodPut
|
||||
localVarHttpMethod = _nethttp.MethodPut
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@ -555,8 +555,8 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{}
|
||||
@ -587,7 +587,7 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
|
Loading…
x
Reference in New Issue
Block a user