[Go]: Interface definitions for api functions (#5914)

Introduces a new "generateInterfaces" option, allowing for better testability of generated clients
This commit is contained in:
Arvind Thirunarayanan 2020-08-31 20:43:40 -05:00 committed by GitHub
parent 9fd66fbbcb
commit ab5b0fa8d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 3968 additions and 1691 deletions

View File

@ -4,3 +4,4 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e
templateDir: modules/openapi-generator/src/main/resources/go-experimental
additionalProperties:
packageName: petstore
generateInterfaces: true

View File

@ -6,3 +6,4 @@ additionalProperties:
enumClassPrefix: "true"
packageName: petstore
disallowAdditionalPropertiesIfNotPresent: false
generateInterfaces: true

View File

@ -6,3 +6,4 @@ additionalProperties:
packageName: petstore
withXml: "true"
withGoCodegenComment: "true"
generateInterfaces: true

View File

@ -7,6 +7,7 @@ sidebar_label: go-experimental
| ------ | ----------- | ------ | ------- |
|disallowAdditionalPropertiesIfNotPresent|Specify the behavior when the 'additionalProperties' keyword is not present in the OAS document. If false: the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. If true: when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.This setting is currently ignored for OAS 2.0 documents: 1) When the 'additionalProperties' keyword is not present in a 2.0 schema, additional properties are NOT allowed. 2) Boolean values of the 'additionalProperties' keyword are ignored. It's as if additional properties are NOT allowed.Note: the root cause are issues #1369 and #1371, which must be resolved in the swagger-parser project.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.</dd></dl>|true|
|enumClassPrefix|Prefix enum with class name| |false|
|generateInterfaces|Generate interfaces for api classes| |false|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|isGoSubmodule|whether the generated Go module is a submodule| |false|
|packageName|Go package name (convention: lowercase).| |openapi|

View File

@ -6,6 +6,7 @@ sidebar_label: go
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|enumClassPrefix|Prefix enum with class name| |false|
|generateInterfaces|Generate interfaces for api classes| |false|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|isGoSubmodule|whether the generated Go module is a submodule| |false|
|packageName|Go package name (convention: lowercase).| |openapi|

View File

@ -42,6 +42,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
protected boolean withXml = false;
protected boolean enumClassPrefix = false;
protected boolean structPrefix = false;
protected boolean generateInterfaces = false;
protected String packageName = "openapi";
protected Set<String> numberTypes;
@ -780,6 +781,10 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
this.structPrefix = structPrefix;
}
public void setGenerateInterfaces(boolean generateInterfaces) {
this.generateInterfaces = generateInterfaces;
}
@Override
public String toDefaultValue(Schema schema) {
if (schema.getDefault() != null) {

View File

@ -40,6 +40,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
public static final String WITH_XML = "withXml";
public static final String STRUCT_PREFIX = "structPrefix";
public static final String WITH_AWSV4_SIGNATURE = "withAWSV4Signature";
public static final String GENERATE_INTERFACES = "generateInterfaces";
public GoClientCodegen() {
super();
@ -91,6 +92,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
cliOptions.add(CliOption.newBoolean(CodegenConstants.ENUM_CLASS_PREFIX, CodegenConstants.ENUM_CLASS_PREFIX_DESC));
cliOptions.add(CliOption.newBoolean(STRUCT_PREFIX, "whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts"));
cliOptions.add(CliOption.newBoolean(WITH_AWSV4_SIGNATURE, "whether to include AWS v4 signature support"));
cliOptions.add(CliOption.newBoolean(GENERATE_INTERFACES, "Generate interfaces for api classes"));
// option to change the order of form/body parameter
cliOptions.add(CliOption.newBoolean(
@ -164,6 +166,11 @@ public class GoClientCodegen extends AbstractGoCodegen {
setStructPrefix(Boolean.parseBoolean(additionalProperties.get(STRUCT_PREFIX).toString()));
additionalProperties.put(STRUCT_PREFIX, structPrefix);
}
if (additionalProperties.containsKey(GENERATE_INTERFACES)) {
setGenerateInterfaces(Boolean.parseBoolean(additionalProperties.get(GENERATE_INTERFACES).toString()));
additionalProperties.put(GENERATE_INTERFACES, generateInterfaces);
}
}
/**

View File

@ -15,49 +15,77 @@ import (
var (
_ _context.Context
)
{{#generateInterfaces}}
type {{classname}} interface {
{{#operation}}
/*
* {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}}
{{#notes}}
* {{{unescapedNotes}}}
{{/notes}}
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}}
* @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}}
* @return Api{{operationId}}Request
*/
{{{nickname}}}(ctx _context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) Api{{operationId}}Request
/*
* {{nickname}}Execute executes the request{{#returnType}}
* @return {{{.}}}{{/returnType}}
*/
{{nickname}}Execute(r Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error)
{{/operation}}
}
{{/generateInterfaces}}
// {{classname}}Service {{classname}} service
type {{classname}}Service service
{{#operation}}
type api{{operationId}}Request struct {
ctx _context.Context
apiService *{{classname}}Service{{#allParams}}
{{paramName}} {{^isPathParam}}*{{/isPathParam}}{{{dataType}}}{{/allParams}}
}
type Api{{operationId}}Request struct {
ctx _context.Context{{#generateInterfaces}}
ApiService {{classname}}
{{/generateInterfaces}}{{^generateInterfaces}}
ApiService *{{classname}}Service
{{/generateInterfaces}}
{{#allParams}}
{{^isPathParam}}
func (r api{{operationId}}Request) {{vendorExtensions.x-export-param-name}}({{paramName}} {{{dataType}}}) api{{operationId}}Request {
{{paramName}} {{^isPathParam}}*{{/isPathParam}}{{{dataType}}}
{{/allParams}}
}
{{#allParams}}{{^isPathParam}}
func (r Api{{operationId}}Request) {{vendorExtensions.x-export-param-name}}({{paramName}} {{{dataType}}}) Api{{operationId}}Request {
r.{{paramName}} = &{{paramName}}
return r
}{{/isPathParam}}{{/allParams}}
func (r Api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) {
return r.ApiService.{{nickname}}Execute(r)
}
{{/isPathParam}}
{{/allParams}}
/*
{{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}}
* {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}}
{{#notes}}
{{{unescapedNotes}}}
* {{{unescapedNotes}}}
{{/notes}}
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}}
* @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}}
@return api{{operationId}}Request
*/
func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) api{{operationId}}Request {
return api{{operationId}}Request{
apiService: a,
* @return Api{{operationId}}Request
*/
func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) Api{{operationId}}Request {
return Api{{operationId}}Request{
ApiService: a,
ctx: ctx,{{#pathParams}}
{{paramName}}: {{paramName}},{{/pathParams}}
}
}
/*
Execute executes the request
{{#returnType}}
@return {{{.}}}
{{/returnType}}
*/
func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) {
* Execute executes the request{{#returnType}}
* @return {{{.}}}{{/returnType}}
*/
func (a *{{{classname}}}Service) {{nickname}}Execute(r Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.Method{{httpMethod}}
localVarPostBody interface{}
@ -69,7 +97,7 @@ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnT
{{/returnType}}
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}")
if err != nil {
return {{#returnType}}localVarReturnValue, {{/returnType}}nil, GenericOpenAPIError{error: err.Error()}
}
@ -282,12 +310,12 @@ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnT
{{/isKeyInCookie}}
{{/isApiKey}}
{{/authMethods}}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err
}
@ -311,7 +339,7 @@ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnT
if localVarHTTPResponse.StatusCode == {{{code}}} {
{{/wildcard}}
var v {{{dataType}}}
err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr
@ -331,7 +359,7 @@ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnT
}
{{#returnType}}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,

View File

@ -42,7 +42,12 @@ type APIClient struct {
{{#apis}}
{{#operations}}
{{#generateInterfaces}}
{{classname}} {{classname}}
{{/generateInterfaces}}
{{^generateInterfaces}}
{{classname}} *{{classname}}Service
{{/generateInterfaces}}
{{/operations}}
{{/apis}}
{{/apiInfo}}

View File

@ -17,6 +17,40 @@ var (
_ _context.Context
)
{{#generateInterfaces}}
type {{classname}} interface {
{{#operation}}
/*
* {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}}
*
{{#notes}}
* {{notes}}
*
{{/notes}}
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
{{#allParams}}
{{#required}}
* @param {{paramName}}{{#description}} {{{.}}}{{/description}}
{{/required}}
{{/allParams}}
{{#hasOptionalParams}}
* @param optional nil or *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts - Optional Parameters:
{{#allParams}}
{{^required}}
* @param "{{vendorExtensions.x-export-param-name}}" ({{#isPrimitiveType}}{{^isBinary}}optional.{{vendorExtensions.x-optional-data-type}}{{/isBinary}}{{#isBinary}}optional.Interface of {{dataType}}{{/isBinary}}{{/isPrimitiveType}}{{^isPrimitiveType}}optional.Interface of {{dataType}}{{/isPrimitiveType}}) - {{#description}} {{{.}}}{{/description}}
{{/required}}
{{/allParams}}
{{/hasOptionalParams}}
{{#returnType}}
* @return {{{returnType}}}
{{/returnType}}
*/
{{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error)
{{/operation}}
}
{{/generateInterfaces}}
// {{classname}}Service {{classname}} service
type {{classname}}Service service
{{#operation}}
@ -43,9 +77,11 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct {
{{/hasOptionalParams}}
/*
{{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}}
* {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}}
*
{{#notes}}
{{notes}}
* {{notes}}
*
{{/notes}}
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
{{#allParams}}
@ -62,9 +98,9 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct {
{{/allParams}}
{{/hasOptionalParams}}
{{#returnType}}
@return {{{returnType}}}
* @return {{{returnType}}}
{{/returnType}}
*/
*/
func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.Method{{httpMethod}}

View File

@ -47,7 +47,12 @@ type APIClient struct {
{{#apis}}
{{#operations}}
{{#generateInterfaces}}
{{classname}} {{classname}}
{{/generateInterfaces}}
{{^generateInterfaces}}
{{classname}} *{{classname}}Service
{{/generateInterfaces}}
{{/operations}}
{{/apis}}
{{/apiInfo}}

View File

@ -45,10 +45,11 @@ public class GoClientOptionsTest extends AbstractOptionsTest {
verify(clientCodegen).setPackageName(GoClientOptionsProvider.PACKAGE_NAME_VALUE);
verify(clientCodegen).setWithGoCodegenComment(GoClientOptionsProvider.WITH_GO_CODEGEN_COMMENT_VALUE);
verify(clientCodegen).setWithXml(GoClientOptionsProvider.WITH_XML_VALUE);
verify(clientCodegen).setWithXml(GoClientOptionsProvider.ENUM_CLASS_PREFIX_VALUE);
verify(clientCodegen).setEnumClassPrefix(GoClientOptionsProvider.ENUM_CLASS_PREFIX_VALUE);
verify(clientCodegen).setPrependFormOrBodyParameters(GoClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE);
verify(clientCodegen).setIsGoSubmodule(GoClientOptionsProvider.IS_GO_SUBMODULE_VALUE);
verify(clientCodegen).setStructPrefix(GoClientOptionsProvider.STRUCT_PREFIX_VALUE);
verify(clientCodegen).setWithAWSV4Signature(GoClientOptionsProvider.WITH_AWSV4_SIGNATURE);
verify(clientCodegen).setGenerateInterfaces(GoClientOptionsProvider.GENERATE_INTERFACES_VALUE);
}
}

View File

@ -33,6 +33,7 @@ public class GoClientOptionsProvider implements OptionsProvider {
public static final boolean IS_GO_SUBMODULE_VALUE = true;
public static final boolean STRUCT_PREFIX_VALUE = true;
public static final boolean WITH_AWSV4_SIGNATURE = true;
public static final boolean GENERATE_INTERFACES_VALUE = true;
@Override
public String getLanguage() {
@ -52,6 +53,7 @@ public class GoClientOptionsProvider implements OptionsProvider {
.put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, "true")
.put(CodegenConstants.IS_GO_SUBMODULE, "true")
.put(CodegenConstants.WITH_AWSV4_SIGNATURE_COMMENT, "true")
.put("generateInterfaces", "true")
.put("structPrefix", "true")
.build();
}

View File

@ -21,37 +21,59 @@ var (
_ _context.Context
)
type AnotherFakeApi interface {
/*
* Call123TestSpecialTags 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().
* @return ApiCall123TestSpecialTagsRequest
*/
Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest
/*
* Call123TestSpecialTagsExecute executes the request
* @return Client
*/
Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error)
}
// AnotherFakeApiService AnotherFakeApi service
type AnotherFakeApiService service
type apiCall123TestSpecialTagsRequest struct {
type ApiCall123TestSpecialTagsRequest struct {
ctx _context.Context
apiService *AnotherFakeApiService
ApiService AnotherFakeApi
body *Client
}
func (r apiCall123TestSpecialTagsRequest) Body(body Client) apiCall123TestSpecialTagsRequest {
func (r ApiCall123TestSpecialTagsRequest) Body(body Client) ApiCall123TestSpecialTagsRequest {
r.body = &body
return r
}
func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) {
return r.ApiService.Call123TestSpecialTagsExecute(r)
}
/*
Call123TestSpecialTags To test special tags
To test special tags and operation ID starting with number
* Call123TestSpecialTags 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().
@return apiCall123TestSpecialTagsRequest
*/
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) apiCall123TestSpecialTagsRequest {
return apiCall123TestSpecialTagsRequest{
apiService: a,
* @return ApiCall123TestSpecialTagsRequest
*/
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest {
return ApiCall123TestSpecialTagsRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return Client
*/
func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) {
* Execute executes the request
* @return Client
*/
func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
@ -61,7 +83,7 @@ func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response,
localVarReturnValue Client
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -94,12 +116,12 @@ func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response,
}
// body params
localVarPostBody = r.body
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -118,7 +140,7 @@ func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response,
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,

View File

@ -21,37 +21,59 @@ var (
_ _context.Context
)
type FakeClassnameTags123Api interface {
/*
* TestClassname 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().
* @return ApiTestClassnameRequest
*/
TestClassname(ctx _context.Context) ApiTestClassnameRequest
/*
* TestClassnameExecute executes the request
* @return Client
*/
TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error)
}
// FakeClassnameTags123ApiService FakeClassnameTags123Api service
type FakeClassnameTags123ApiService service
type apiTestClassnameRequest struct {
type ApiTestClassnameRequest struct {
ctx _context.Context
apiService *FakeClassnameTags123ApiService
ApiService FakeClassnameTags123Api
body *Client
}
func (r apiTestClassnameRequest) Body(body Client) apiTestClassnameRequest {
func (r ApiTestClassnameRequest) Body(body Client) ApiTestClassnameRequest {
r.body = &body
return r
}
func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
return r.ApiService.TestClassnameExecute(r)
}
/*
TestClassname To test class name in snake case
To test class name in snake case
* TestClassname 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().
@return apiTestClassnameRequest
*/
func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) apiTestClassnameRequest {
return apiTestClassnameRequest{
apiService: a,
* @return ApiTestClassnameRequest
*/
func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) ApiTestClassnameRequest {
return ApiTestClassnameRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return Client
*/
func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
* Execute executes the request
* @return Client
*/
func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
@ -61,7 +83,7 @@ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
localVarReturnValue Client
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -108,12 +130,12 @@ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
}
}
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -132,7 +154,7 @@ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,

View File

@ -23,35 +23,164 @@ var (
_ _context.Context
)
type PetApi interface {
/*
* AddPet 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().
* @return ApiAddPetRequest
*/
AddPet(ctx _context.Context) ApiAddPetRequest
/*
* AddPetExecute executes the request
*/
AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error)
/*
* DeletePet Deletes a pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param petId Pet id to delete
* @return ApiDeletePetRequest
*/
DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest
/*
* DeletePetExecute executes the request
*/
DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error)
/*
* FindPetsByStatus 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().
* @return ApiFindPetsByStatusRequest
*/
FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest
/*
* FindPetsByStatusExecute executes the request
* @return []Pet
*/
FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error)
/*
* FindPetsByTags 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().
* @return ApiFindPetsByTagsRequest
*/
FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest
/*
* FindPetsByTagsExecute executes the request
* @return []Pet
*/
FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error)
/*
* GetPetById 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 petId ID of pet to return
* @return ApiGetPetByIdRequest
*/
GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest
/*
* GetPetByIdExecute executes the request
* @return Pet
*/
GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error)
/*
* UpdatePet Update an existing pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiUpdatePetRequest
*/
UpdatePet(ctx _context.Context) ApiUpdatePetRequest
/*
* UpdatePetExecute executes the request
*/
UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error)
/*
* UpdatePetWithForm 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 petId ID of pet that needs to be updated
* @return ApiUpdatePetWithFormRequest
*/
UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest
/*
* UpdatePetWithFormExecute executes the request
*/
UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error)
/*
* UploadFile uploads an image
* @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
* @return ApiUploadFileRequest
*/
UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest
/*
* UploadFileExecute executes the request
* @return ApiResponse
*/
UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error)
/*
* UploadFileWithRequiredFile uploads an image (required)
* @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
* @return ApiUploadFileWithRequiredFileRequest
*/
UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest
/*
* UploadFileWithRequiredFileExecute executes the request
* @return ApiResponse
*/
UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error)
}
// PetApiService PetApi service
type PetApiService service
type apiAddPetRequest struct {
type ApiAddPetRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
body *Pet
}
func (r apiAddPetRequest) Body(body Pet) apiAddPetRequest {
func (r ApiAddPetRequest) Body(body Pet) ApiAddPetRequest {
r.body = &body
return r
}
func (r ApiAddPetRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.AddPetExecute(r)
}
/*
AddPet Add a new pet to the store
* AddPet 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().
@return apiAddPetRequest
*/
func (a *PetApiService) AddPet(ctx _context.Context) apiAddPetRequest {
return apiAddPetRequest{
apiService: a,
* @return ApiAddPetRequest
*/
func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest {
return ApiAddPetRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -60,7 +189,7 @@ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -93,12 +222,12 @@ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) {
}
// body params
localVarPostBody = r.body
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -119,35 +248,41 @@ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiDeletePetRequest struct {
type ApiDeletePetRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
petId int64
apiKey *string
}
func (r apiDeletePetRequest) ApiKey(apiKey string) apiDeletePetRequest {
func (r ApiDeletePetRequest) ApiKey(apiKey string) ApiDeletePetRequest {
r.apiKey = &apiKey
return r
}
func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.DeletePetExecute(r)
}
/*
DeletePet Deletes a pet
* DeletePet Deletes a pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param petId Pet id to delete
@return apiDeletePetRequest
*/
func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) apiDeletePetRequest {
return apiDeletePetRequest{
apiService: a,
* @return ApiDeletePetRequest
*/
func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest {
return ApiDeletePetRequest{
ApiService: a,
ctx: ctx,
petId: petId,
}
}
/*
Execute executes the request
*/
func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
@ -156,7 +291,7 @@ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -188,12 +323,12 @@ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) {
if r.apiKey != nil {
localVarHeaderParams["api_key"] = parameterToString(*r.apiKey, "")
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -214,34 +349,40 @@ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiFindPetsByStatusRequest struct {
type ApiFindPetsByStatusRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
status *[]string
}
func (r apiFindPetsByStatusRequest) Status(status []string) apiFindPetsByStatusRequest {
func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusRequest {
r.status = &status
return r
}
func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) {
return r.ApiService.FindPetsByStatusExecute(r)
}
/*
FindPetsByStatus Finds Pets by status
Multiple status values can be provided with comma separated strings
* FindPetsByStatus 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().
@return apiFindPetsByStatusRequest
*/
func (a *PetApiService) FindPetsByStatus(ctx _context.Context) apiFindPetsByStatusRequest {
return apiFindPetsByStatusRequest{
apiService: a,
* @return ApiFindPetsByStatusRequest
*/
func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest {
return ApiFindPetsByStatusRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return []Pet
*/
func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) {
* Execute executes the request
* @return []Pet
*/
func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -251,7 +392,7 @@ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error)
localVarReturnValue []Pet
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -283,12 +424,12 @@ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -307,7 +448,7 @@ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error)
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -318,34 +459,40 @@ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error)
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiFindPetsByTagsRequest struct {
type ApiFindPetsByTagsRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
tags *[]string
}
func (r apiFindPetsByTagsRequest) Tags(tags []string) apiFindPetsByTagsRequest {
func (r ApiFindPetsByTagsRequest) Tags(tags []string) ApiFindPetsByTagsRequest {
r.tags = &tags
return r
}
func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
return r.ApiService.FindPetsByTagsExecute(r)
}
/*
FindPetsByTags Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* FindPetsByTags 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().
@return apiFindPetsByTagsRequest
*/
func (a *PetApiService) FindPetsByTags(ctx _context.Context) apiFindPetsByTagsRequest {
return apiFindPetsByTagsRequest{
apiService: a,
* @return ApiFindPetsByTagsRequest
*/
func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest {
return ApiFindPetsByTagsRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return []Pet
*/
func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
* Execute executes the request
* @return []Pet
*/
func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -355,7 +502,7 @@ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
localVarReturnValue []Pet
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -387,12 +534,12 @@ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -411,7 +558,7 @@ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -422,32 +569,38 @@ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiGetPetByIdRequest struct {
type ApiGetPetByIdRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
petId int64
}
func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
return r.ApiService.GetPetByIdExecute(r)
}
/*
GetPetById Find pet by ID
Returns a single pet
* GetPetById 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 petId ID of pet to return
@return apiGetPetByIdRequest
*/
func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) apiGetPetByIdRequest {
return apiGetPetByIdRequest{
apiService: a,
* @return ApiGetPetByIdRequest
*/
func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest {
return ApiGetPetByIdRequest{
ApiService: a,
ctx: ctx,
petId: petId,
}
}
/*
Execute executes the request
@return Pet
*/
func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
* Execute executes the request
* @return Pet
*/
func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -457,7 +610,7 @@ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
localVarReturnValue Pet
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -500,12 +653,12 @@ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
}
}
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -524,7 +677,7 @@ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -535,32 +688,38 @@ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiUpdatePetRequest struct {
type ApiUpdatePetRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
body *Pet
}
func (r apiUpdatePetRequest) Body(body Pet) apiUpdatePetRequest {
func (r ApiUpdatePetRequest) Body(body Pet) ApiUpdatePetRequest {
r.body = &body
return r
}
func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.UpdatePetExecute(r)
}
/*
UpdatePet Update an existing pet
* UpdatePet Update an existing pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return apiUpdatePetRequest
*/
func (a *PetApiService) UpdatePet(ctx _context.Context) apiUpdatePetRequest {
return apiUpdatePetRequest{
apiService: a,
* @return ApiUpdatePetRequest
*/
func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest {
return ApiUpdatePetRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
localVarPostBody interface{}
@ -569,7 +728,7 @@ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -602,12 +761,12 @@ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) {
}
// body params
localVarPostBody = r.body
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -628,40 +787,46 @@ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiUpdatePetWithFormRequest struct {
type ApiUpdatePetWithFormRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
petId int64
name *string
status *string
}
func (r apiUpdatePetWithFormRequest) Name(name string) apiUpdatePetWithFormRequest {
func (r ApiUpdatePetWithFormRequest) Name(name string) ApiUpdatePetWithFormRequest {
r.name = &name
return r
}
func (r apiUpdatePetWithFormRequest) Status(status string) apiUpdatePetWithFormRequest {
func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormRequest {
r.status = &status
return r
}
func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.UpdatePetWithFormExecute(r)
}
/*
UpdatePetWithForm Updates a pet in the store with form data
* UpdatePetWithForm 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 petId ID of pet that needs to be updated
@return apiUpdatePetWithFormRequest
*/
func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) apiUpdatePetWithFormRequest {
return apiUpdatePetWithFormRequest{
apiService: a,
* @return ApiUpdatePetWithFormRequest
*/
func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest {
return ApiUpdatePetWithFormRequest{
ApiService: a,
ctx: ctx,
petId: petId,
}
}
/*
Execute executes the request
*/
func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -670,7 +835,7 @@ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -705,12 +870,12 @@ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) {
if r.status != nil {
localVarFormParams.Add("status", parameterToString(*r.status, ""))
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -731,41 +896,47 @@ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiUploadFileRequest struct {
type ApiUploadFileRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
petId int64
additionalMetadata *string
file **os.File
}
func (r apiUploadFileRequest) AdditionalMetadata(additionalMetadata string) apiUploadFileRequest {
func (r ApiUploadFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileRequest {
r.additionalMetadata = &additionalMetadata
return r
}
func (r apiUploadFileRequest) File(file *os.File) apiUploadFileRequest {
func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest {
r.file = &file
return r
}
func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) {
return r.ApiService.UploadFileExecute(r)
}
/*
UploadFile uploads an image
* UploadFile uploads an image
* @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
@return apiUploadFileRequest
*/
func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) apiUploadFileRequest {
return apiUploadFileRequest{
apiService: a,
* @return ApiUploadFileRequest
*/
func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest {
return ApiUploadFileRequest{
ApiService: a,
ctx: ctx,
petId: petId,
}
}
/*
Execute executes the request
@return ApiResponse
*/
func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) {
* Execute executes the request
* @return ApiResponse
*/
func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -775,7 +946,7 @@ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error)
localVarReturnValue ApiResponse
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -818,12 +989,12 @@ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error)
localVarFileName = localVarFile.Name()
localVarFile.Close()
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -842,7 +1013,7 @@ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error)
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -853,41 +1024,47 @@ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error)
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiUploadFileWithRequiredFileRequest struct {
type ApiUploadFileWithRequiredFileRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
petId int64
requiredFile **os.File
additionalMetadata *string
}
func (r apiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File) apiUploadFileWithRequiredFileRequest {
func (r ApiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File) ApiUploadFileWithRequiredFileRequest {
r.requiredFile = &requiredFile
return r
}
func (r apiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) apiUploadFileWithRequiredFileRequest {
func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileWithRequiredFileRequest {
r.additionalMetadata = &additionalMetadata
return r
}
func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) {
return r.ApiService.UploadFileWithRequiredFileExecute(r)
}
/*
UploadFileWithRequiredFile uploads an image (required)
* UploadFileWithRequiredFile uploads an image (required)
* @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
@return apiUploadFileWithRequiredFileRequest
*/
func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) apiUploadFileWithRequiredFileRequest {
return apiUploadFileWithRequiredFileRequest{
apiService: a,
* @return ApiUploadFileWithRequiredFileRequest
*/
func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest {
return ApiUploadFileWithRequiredFileRequest{
ApiService: a,
ctx: ctx,
petId: petId,
}
}
/*
Execute executes the request
@return ApiResponse
*/
func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) {
* Execute executes the request
* @return ApiResponse
*/
func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -897,7 +1074,7 @@ func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.
localVarReturnValue ApiResponse
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -940,12 +1117,12 @@ func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.
localVarFileName = localVarFile.Name()
localVarFile.Close()
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -964,7 +1141,7 @@ func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,

View File

@ -22,34 +22,98 @@ var (
_ _context.Context
)
type StoreApi interface {
/*
* DeleteOrder 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 orderId ID of the order that needs to be deleted
* @return ApiDeleteOrderRequest
*/
DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest
/*
* DeleteOrderExecute executes the request
*/
DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error)
/*
* GetInventory 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().
* @return ApiGetInventoryRequest
*/
GetInventory(ctx _context.Context) ApiGetInventoryRequest
/*
* GetInventoryExecute executes the request
* @return map[string]int32
*/
GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error)
/*
* GetOrderById 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 orderId ID of pet that needs to be fetched
* @return ApiGetOrderByIdRequest
*/
GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest
/*
* GetOrderByIdExecute executes the request
* @return Order
*/
GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error)
/*
* PlaceOrder Place an order for a pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPlaceOrderRequest
*/
PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest
/*
* PlaceOrderExecute executes the request
* @return Order
*/
PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error)
}
// StoreApiService StoreApi service
type StoreApiService service
type apiDeleteOrderRequest struct {
type ApiDeleteOrderRequest struct {
ctx _context.Context
apiService *StoreApiService
ApiService StoreApi
orderId string
}
func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.DeleteOrderExecute(r)
}
/*
DeleteOrder Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
* DeleteOrder 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 orderId ID of the order that needs to be deleted
@return apiDeleteOrderRequest
*/
func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) apiDeleteOrderRequest {
return apiDeleteOrderRequest{
apiService: a,
* @return ApiDeleteOrderRequest
*/
func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest {
return ApiDeleteOrderRequest{
ApiService: a,
ctx: ctx,
orderId: orderId,
}
}
/*
Execute executes the request
*/
func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
@ -58,7 +122,7 @@ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -87,12 +151,12 @@ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -113,29 +177,35 @@ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiGetInventoryRequest struct {
type ApiGetInventoryRequest struct {
ctx _context.Context
apiService *StoreApiService
ApiService StoreApi
}
func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) {
return r.ApiService.GetInventoryExecute(r)
}
/*
GetInventory Returns pet inventories by status
Returns a map of status codes to quantities
* GetInventory 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().
@return apiGetInventoryRequest
*/
func (a *StoreApiService) GetInventory(ctx _context.Context) apiGetInventoryRequest {
return apiGetInventoryRequest{
apiService: a,
* @return ApiGetInventoryRequest
*/
func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequest {
return ApiGetInventoryRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return map[string]int32
*/
func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) {
* Execute executes the request
* @return map[string]int32
*/
func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -145,7 +215,7 @@ func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response,
localVarReturnValue map[string]int32
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -187,12 +257,12 @@ func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response,
}
}
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -211,7 +281,7 @@ func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response,
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -222,32 +292,38 @@ func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response,
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiGetOrderByIdRequest struct {
type ApiGetOrderByIdRequest struct {
ctx _context.Context
apiService *StoreApiService
ApiService StoreApi
orderId int64
}
func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
return r.ApiService.GetOrderByIdExecute(r)
}
/*
GetOrderById Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
* GetOrderById 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 orderId ID of pet that needs to be fetched
@return apiGetOrderByIdRequest
*/
func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) apiGetOrderByIdRequest {
return apiGetOrderByIdRequest{
apiService: a,
* @return ApiGetOrderByIdRequest
*/
func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest {
return ApiGetOrderByIdRequest{
ApiService: a,
ctx: ctx,
orderId: orderId,
}
}
/*
Execute executes the request
@return Order
*/
func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
* Execute executes the request
* @return Order
*/
func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -257,7 +333,7 @@ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
localVarReturnValue Order
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -292,12 +368,12 @@ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -316,7 +392,7 @@ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -327,33 +403,39 @@ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiPlaceOrderRequest struct {
type ApiPlaceOrderRequest struct {
ctx _context.Context
apiService *StoreApiService
ApiService StoreApi
body *Order
}
func (r apiPlaceOrderRequest) Body(body Order) apiPlaceOrderRequest {
func (r ApiPlaceOrderRequest) Body(body Order) ApiPlaceOrderRequest {
r.body = &body
return r
}
func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) {
return r.ApiService.PlaceOrderExecute(r)
}
/*
PlaceOrder Place an order for a pet
* PlaceOrder Place an order for a pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return apiPlaceOrderRequest
*/
func (a *StoreApiService) PlaceOrder(ctx _context.Context) apiPlaceOrderRequest {
return apiPlaceOrderRequest{
apiService: a,
* @return ApiPlaceOrderRequest
*/
func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest {
return ApiPlaceOrderRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return Order
*/
func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) {
* Execute executes the request
* @return Order
*/
func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -363,7 +445,7 @@ func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) {
localVarReturnValue Order
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -396,12 +478,12 @@ func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) {
}
// body params
localVarPostBody = r.body
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -420,7 +502,7 @@ func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,

View File

@ -22,36 +22,148 @@ var (
_ _context.Context
)
type UserApi interface {
/*
* CreateUser 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().
* @return ApiCreateUserRequest
*/
CreateUser(ctx _context.Context) ApiCreateUserRequest
/*
* CreateUserExecute executes the request
*/
CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error)
/*
* CreateUsersWithArrayInput 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().
* @return ApiCreateUsersWithArrayInputRequest
*/
CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest
/*
* CreateUsersWithArrayInputExecute executes the request
*/
CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error)
/*
* CreateUsersWithListInput 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().
* @return ApiCreateUsersWithListInputRequest
*/
CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest
/*
* CreateUsersWithListInputExecute executes the request
*/
CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error)
/*
* DeleteUser 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 username The name that needs to be deleted
* @return ApiDeleteUserRequest
*/
DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest
/*
* DeleteUserExecute executes the request
*/
DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error)
/*
* GetUserByName Get user by user name
* @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 ApiGetUserByNameRequest
*/
GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest
/*
* GetUserByNameExecute executes the request
* @return User
*/
GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error)
/*
* LoginUser Logs user into the system
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiLoginUserRequest
*/
LoginUser(ctx _context.Context) ApiLoginUserRequest
/*
* LoginUserExecute executes the request
* @return string
*/
LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error)
/*
* LogoutUser 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().
* @return ApiLogoutUserRequest
*/
LogoutUser(ctx _context.Context) ApiLogoutUserRequest
/*
* LogoutUserExecute executes the request
*/
LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error)
/*
* UpdateUser 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 username name that need to be deleted
* @return ApiUpdateUserRequest
*/
UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest
/*
* UpdateUserExecute executes the request
*/
UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error)
}
// UserApiService UserApi service
type UserApiService service
type apiCreateUserRequest struct {
type ApiCreateUserRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
body *User
}
func (r apiCreateUserRequest) Body(body User) apiCreateUserRequest {
func (r ApiCreateUserRequest) Body(body User) ApiCreateUserRequest {
r.body = &body
return r
}
func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.CreateUserExecute(r)
}
/*
CreateUser Create user
This can only be done by the logged in user.
* CreateUser 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().
@return apiCreateUserRequest
*/
func (a *UserApiService) CreateUser(ctx _context.Context) apiCreateUserRequest {
return apiCreateUserRequest{
apiService: a,
* @return ApiCreateUserRequest
*/
func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest {
return ApiCreateUserRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -60,7 +172,7 @@ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -93,12 +205,12 @@ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) {
}
// body params
localVarPostBody = r.body
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -119,32 +231,38 @@ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiCreateUsersWithArrayInputRequest struct {
type ApiCreateUsersWithArrayInputRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
body *[]User
}
func (r apiCreateUsersWithArrayInputRequest) Body(body []User) apiCreateUsersWithArrayInputRequest {
func (r ApiCreateUsersWithArrayInputRequest) Body(body []User) ApiCreateUsersWithArrayInputRequest {
r.body = &body
return r
}
func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.CreateUsersWithArrayInputExecute(r)
}
/*
CreateUsersWithArrayInput Creates list of users with given input array
* CreateUsersWithArrayInput 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().
@return apiCreateUsersWithArrayInputRequest
*/
func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) apiCreateUsersWithArrayInputRequest {
return apiCreateUsersWithArrayInputRequest{
apiService: a,
* @return ApiCreateUsersWithArrayInputRequest
*/
func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest {
return ApiCreateUsersWithArrayInputRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -153,7 +271,7 @@ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, erro
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -186,12 +304,12 @@ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, erro
}
// body params
localVarPostBody = r.body
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -212,32 +330,38 @@ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, erro
return localVarHTTPResponse, nil
}
type apiCreateUsersWithListInputRequest struct {
type ApiCreateUsersWithListInputRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
body *[]User
}
func (r apiCreateUsersWithListInputRequest) Body(body []User) apiCreateUsersWithListInputRequest {
func (r ApiCreateUsersWithListInputRequest) Body(body []User) ApiCreateUsersWithListInputRequest {
r.body = &body
return r
}
func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.CreateUsersWithListInputExecute(r)
}
/*
CreateUsersWithListInput Creates list of users with given input array
* CreateUsersWithListInput 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().
@return apiCreateUsersWithListInputRequest
*/
func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) apiCreateUsersWithListInputRequest {
return apiCreateUsersWithListInputRequest{
apiService: a,
* @return ApiCreateUsersWithListInputRequest
*/
func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest {
return ApiCreateUsersWithListInputRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -246,7 +370,7 @@ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -279,12 +403,12 @@ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error
}
// body params
localVarPostBody = r.body
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -305,31 +429,37 @@ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error
return localVarHTTPResponse, nil
}
type apiDeleteUserRequest struct {
type ApiDeleteUserRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
username string
}
func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.DeleteUserExecute(r)
}
/*
DeleteUser Delete user
This can only be done by the logged in user.
* DeleteUser 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 username The name that needs to be deleted
@return apiDeleteUserRequest
*/
func (a *UserApiService) DeleteUser(ctx _context.Context, username string) apiDeleteUserRequest {
return apiDeleteUserRequest{
apiService: a,
* @return ApiDeleteUserRequest
*/
func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest {
return ApiDeleteUserRequest{
ApiService: a,
ctx: ctx,
username: username,
}
}
/*
Execute executes the request
*/
func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
@ -338,7 +468,7 @@ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -367,12 +497,12 @@ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -393,31 +523,37 @@ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiGetUserByNameRequest struct {
type ApiGetUserByNameRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
username string
}
func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
return r.ApiService.GetUserByNameExecute(r)
}
/*
GetUserByName Get user by user name
* GetUserByName Get user by user name
* @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 apiGetUserByNameRequest
*/
func (a *UserApiService) GetUserByName(ctx _context.Context, username string) apiGetUserByNameRequest {
return apiGetUserByNameRequest{
apiService: a,
* @return ApiGetUserByNameRequest
*/
func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest {
return ApiGetUserByNameRequest{
ApiService: a,
ctx: ctx,
username: username,
}
}
/*
Execute executes the request
@return User
*/
func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
* Execute executes the request
* @return User
*/
func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -427,7 +563,7 @@ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
localVarReturnValue User
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -456,12 +592,12 @@ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -480,7 +616,7 @@ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -491,38 +627,44 @@ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiLoginUserRequest struct {
type ApiLoginUserRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
username *string
password *string
}
func (r apiLoginUserRequest) Username(username string) apiLoginUserRequest {
func (r ApiLoginUserRequest) Username(username string) ApiLoginUserRequest {
r.username = &username
return r
}
func (r apiLoginUserRequest) Password(password string) apiLoginUserRequest {
func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest {
r.password = &password
return r
}
func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
return r.ApiService.LoginUserExecute(r)
}
/*
LoginUser Logs user into the system
* LoginUser Logs user into the system
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return apiLoginUserRequest
*/
func (a *UserApiService) LoginUser(ctx _context.Context) apiLoginUserRequest {
return apiLoginUserRequest{
apiService: a,
* @return ApiLoginUserRequest
*/
func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest {
return ApiLoginUserRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return string
*/
func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
* Execute executes the request
* @return string
*/
func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -532,7 +674,7 @@ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
localVarReturnValue string
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -568,12 +710,12 @@ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -592,7 +734,7 @@ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -603,27 +745,33 @@ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiLogoutUserRequest struct {
type ApiLogoutUserRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
}
func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.LogoutUserExecute(r)
}
/*
LogoutUser Logs out current logged in user session
* LogoutUser 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().
@return apiLogoutUserRequest
*/
func (a *UserApiService) LogoutUser(ctx _context.Context) apiLogoutUserRequest {
return apiLogoutUserRequest{
apiService: a,
* @return ApiLogoutUserRequest
*/
func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest {
return ApiLogoutUserRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -632,7 +780,7 @@ func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -660,12 +808,12 @@ func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -686,36 +834,42 @@ func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiUpdateUserRequest struct {
type ApiUpdateUserRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
username string
body *User
}
func (r apiUpdateUserRequest) Body(body User) apiUpdateUserRequest {
func (r ApiUpdateUserRequest) Body(body User) ApiUpdateUserRequest {
r.body = &body
return r
}
func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.UpdateUserExecute(r)
}
/*
UpdateUser Updated user
This can only be done by the logged in user.
* UpdateUser 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 username name that need to be deleted
@return apiUpdateUserRequest
*/
func (a *UserApiService) UpdateUser(ctx _context.Context, username string) apiUpdateUserRequest {
return apiUpdateUserRequest{
apiService: a,
* @return ApiUpdateUserRequest
*/
func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest {
return ApiUpdateUserRequest{
ApiService: a,
ctx: ctx,
username: username,
}
}
/*
Execute executes the request
*/
func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
localVarPostBody interface{}
@ -724,7 +878,7 @@ func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -758,12 +912,12 @@ func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) {
}
// body params
localVarPostBody = r.body
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}

View File

@ -47,17 +47,17 @@ type APIClient struct {
// API Services
AnotherFakeApi *AnotherFakeApiService
AnotherFakeApi AnotherFakeApi
FakeApi *FakeApiService
FakeApi FakeApi
FakeClassnameTags123Api *FakeClassnameTags123ApiService
FakeClassnameTags123Api FakeClassnameTags123Api
PetApi *PetApiService
PetApi PetApi
StoreApi *StoreApiService
StoreApi StoreApi
UserApi *UserApiService
UserApi UserApi
}
type service struct {

View File

@ -0,0 +1,89 @@
package mock
import (
"context"
"net/http"
sw "../go-petstore"
)
// MockPetApi is a mock of the PetApi interface
type MockPetApi struct {
}
// NewMockPetApi creates a new mock instance
func NewMockPetApi() *MockPetApi {
return &MockPetApi{}
}
func (m *MockPetApi) AddPet(ctx context.Context) sw.ApiAddPetRequest {
return sw.ApiAddPetRequest{ApiService: m}
}
func (m *MockPetApi) AddPetExecute(r sw.ApiAddPetRequest) (*http.Response, error) {
return &http.Response{StatusCode:200}, nil
}
func (m *MockPetApi) DeletePet(ctx context.Context, petId int64) sw.ApiDeletePetRequest {
return sw.ApiDeletePetRequest{ApiService: m}
}
func (m *MockPetApi) DeletePetExecute(r sw.ApiDeletePetRequest) (*http.Response, error) {
return &http.Response{StatusCode:200}, nil
}
func (m *MockPetApi) FindPetsByStatus(ctx context.Context) sw.ApiFindPetsByStatusRequest {
return sw.ApiFindPetsByStatusRequest{ApiService: m}
}
func (m *MockPetApi) FindPetsByStatusExecute(r sw.ApiFindPetsByStatusRequest) ([]sw.Pet, *http.Response, error) {
return []sw.Pet{}, &http.Response{StatusCode:200}, nil
}
func (m *MockPetApi) FindPetsByTags(ctx context.Context) sw.ApiFindPetsByTagsRequest {
return sw.ApiFindPetsByTagsRequest{ApiService: m}
}
func (m *MockPetApi) FindPetsByTagsExecute(r sw.ApiFindPetsByTagsRequest) ([]sw.Pet, *http.Response, error) {
return []sw.Pet{}, &http.Response{StatusCode:200}, nil
}
func (m *MockPetApi) GetPetById(ctx context.Context, petId int64) sw.ApiGetPetByIdRequest {
return sw.ApiGetPetByIdRequest{ApiService: m}
}
func (m *MockPetApi) GetPetByIdExecute(r sw.ApiGetPetByIdRequest) (sw.Pet, *http.Response, error) {
return sw.Pet{}, &http.Response{StatusCode:200}, nil
}
func (m *MockPetApi) UpdatePet(ctx context.Context) sw.ApiUpdatePetRequest {
return sw.ApiUpdatePetRequest{ApiService: m}
}
func (m *MockPetApi) UpdatePetExecute(r sw.ApiUpdatePetRequest) (*http.Response, error) {
return &http.Response{StatusCode:200}, nil
}
func (m *MockPetApi) UpdatePetWithForm(ctx context.Context, petId int64) sw.ApiUpdatePetWithFormRequest {
return sw.ApiUpdatePetWithFormRequest{ApiService: m}
}
func (m *MockPetApi) UpdatePetWithFormExecute(r sw.ApiUpdatePetWithFormRequest) (*http.Response, error) {
return &http.Response{StatusCode:200}, nil
}
func (m *MockPetApi) UploadFile(ctx context.Context, petId int64) sw.ApiUploadFileRequest {
return sw.ApiUploadFileRequest{ApiService: m}
}
func (m *MockPetApi) UploadFileExecute(r sw.ApiUploadFileRequest) (sw.ApiResponse, *http.Response, error) {
return sw.ApiResponse{}, &http.Response{StatusCode:200}, nil
}
func (m *MockPetApi) UploadFileWithRequiredFile(ctx context.Context, petId int64) sw.ApiUploadFileWithRequiredFileRequest {
return sw.ApiUploadFileWithRequiredFileRequest{ApiService: m}
}
func (m *MockPetApi) UploadFileWithRequiredFileExecute(r sw.ApiUploadFileWithRequiredFileRequest) (sw.ApiResponse, *http.Response, error) {
return sw.ApiResponse{}, &http.Response{StatusCode:200}, nil
}

View File

@ -9,6 +9,7 @@ import (
"github.com/stretchr/testify/assert"
sw "./go-petstore"
mock "./mock"
)
var client *sw.APIClient
@ -41,6 +42,15 @@ func TestAddPet(t *testing.T) {
}
}
func TestAddPetMock(t *testing.T) {
actualApi := client.PetApi
mockApi := mock.NewMockPetApi()
client.PetApi = mockApi
TestAddPet(t)
client.PetApi = actualApi
}
func TestFindPetsByStatusWithMissingParam(t *testing.T) {
_, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute()

View File

@ -23,16 +23,32 @@ var (
_ _context.Context
)
type AnotherFakeApi interface {
/*
* Call123TestSpecialTags 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 body client model
* @return Client
*/
Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error)
}
// AnotherFakeApiService AnotherFakeApi service
type AnotherFakeApiService service
/*
Call123TestSpecialTags To test special tags
To test special tags and operation ID starting with number
* Call123TestSpecialTags 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 body client model
@return Client
*/
* @return Client
*/
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch

View File

@ -26,15 +26,197 @@ var (
_ _context.Context
)
type FakeApi interface {
/*
* CreateXmlItem 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 xmlItem XmlItem Body
*/
CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error)
/*
* FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize
*
* 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 optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters:
* @param "Body" (optional.Bool) - Input boolean as post body
* @return bool
*/
FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error)
/*
* FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize
*
* 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 optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters:
* @param "Body" (optional.Interface of OuterComposite) - Input composite as post body
* @return OuterComposite
*/
FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error)
/*
* FakeOuterNumberSerialize Method for FakeOuterNumberSerialize
*
* 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 optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters:
* @param "Body" (optional.Float32) - Input number as post body
* @return float32
*/
FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error)
/*
* FakeOuterStringSerialize Method for FakeOuterStringSerialize
*
* 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 optional nil or *FakeOuterStringSerializeOpts - Optional Parameters:
* @param "Body" (optional.String) - Input string as post body
* @return string
*/
FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error)
/*
* TestBodyWithFileSchema Method for TestBodyWithFileSchema
*
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body
*/
TestBodyWithFileSchema(ctx _context.Context, body FileSchemaTestClass) (*_nethttp.Response, error)
/*
* TestBodyWithQueryParams Method for TestBodyWithQueryParams
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param query
* @param body
*/
TestBodyWithQueryParams(ctx _context.Context, query string, body User) (*_nethttp.Response, error)
/*
* TestClientModel To test \"client\" model
*
* To test \&quot;client\&quot; model
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body client model
* @return Client
*/
TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error)
/*
* TestEndpointParameters 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 number None
* @param double None
* @param patternWithoutDelimiter None
* @param byte_ None
* @param optional nil or *TestEndpointParametersOpts - Optional Parameters:
* @param "Integer" (optional.Int32) - None
* @param "Int32_" (optional.Int32) - None
* @param "Int64_" (optional.Int64) - None
* @param "Float" (optional.Float32) - None
* @param "String_" (optional.String) - None
* @param "Binary" (optional.Interface of *os.File) - None
* @param "Date" (optional.String) - None
* @param "DateTime" (optional.Time) - None
* @param "Password" (optional.String) - None
* @param "Callback" (optional.String) - None
*/
TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error)
/*
* TestEnumParameters 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 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)
* @param "EnumQueryStringArray" (optional.Interface of []string) - Query parameter enum test (string array)
* @param "EnumQueryString" (optional.String) - Query parameter enum test (string)
* @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double)
* @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double)
* @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array)
* @param "EnumFormString" (optional.String) - Form parameter enum test (string)
*/
TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error)
/*
* TestGroupParameters 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 requiredStringGroup Required String in group parameters
* @param requiredBooleanGroup Required Boolean in group parameters
* @param requiredInt64Group Required Integer in group parameters
* @param optional nil or *TestGroupParametersOpts - Optional Parameters:
* @param "StringGroup" (optional.Int32) - String in group parameters
* @param "BooleanGroup" (optional.Bool) - Boolean in group parameters
* @param "Int64Group" (optional.Int64) - Integer in group parameters
*/
TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error)
/*
* TestInlineAdditionalProperties test inline additionalProperties
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param param request body
*/
TestInlineAdditionalProperties(ctx _context.Context, param map[string]string) (*_nethttp.Response, error)
/*
* TestJsonFormData 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 param field1
* @param param2 field2
*/
TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error)
/*
* TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat
*
* To test the collection format in query parameters
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param pipe
* @param ioutil
* @param http
* @param url
* @param context
*/
TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error)
}
// FakeApiService FakeApi service
type FakeApiService service
/*
CreateXmlItem creates an XmlItem
this route creates an XmlItem
* CreateXmlItem 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 xmlItem XmlItem Body
*/
*/
func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -103,13 +285,15 @@ type FakeOuterBooleanSerializeOpts struct {
}
/*
FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize
Test serialization of outer boolean types
* FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize
*
* 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 optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters:
* @param "Body" (optional.Bool) - Input boolean as post body
@return bool
*/
* @return bool
*/
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -191,13 +375,15 @@ type FakeOuterCompositeSerializeOpts struct {
}
/*
FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize
Test serialization of object with outer number type
* FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize
*
* 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 optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters:
* @param "Body" (optional.Interface of OuterComposite) - Input composite as post body
@return OuterComposite
*/
* @return OuterComposite
*/
func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -283,13 +469,15 @@ type FakeOuterNumberSerializeOpts struct {
}
/*
FakeOuterNumberSerialize Method for FakeOuterNumberSerialize
Test serialization of outer number types
* FakeOuterNumberSerialize Method for FakeOuterNumberSerialize
*
* 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 optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters:
* @param "Body" (optional.Float32) - Input number as post body
@return float32
*/
* @return float32
*/
func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -371,13 +559,15 @@ type FakeOuterStringSerializeOpts struct {
}
/*
FakeOuterStringSerialize Method for FakeOuterStringSerialize
Test serialization of outer string types
* FakeOuterStringSerialize Method for FakeOuterStringSerialize
*
* 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 optional nil or *FakeOuterStringSerializeOpts - Optional Parameters:
* @param "Body" (optional.String) - Input string as post body
@return string
*/
* @return string
*/
func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -454,11 +644,13 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar
}
/*
TestBodyWithFileSchema Method for TestBodyWithFileSchema
For this test, the body for this request much reference a schema named &#x60;File&#x60;.
* TestBodyWithFileSchema Method for TestBodyWithFileSchema
*
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*
* @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) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
@ -522,11 +714,12 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileS
}
/*
TestBodyWithQueryParams Method for TestBodyWithQueryParams
* TestBodyWithQueryParams Method for TestBodyWithQueryParams
*
* @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) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
@ -591,12 +784,14 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query str
}
/*
TestClientModel To test \"client\" model
To test \&quot;client\&quot; model
* TestClientModel To test \"client\" model
*
* To test \&quot;client\&quot; model
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body client model
@return Client
*/
* @return Client
*/
func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
@ -684,8 +879,10 @@ type TestEndpointParametersOpts struct {
}
/*
TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* TestEndpointParameters 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 number None
* @param double None
@ -702,7 +899,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ
* @param "DateTime" (optional.Time) - None
* @param "Password" (optional.String) - None
* @param "Callback" (optional.String) - None
*/
*/
func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -834,8 +1031,10 @@ type TestEnumParametersOpts struct {
}
/*
TestEnumParameters To test enum parameters
To test enum parameters
* TestEnumParameters 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 optional nil or *TestEnumParametersOpts - Optional Parameters:
* @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array)
@ -846,7 +1045,7 @@ To test enum parameters
* @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double)
* @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array)
* @param "EnumFormString" (optional.String) - Form parameter enum test (string)
*/
*/
func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -939,8 +1138,10 @@ type TestGroupParametersOpts struct {
}
/*
TestGroupParameters Fake endpoint to test group parameters (optional)
Fake endpoint to test group parameters (optional)
* TestGroupParameters 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 requiredStringGroup Required String in group parameters
* @param requiredBooleanGroup Required Boolean in group parameters
@ -949,7 +1150,7 @@ Fake endpoint to test group parameters (optional)
* @param "StringGroup" (optional.Int32) - String in group parameters
* @param "BooleanGroup" (optional.Bool) - Boolean in group parameters
* @param "Int64Group" (optional.Int64) - Integer in group parameters
*/
*/
func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -1023,10 +1224,11 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStrin
}
/*
TestInlineAdditionalProperties test inline additionalProperties
* TestInlineAdditionalProperties test inline additionalProperties
*
* @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) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -1090,11 +1292,12 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, pa
}
/*
TestJsonFormData test json serialization of form data
* TestJsonFormData 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 param field1
* @param param2 field2
*/
*/
func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -1158,15 +1361,17 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa
}
/*
TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat
To test the collection format in query parameters
* TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat
*
* To test the collection format in query parameters
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param pipe
* @param ioutil
* @param http
* @param url
* @param context
*/
*/
func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut

View File

@ -23,16 +23,32 @@ var (
_ _context.Context
)
type FakeClassnameTags123Api interface {
/*
* TestClassname 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 body client model
* @return Client
*/
TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error)
}
// FakeClassnameTags123ApiService FakeClassnameTags123Api service
type FakeClassnameTags123ApiService service
/*
TestClassname To test class name in snake case
To test class name in snake case
* TestClassname 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 body client model
@return Client
*/
* @return Client
*/
func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch

View File

@ -26,14 +26,112 @@ var (
_ _context.Context
)
type PetApi interface {
/*
* AddPet 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 body Pet object that needs to be added to the store
*/
AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error)
/*
* DeletePet Deletes a pet
*
* @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) -
*/
DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error)
/*
* FindPetsByStatus 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 status Status values that need to be considered for filter
* @return []Pet
*/
FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error)
/*
* FindPetsByTags 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 tags Tags to filter by
* @return []Pet
*/
FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error)
/*
* GetPetById 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 petId ID of pet to return
* @return Pet
*/
GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error)
/*
* UpdatePet Update an existing pet
*
* @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
*/
UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Response, error)
/*
* UpdatePetWithForm 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 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
* @param "Status" (optional.String) - Updated status of the pet
*/
UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error)
/*
* UploadFile uploads an image
*
* @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
* @param "File" (optional.Interface of *os.File) - file to upload
* @return ApiResponse
*/
UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error)
/*
* UploadFileWithRequiredFile uploads an image (required)
*
* @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:
* @param "AdditionalMetadata" (optional.String) - Additional data to pass to server
* @return ApiResponse
*/
UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error)
}
// PetApiService PetApi service
type PetApiService service
/*
AddPet Add a new pet to the store
* AddPet 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 body Pet object that needs to be added to the store
*/
*/
func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -102,12 +200,13 @@ type DeletePetOpts struct {
}
/*
DeletePet Deletes a pet
* DeletePet Deletes a pet
*
* @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) -
*/
*/
func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -174,12 +273,14 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOpt
}
/*
FindPetsByStatus Finds Pets by status
Multiple status values can be provided with comma separated strings
* FindPetsByStatus 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 status Status values that need to be considered for filter
@return []Pet
*/
* @return []Pet
*/
func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -252,12 +353,14 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string)
}
/*
FindPetsByTags Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* FindPetsByTags 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 tags Tags to filter by
@return []Pet
*/
* @return []Pet
*/
func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -330,12 +433,14 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P
}
/*
GetPetById Find pet by ID
Returns a single pet
* GetPetById 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 petId ID of pet to return
@return Pet
*/
* @return Pet
*/
func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -421,10 +526,11 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne
}
/*
UpdatePet Update an existing pet
* UpdatePet Update an existing pet
*
* @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) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
@ -494,13 +600,14 @@ type UpdatePetWithFormOpts struct {
}
/*
UpdatePetWithForm Updates a pet in the store with form data
* UpdatePetWithForm 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 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
* @param "Status" (optional.String) - Updated status of the pet
*/
*/
func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -576,14 +683,15 @@ type UploadFileOpts struct {
}
/*
UploadFile uploads an image
* UploadFile uploads an image
*
* @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
* @param "File" (optional.Interface of *os.File) - file to upload
@return ApiResponse
*/
* @return ApiResponse
*/
func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -680,14 +788,15 @@ type UploadFileWithRequiredFileOpts struct {
}
/*
UploadFileWithRequiredFile uploads an image (required)
* UploadFileWithRequiredFile uploads an image (required)
*
* @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:
* @param "AdditionalMetadata" (optional.String) - Additional data to pass to server
@return ApiResponse
*/
* @return ApiResponse
*/
func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost

View File

@ -24,15 +24,60 @@ var (
_ _context.Context
)
type StoreApi interface {
/*
* DeleteOrder Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 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 orderId ID of the order that needs to be deleted
*/
DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error)
/*
* GetInventory 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().
* @return map[string]int32
*/
GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error)
/*
* GetOrderById Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 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 orderId ID of pet that needs to be fetched
* @return Order
*/
GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error)
/*
* PlaceOrder 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 body order placed for purchasing the pet
* @return Order
*/
PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error)
}
// StoreApiService StoreApi service
type StoreApiService service
/*
DeleteOrder Delete purchase order by ID
For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* DeleteOrder Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 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 orderId ID of the order that needs to be deleted
*/
*/
func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -96,11 +141,13 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_n
}
/*
GetInventory Returns pet inventories by status
Returns a map of status codes to quantities
* GetInventory 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().
@return map[string]int32
*/
* @return map[string]int32
*/
func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -184,12 +231,14 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32,
}
/*
GetOrderById Find purchase order by ID
For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* GetOrderById Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 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 orderId ID of pet that needs to be fetched
@return Order
*/
* @return Order
*/
func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -269,11 +318,12 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord
}
/*
PlaceOrder Place an order for a pet
* PlaceOrder 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 body order placed for purchasing the pet
@return Order
*/
* @return Order
*/
func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost

View File

@ -24,15 +24,93 @@ var (
_ _context.Context
)
type UserApi interface {
/*
* CreateUser 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 body Created user object
*/
CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error)
/*
* CreateUsersWithArrayInput 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 body List of user object
*/
CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error)
/*
* CreateUsersWithListInput 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 body List of user object
*/
CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error)
/*
* DeleteUser 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 username The name that needs to be deleted
*/
DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error)
/*
* GetUserByName Get user by user name
*
* @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
*/
GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error)
/*
* LoginUser Logs user into the system
*
* @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
*/
LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error)
/*
* LogoutUser 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().
*/
LogoutUser(ctx _context.Context) (*_nethttp.Response, error)
/*
* UpdateUser 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 username name that need to be deleted
* @param body Updated user object
*/
UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error)
}
// UserApiService UserApi service
type UserApiService service
/*
CreateUser Create user
This can only be done by the logged in user.
* CreateUser 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 body Created user object
*/
*/
func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -96,10 +174,11 @@ func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.
}
/*
CreateUsersWithArrayInput Creates list of users with given input array
* CreateUsersWithArrayInput 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 body List of user object
*/
*/
func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -163,10 +242,11 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []
}
/*
CreateUsersWithListInput Creates list of users with given input array
* CreateUsersWithListInput 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 body List of user object
*/
*/
func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -230,11 +310,13 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []U
}
/*
DeleteUser Delete user
This can only be done by the logged in user.
* DeleteUser 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 username The name that needs to be deleted
*/
*/
func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -298,11 +380,12 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_ne
}
/*
GetUserByName Get user by user name
* GetUserByName Get user by user name
*
* @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
*/
* @return User
*/
func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -376,12 +459,13 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U
}
/*
LoginUser Logs user into the system
* LoginUser Logs user into the system
*
* @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
*/
* @return string
*/
func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -455,9 +539,10 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo
}
/*
LogoutUser Logs out current logged in user session
* LogoutUser 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().
*/
*/
func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -519,12 +604,14 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, e
}
/*
UpdateUser Updated user
This can only be done by the logged in user.
* UpdateUser 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 username name that need to be deleted
* @param body Updated user object
*/
*/
func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut

View File

@ -49,17 +49,17 @@ type APIClient struct {
// API Services
AnotherFakeApi *AnotherFakeApiService
AnotherFakeApi AnotherFakeApi
FakeApi *FakeApiService
FakeApi FakeApi
FakeClassnameTags123Api *FakeClassnameTags123ApiService
FakeClassnameTags123Api FakeClassnameTags123Api
PetApi *PetApiService
PetApi PetApi
StoreApi *StoreApiService
StoreApi StoreApi
UserApi *UserApiService
UserApi UserApi
}
type service struct {

View File

@ -26,12 +26,14 @@ var (
type AnotherFakeApiService service
/*
Call123TestSpecialTags To test special tags
To test special tags and operation ID starting with number
* Call123TestSpecialTags 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 body client model
@return Client
*/
* @return Client
*/
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch

View File

@ -29,11 +29,13 @@ var (
type FakeApiService service
/*
CreateXmlItem creates an XmlItem
this route creates an XmlItem
* CreateXmlItem 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 xmlItem XmlItem Body
*/
*/
func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -102,13 +104,15 @@ type FakeOuterBooleanSerializeOpts struct {
}
/*
FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize
Test serialization of outer boolean types
* FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize
*
* 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 optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters:
* @param "Body" (optional.Bool) - Input boolean as post body
@return bool
*/
* @return bool
*/
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -190,13 +194,15 @@ type FakeOuterCompositeSerializeOpts struct {
}
/*
FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize
Test serialization of object with outer number type
* FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize
*
* 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 optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters:
* @param "Body" (optional.Interface of OuterComposite) - Input composite as post body
@return OuterComposite
*/
* @return OuterComposite
*/
func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -282,13 +288,15 @@ type FakeOuterNumberSerializeOpts struct {
}
/*
FakeOuterNumberSerialize Method for FakeOuterNumberSerialize
Test serialization of outer number types
* FakeOuterNumberSerialize Method for FakeOuterNumberSerialize
*
* 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 optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters:
* @param "Body" (optional.Float32) - Input number as post body
@return float32
*/
* @return float32
*/
func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -370,13 +378,15 @@ type FakeOuterStringSerializeOpts struct {
}
/*
FakeOuterStringSerialize Method for FakeOuterStringSerialize
Test serialization of outer string types
* FakeOuterStringSerialize Method for FakeOuterStringSerialize
*
* 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 optional nil or *FakeOuterStringSerializeOpts - Optional Parameters:
* @param "Body" (optional.String) - Input string as post body
@return string
*/
* @return string
*/
func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -453,11 +463,13 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar
}
/*
TestBodyWithFileSchema Method for TestBodyWithFileSchema
For this test, the body for this request much reference a schema named &#x60;File&#x60;.
* TestBodyWithFileSchema Method for TestBodyWithFileSchema
*
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*
* @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) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
@ -521,11 +533,12 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileS
}
/*
TestBodyWithQueryParams Method for TestBodyWithQueryParams
* TestBodyWithQueryParams Method for TestBodyWithQueryParams
*
* @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) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
@ -590,12 +603,14 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query str
}
/*
TestClientModel To test \"client\" model
To test \&quot;client\&quot; model
* TestClientModel To test \"client\" model
*
* To test \&quot;client\&quot; model
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body client model
@return Client
*/
* @return Client
*/
func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
@ -683,8 +698,10 @@ type TestEndpointParametersOpts struct {
}
/*
TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* TestEndpointParameters 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 number None
* @param double None
@ -701,7 +718,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ
* @param "DateTime" (optional.Time) - None
* @param "Password" (optional.String) - None
* @param "Callback" (optional.String) - None
*/
*/
func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -833,8 +850,10 @@ type TestEnumParametersOpts struct {
}
/*
TestEnumParameters To test enum parameters
To test enum parameters
* TestEnumParameters 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 optional nil or *TestEnumParametersOpts - Optional Parameters:
* @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array)
@ -845,7 +864,7 @@ To test enum parameters
* @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double)
* @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array)
* @param "EnumFormString" (optional.String) - Form parameter enum test (string)
*/
*/
func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -938,8 +957,10 @@ type TestGroupParametersOpts struct {
}
/*
TestGroupParameters Fake endpoint to test group parameters (optional)
Fake endpoint to test group parameters (optional)
* TestGroupParameters 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 requiredStringGroup Required String in group parameters
* @param requiredBooleanGroup Required Boolean in group parameters
@ -948,7 +969,7 @@ Fake endpoint to test group parameters (optional)
* @param "StringGroup" (optional.Int32) - String in group parameters
* @param "BooleanGroup" (optional.Bool) - Boolean in group parameters
* @param "Int64Group" (optional.Int64) - Integer in group parameters
*/
*/
func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -1022,10 +1043,11 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStrin
}
/*
TestInlineAdditionalProperties test inline additionalProperties
* TestInlineAdditionalProperties test inline additionalProperties
*
* @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) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -1089,11 +1111,12 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, pa
}
/*
TestJsonFormData test json serialization of form data
* TestJsonFormData 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 param field1
* @param param2 field2
*/
*/
func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -1157,15 +1180,17 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa
}
/*
TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat
To test the collection format in query parameters
* TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat
*
* To test the collection format in query parameters
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param pipe
* @param ioutil
* @param http
* @param url
* @param context
*/
*/
func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut

View File

@ -26,12 +26,14 @@ var (
type FakeClassnameTags123ApiService service
/*
TestClassname To test class name in snake case
To test class name in snake case
* TestClassname 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 body client model
@return Client
*/
* @return Client
*/
func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch

View File

@ -29,10 +29,11 @@ var (
type PetApiService service
/*
AddPet Add a new pet to the store
* AddPet 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 body Pet object that needs to be added to the store
*/
*/
func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -101,12 +102,13 @@ type DeletePetOpts struct {
}
/*
DeletePet Deletes a pet
* DeletePet Deletes a pet
*
* @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) -
*/
*/
func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -173,12 +175,14 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOpt
}
/*
FindPetsByStatus Finds Pets by status
Multiple status values can be provided with comma separated strings
* FindPetsByStatus 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 status Status values that need to be considered for filter
@return []Pet
*/
* @return []Pet
*/
func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -251,12 +255,14 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string)
}
/*
FindPetsByTags Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* FindPetsByTags 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 tags Tags to filter by
@return []Pet
*/
* @return []Pet
*/
func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -329,12 +335,14 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P
}
/*
GetPetById Find pet by ID
Returns a single pet
* GetPetById 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 petId ID of pet to return
@return Pet
*/
* @return Pet
*/
func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -420,10 +428,11 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne
}
/*
UpdatePet Update an existing pet
* UpdatePet Update an existing pet
*
* @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) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
@ -493,13 +502,14 @@ type UpdatePetWithFormOpts struct {
}
/*
UpdatePetWithForm Updates a pet in the store with form data
* UpdatePetWithForm 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 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
* @param "Status" (optional.String) - Updated status of the pet
*/
*/
func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -575,14 +585,15 @@ type UploadFileOpts struct {
}
/*
UploadFile uploads an image
* UploadFile uploads an image
*
* @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
* @param "File" (optional.Interface of *os.File) - file to upload
@return ApiResponse
*/
* @return ApiResponse
*/
func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -679,14 +690,15 @@ type UploadFileWithRequiredFileOpts struct {
}
/*
UploadFileWithRequiredFile uploads an image (required)
* UploadFileWithRequiredFile uploads an image (required)
*
* @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:
* @param "AdditionalMetadata" (optional.String) - Additional data to pass to server
@return ApiResponse
*/
* @return ApiResponse
*/
func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost

View File

@ -27,11 +27,13 @@ var (
type StoreApiService service
/*
DeleteOrder Delete purchase order by ID
For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* DeleteOrder Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 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 orderId ID of the order that needs to be deleted
*/
*/
func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -95,11 +97,13 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_n
}
/*
GetInventory Returns pet inventories by status
Returns a map of status codes to quantities
* GetInventory 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().
@return map[string]int32
*/
* @return map[string]int32
*/
func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -183,12 +187,14 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32,
}
/*
GetOrderById Find purchase order by ID
For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* GetOrderById Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 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 orderId ID of pet that needs to be fetched
@return Order
*/
* @return Order
*/
func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -268,11 +274,12 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord
}
/*
PlaceOrder Place an order for a pet
* PlaceOrder 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 body order placed for purchasing the pet
@return Order
*/
* @return Order
*/
func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost

View File

@ -27,11 +27,13 @@ var (
type UserApiService service
/*
CreateUser Create user
This can only be done by the logged in user.
* CreateUser 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 body Created user object
*/
*/
func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -95,10 +97,11 @@ func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.
}
/*
CreateUsersWithArrayInput Creates list of users with given input array
* CreateUsersWithArrayInput 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 body List of user object
*/
*/
func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -162,10 +165,11 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []
}
/*
CreateUsersWithListInput Creates list of users with given input array
* CreateUsersWithListInput 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 body List of user object
*/
*/
func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -229,11 +233,13 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []U
}
/*
DeleteUser Delete user
This can only be done by the logged in user.
* DeleteUser 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 username The name that needs to be deleted
*/
*/
func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -297,11 +303,12 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_ne
}
/*
GetUserByName Get user by user name
* GetUserByName Get user by user name
*
* @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
*/
* @return User
*/
func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -375,12 +382,13 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U
}
/*
LoginUser Logs user into the system
* LoginUser Logs user into the system
*
* @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
*/
* @return string
*/
func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -454,9 +462,10 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo
}
/*
LogoutUser Logs out current logged in user session
* LogoutUser 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().
*/
*/
func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -518,12 +527,14 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, e
}
/*
UpdateUser Updated user
This can only be done by the logged in user.
* UpdateUser 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 username name that need to be deleted
* @param body Updated user object
*/
*/
func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut

View File

@ -21,37 +21,59 @@ var (
_ _context.Context
)
type AnotherFakeApi interface {
/*
* Call123TestSpecialTags 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().
* @return ApiCall123TestSpecialTagsRequest
*/
Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest
/*
* Call123TestSpecialTagsExecute executes the request
* @return Client
*/
Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error)
}
// AnotherFakeApiService AnotherFakeApi service
type AnotherFakeApiService service
type apiCall123TestSpecialTagsRequest struct {
type ApiCall123TestSpecialTagsRequest struct {
ctx _context.Context
apiService *AnotherFakeApiService
ApiService AnotherFakeApi
client *Client
}
func (r apiCall123TestSpecialTagsRequest) Client(client Client) apiCall123TestSpecialTagsRequest {
func (r ApiCall123TestSpecialTagsRequest) Client(client Client) ApiCall123TestSpecialTagsRequest {
r.client = &client
return r
}
func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) {
return r.ApiService.Call123TestSpecialTagsExecute(r)
}
/*
Call123TestSpecialTags To test special tags
To test special tags and operation ID starting with number
* Call123TestSpecialTags 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().
@return apiCall123TestSpecialTagsRequest
*/
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) apiCall123TestSpecialTagsRequest {
return apiCall123TestSpecialTagsRequest{
apiService: a,
* @return ApiCall123TestSpecialTagsRequest
*/
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest {
return ApiCall123TestSpecialTagsRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return Client
*/
func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) {
* Execute executes the request
* @return Client
*/
func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
@ -61,7 +83,7 @@ func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response,
localVarReturnValue Client
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -94,12 +116,12 @@ func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response,
}
// body params
localVarPostBody = r.client
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -118,7 +140,7 @@ func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response,
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,

View File

@ -21,31 +21,52 @@ var (
_ _context.Context
)
type DefaultApi interface {
/*
* FooGet Method for FooGet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiFooGetRequest
*/
FooGet(ctx _context.Context) ApiFooGetRequest
/*
* FooGetExecute executes the request
* @return InlineResponseDefault
*/
FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, error)
}
// DefaultApiService DefaultApi service
type DefaultApiService service
type apiFooGetRequest struct {
type ApiFooGetRequest struct {
ctx _context.Context
apiService *DefaultApiService
ApiService DefaultApi
}
func (r ApiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response, error) {
return r.ApiService.FooGetExecute(r)
}
/*
FooGet Method for FooGet
* FooGet Method for FooGet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return apiFooGetRequest
*/
func (a *DefaultApiService) FooGet(ctx _context.Context) apiFooGetRequest {
return apiFooGetRequest{
apiService: a,
* @return ApiFooGetRequest
*/
func (a *DefaultApiService) FooGet(ctx _context.Context) ApiFooGetRequest {
return ApiFooGetRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return InlineResponseDefault
*/
func (r apiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response, error) {
* Execute executes the request
* @return InlineResponseDefault
*/
func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -55,7 +76,7 @@ func (r apiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response,
localVarReturnValue InlineResponseDefault
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FooGet")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FooGet")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -83,12 +104,12 @@ func (r apiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response,
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -105,7 +126,7 @@ func (r apiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response,
error: localVarHTTPResponse.Status,
}
var v InlineResponseDefault
err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
@ -114,7 +135,7 @@ func (r apiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response,
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,

View File

@ -21,37 +21,59 @@ var (
_ _context.Context
)
type FakeClassnameTags123Api interface {
/*
* TestClassname 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().
* @return ApiTestClassnameRequest
*/
TestClassname(ctx _context.Context) ApiTestClassnameRequest
/*
* TestClassnameExecute executes the request
* @return Client
*/
TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error)
}
// FakeClassnameTags123ApiService FakeClassnameTags123Api service
type FakeClassnameTags123ApiService service
type apiTestClassnameRequest struct {
type ApiTestClassnameRequest struct {
ctx _context.Context
apiService *FakeClassnameTags123ApiService
ApiService FakeClassnameTags123Api
client *Client
}
func (r apiTestClassnameRequest) Client(client Client) apiTestClassnameRequest {
func (r ApiTestClassnameRequest) Client(client Client) ApiTestClassnameRequest {
r.client = &client
return r
}
func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
return r.ApiService.TestClassnameExecute(r)
}
/*
TestClassname To test class name in snake case
To test class name in snake case
* TestClassname 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().
@return apiTestClassnameRequest
*/
func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) apiTestClassnameRequest {
return apiTestClassnameRequest{
apiService: a,
* @return ApiTestClassnameRequest
*/
func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) ApiTestClassnameRequest {
return ApiTestClassnameRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return Client
*/
func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
* Execute executes the request
* @return Client
*/
func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
@ -61,7 +83,7 @@ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
localVarReturnValue Client
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -108,12 +130,12 @@ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
}
}
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -132,7 +154,7 @@ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,

View File

@ -23,35 +23,164 @@ var (
_ _context.Context
)
type PetApi interface {
/*
* AddPet 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().
* @return ApiAddPetRequest
*/
AddPet(ctx _context.Context) ApiAddPetRequest
/*
* AddPetExecute executes the request
*/
AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error)
/*
* DeletePet Deletes a pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param petId Pet id to delete
* @return ApiDeletePetRequest
*/
DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest
/*
* DeletePetExecute executes the request
*/
DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error)
/*
* FindPetsByStatus 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().
* @return ApiFindPetsByStatusRequest
*/
FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest
/*
* FindPetsByStatusExecute executes the request
* @return []Pet
*/
FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error)
/*
* FindPetsByTags 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().
* @return ApiFindPetsByTagsRequest
*/
FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest
/*
* FindPetsByTagsExecute executes the request
* @return []Pet
*/
FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error)
/*
* GetPetById 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 petId ID of pet to return
* @return ApiGetPetByIdRequest
*/
GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest
/*
* GetPetByIdExecute executes the request
* @return Pet
*/
GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error)
/*
* UpdatePet Update an existing pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiUpdatePetRequest
*/
UpdatePet(ctx _context.Context) ApiUpdatePetRequest
/*
* UpdatePetExecute executes the request
*/
UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error)
/*
* UpdatePetWithForm 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 petId ID of pet that needs to be updated
* @return ApiUpdatePetWithFormRequest
*/
UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest
/*
* UpdatePetWithFormExecute executes the request
*/
UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error)
/*
* UploadFile uploads an image
* @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
* @return ApiUploadFileRequest
*/
UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest
/*
* UploadFileExecute executes the request
* @return ApiResponse
*/
UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error)
/*
* UploadFileWithRequiredFile uploads an image (required)
* @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
* @return ApiUploadFileWithRequiredFileRequest
*/
UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest
/*
* UploadFileWithRequiredFileExecute executes the request
* @return ApiResponse
*/
UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error)
}
// PetApiService PetApi service
type PetApiService service
type apiAddPetRequest struct {
type ApiAddPetRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
pet *Pet
}
func (r apiAddPetRequest) Pet(pet Pet) apiAddPetRequest {
func (r ApiAddPetRequest) Pet(pet Pet) ApiAddPetRequest {
r.pet = &pet
return r
}
func (r ApiAddPetRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.AddPetExecute(r)
}
/*
AddPet Add a new pet to the store
* AddPet 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().
@return apiAddPetRequest
*/
func (a *PetApiService) AddPet(ctx _context.Context) apiAddPetRequest {
return apiAddPetRequest{
apiService: a,
* @return ApiAddPetRequest
*/
func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest {
return ApiAddPetRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -60,7 +189,7 @@ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -93,12 +222,12 @@ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) {
}
// body params
localVarPostBody = r.pet
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -119,35 +248,41 @@ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiDeletePetRequest struct {
type ApiDeletePetRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
petId int64
apiKey *string
}
func (r apiDeletePetRequest) ApiKey(apiKey string) apiDeletePetRequest {
func (r ApiDeletePetRequest) ApiKey(apiKey string) ApiDeletePetRequest {
r.apiKey = &apiKey
return r
}
func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.DeletePetExecute(r)
}
/*
DeletePet Deletes a pet
* DeletePet Deletes a pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param petId Pet id to delete
@return apiDeletePetRequest
*/
func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) apiDeletePetRequest {
return apiDeletePetRequest{
apiService: a,
* @return ApiDeletePetRequest
*/
func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest {
return ApiDeletePetRequest{
ApiService: a,
ctx: ctx,
petId: petId,
}
}
/*
Execute executes the request
*/
func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
@ -156,7 +291,7 @@ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -188,12 +323,12 @@ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) {
if r.apiKey != nil {
localVarHeaderParams["api_key"] = parameterToString(*r.apiKey, "")
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -214,34 +349,40 @@ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiFindPetsByStatusRequest struct {
type ApiFindPetsByStatusRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
status *[]string
}
func (r apiFindPetsByStatusRequest) Status(status []string) apiFindPetsByStatusRequest {
func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusRequest {
r.status = &status
return r
}
func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) {
return r.ApiService.FindPetsByStatusExecute(r)
}
/*
FindPetsByStatus Finds Pets by status
Multiple status values can be provided with comma separated strings
* FindPetsByStatus 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().
@return apiFindPetsByStatusRequest
*/
func (a *PetApiService) FindPetsByStatus(ctx _context.Context) apiFindPetsByStatusRequest {
return apiFindPetsByStatusRequest{
apiService: a,
* @return ApiFindPetsByStatusRequest
*/
func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest {
return ApiFindPetsByStatusRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return []Pet
*/
func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) {
* Execute executes the request
* @return []Pet
*/
func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -251,7 +392,7 @@ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error)
localVarReturnValue []Pet
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -283,12 +424,12 @@ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -307,7 +448,7 @@ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error)
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -318,34 +459,40 @@ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error)
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiFindPetsByTagsRequest struct {
type ApiFindPetsByTagsRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
tags *[]string
}
func (r apiFindPetsByTagsRequest) Tags(tags []string) apiFindPetsByTagsRequest {
func (r ApiFindPetsByTagsRequest) Tags(tags []string) ApiFindPetsByTagsRequest {
r.tags = &tags
return r
}
func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
return r.ApiService.FindPetsByTagsExecute(r)
}
/*
FindPetsByTags Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* FindPetsByTags 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().
@return apiFindPetsByTagsRequest
*/
func (a *PetApiService) FindPetsByTags(ctx _context.Context) apiFindPetsByTagsRequest {
return apiFindPetsByTagsRequest{
apiService: a,
* @return ApiFindPetsByTagsRequest
*/
func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest {
return ApiFindPetsByTagsRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return []Pet
*/
func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
* Execute executes the request
* @return []Pet
*/
func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -355,7 +502,7 @@ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
localVarReturnValue []Pet
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -387,12 +534,12 @@ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -411,7 +558,7 @@ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -422,32 +569,38 @@ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiGetPetByIdRequest struct {
type ApiGetPetByIdRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
petId int64
}
func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
return r.ApiService.GetPetByIdExecute(r)
}
/*
GetPetById Find pet by ID
Returns a single pet
* GetPetById 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 petId ID of pet to return
@return apiGetPetByIdRequest
*/
func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) apiGetPetByIdRequest {
return apiGetPetByIdRequest{
apiService: a,
* @return ApiGetPetByIdRequest
*/
func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest {
return ApiGetPetByIdRequest{
ApiService: a,
ctx: ctx,
petId: petId,
}
}
/*
Execute executes the request
@return Pet
*/
func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
* Execute executes the request
* @return Pet
*/
func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -457,7 +610,7 @@ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
localVarReturnValue Pet
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -500,12 +653,12 @@ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
}
}
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -524,7 +677,7 @@ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -535,32 +688,38 @@ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiUpdatePetRequest struct {
type ApiUpdatePetRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
pet *Pet
}
func (r apiUpdatePetRequest) Pet(pet Pet) apiUpdatePetRequest {
func (r ApiUpdatePetRequest) Pet(pet Pet) ApiUpdatePetRequest {
r.pet = &pet
return r
}
func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.UpdatePetExecute(r)
}
/*
UpdatePet Update an existing pet
* UpdatePet Update an existing pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return apiUpdatePetRequest
*/
func (a *PetApiService) UpdatePet(ctx _context.Context) apiUpdatePetRequest {
return apiUpdatePetRequest{
apiService: a,
* @return ApiUpdatePetRequest
*/
func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest {
return ApiUpdatePetRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
localVarPostBody interface{}
@ -569,7 +728,7 @@ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -602,12 +761,12 @@ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) {
}
// body params
localVarPostBody = r.pet
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -628,40 +787,46 @@ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiUpdatePetWithFormRequest struct {
type ApiUpdatePetWithFormRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
petId int64
name *string
status *string
}
func (r apiUpdatePetWithFormRequest) Name(name string) apiUpdatePetWithFormRequest {
func (r ApiUpdatePetWithFormRequest) Name(name string) ApiUpdatePetWithFormRequest {
r.name = &name
return r
}
func (r apiUpdatePetWithFormRequest) Status(status string) apiUpdatePetWithFormRequest {
func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormRequest {
r.status = &status
return r
}
func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.UpdatePetWithFormExecute(r)
}
/*
UpdatePetWithForm Updates a pet in the store with form data
* UpdatePetWithForm 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 petId ID of pet that needs to be updated
@return apiUpdatePetWithFormRequest
*/
func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) apiUpdatePetWithFormRequest {
return apiUpdatePetWithFormRequest{
apiService: a,
* @return ApiUpdatePetWithFormRequest
*/
func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest {
return ApiUpdatePetWithFormRequest{
ApiService: a,
ctx: ctx,
petId: petId,
}
}
/*
Execute executes the request
*/
func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -670,7 +835,7 @@ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -705,12 +870,12 @@ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) {
if r.status != nil {
localVarFormParams.Add("status", parameterToString(*r.status, ""))
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -731,41 +896,47 @@ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiUploadFileRequest struct {
type ApiUploadFileRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
petId int64
additionalMetadata *string
file **os.File
}
func (r apiUploadFileRequest) AdditionalMetadata(additionalMetadata string) apiUploadFileRequest {
func (r ApiUploadFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileRequest {
r.additionalMetadata = &additionalMetadata
return r
}
func (r apiUploadFileRequest) File(file *os.File) apiUploadFileRequest {
func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest {
r.file = &file
return r
}
func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) {
return r.ApiService.UploadFileExecute(r)
}
/*
UploadFile uploads an image
* UploadFile uploads an image
* @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
@return apiUploadFileRequest
*/
func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) apiUploadFileRequest {
return apiUploadFileRequest{
apiService: a,
* @return ApiUploadFileRequest
*/
func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest {
return ApiUploadFileRequest{
ApiService: a,
ctx: ctx,
petId: petId,
}
}
/*
Execute executes the request
@return ApiResponse
*/
func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) {
* Execute executes the request
* @return ApiResponse
*/
func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -775,7 +946,7 @@ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error)
localVarReturnValue ApiResponse
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -818,12 +989,12 @@ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error)
localVarFileName = localVarFile.Name()
localVarFile.Close()
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -842,7 +1013,7 @@ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error)
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -853,41 +1024,47 @@ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error)
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiUploadFileWithRequiredFileRequest struct {
type ApiUploadFileWithRequiredFileRequest struct {
ctx _context.Context
apiService *PetApiService
ApiService PetApi
petId int64
requiredFile **os.File
additionalMetadata *string
}
func (r apiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File) apiUploadFileWithRequiredFileRequest {
func (r ApiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File) ApiUploadFileWithRequiredFileRequest {
r.requiredFile = &requiredFile
return r
}
func (r apiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) apiUploadFileWithRequiredFileRequest {
func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileWithRequiredFileRequest {
r.additionalMetadata = &additionalMetadata
return r
}
func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) {
return r.ApiService.UploadFileWithRequiredFileExecute(r)
}
/*
UploadFileWithRequiredFile uploads an image (required)
* UploadFileWithRequiredFile uploads an image (required)
* @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
@return apiUploadFileWithRequiredFileRequest
*/
func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) apiUploadFileWithRequiredFileRequest {
return apiUploadFileWithRequiredFileRequest{
apiService: a,
* @return ApiUploadFileWithRequiredFileRequest
*/
func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest {
return ApiUploadFileWithRequiredFileRequest{
ApiService: a,
ctx: ctx,
petId: petId,
}
}
/*
Execute executes the request
@return ApiResponse
*/
func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) {
* Execute executes the request
* @return ApiResponse
*/
func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -897,7 +1074,7 @@ func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.
localVarReturnValue ApiResponse
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -940,12 +1117,12 @@ func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.
localVarFileName = localVarFile.Name()
localVarFile.Close()
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -964,7 +1141,7 @@ func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,

View File

@ -22,34 +22,98 @@ var (
_ _context.Context
)
type StoreApi interface {
/*
* DeleteOrder 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 orderId ID of the order that needs to be deleted
* @return ApiDeleteOrderRequest
*/
DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest
/*
* DeleteOrderExecute executes the request
*/
DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error)
/*
* GetInventory 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().
* @return ApiGetInventoryRequest
*/
GetInventory(ctx _context.Context) ApiGetInventoryRequest
/*
* GetInventoryExecute executes the request
* @return map[string]int32
*/
GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error)
/*
* GetOrderById 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 orderId ID of pet that needs to be fetched
* @return ApiGetOrderByIdRequest
*/
GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest
/*
* GetOrderByIdExecute executes the request
* @return Order
*/
GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error)
/*
* PlaceOrder Place an order for a pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPlaceOrderRequest
*/
PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest
/*
* PlaceOrderExecute executes the request
* @return Order
*/
PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error)
}
// StoreApiService StoreApi service
type StoreApiService service
type apiDeleteOrderRequest struct {
type ApiDeleteOrderRequest struct {
ctx _context.Context
apiService *StoreApiService
ApiService StoreApi
orderId string
}
func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.DeleteOrderExecute(r)
}
/*
DeleteOrder Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
* DeleteOrder 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 orderId ID of the order that needs to be deleted
@return apiDeleteOrderRequest
*/
func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) apiDeleteOrderRequest {
return apiDeleteOrderRequest{
apiService: a,
* @return ApiDeleteOrderRequest
*/
func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest {
return ApiDeleteOrderRequest{
ApiService: a,
ctx: ctx,
orderId: orderId,
}
}
/*
Execute executes the request
*/
func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
@ -58,7 +122,7 @@ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -87,12 +151,12 @@ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -113,29 +177,35 @@ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiGetInventoryRequest struct {
type ApiGetInventoryRequest struct {
ctx _context.Context
apiService *StoreApiService
ApiService StoreApi
}
func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) {
return r.ApiService.GetInventoryExecute(r)
}
/*
GetInventory Returns pet inventories by status
Returns a map of status codes to quantities
* GetInventory 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().
@return apiGetInventoryRequest
*/
func (a *StoreApiService) GetInventory(ctx _context.Context) apiGetInventoryRequest {
return apiGetInventoryRequest{
apiService: a,
* @return ApiGetInventoryRequest
*/
func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequest {
return ApiGetInventoryRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return map[string]int32
*/
func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) {
* Execute executes the request
* @return map[string]int32
*/
func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -145,7 +215,7 @@ func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response,
localVarReturnValue map[string]int32
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -187,12 +257,12 @@ func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response,
}
}
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -211,7 +281,7 @@ func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response,
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -222,32 +292,38 @@ func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response,
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiGetOrderByIdRequest struct {
type ApiGetOrderByIdRequest struct {
ctx _context.Context
apiService *StoreApiService
ApiService StoreApi
orderId int64
}
func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
return r.ApiService.GetOrderByIdExecute(r)
}
/*
GetOrderById Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
* GetOrderById 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 orderId ID of pet that needs to be fetched
@return apiGetOrderByIdRequest
*/
func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) apiGetOrderByIdRequest {
return apiGetOrderByIdRequest{
apiService: a,
* @return ApiGetOrderByIdRequest
*/
func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest {
return ApiGetOrderByIdRequest{
ApiService: a,
ctx: ctx,
orderId: orderId,
}
}
/*
Execute executes the request
@return Order
*/
func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
* Execute executes the request
* @return Order
*/
func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -257,7 +333,7 @@ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
localVarReturnValue Order
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -292,12 +368,12 @@ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -316,7 +392,7 @@ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -327,33 +403,39 @@ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiPlaceOrderRequest struct {
type ApiPlaceOrderRequest struct {
ctx _context.Context
apiService *StoreApiService
ApiService StoreApi
order *Order
}
func (r apiPlaceOrderRequest) Order(order Order) apiPlaceOrderRequest {
func (r ApiPlaceOrderRequest) Order(order Order) ApiPlaceOrderRequest {
r.order = &order
return r
}
func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) {
return r.ApiService.PlaceOrderExecute(r)
}
/*
PlaceOrder Place an order for a pet
* PlaceOrder Place an order for a pet
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return apiPlaceOrderRequest
*/
func (a *StoreApiService) PlaceOrder(ctx _context.Context) apiPlaceOrderRequest {
return apiPlaceOrderRequest{
apiService: a,
* @return ApiPlaceOrderRequest
*/
func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest {
return ApiPlaceOrderRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return Order
*/
func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) {
* Execute executes the request
* @return Order
*/
func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -363,7 +445,7 @@ func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) {
localVarReturnValue Order
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -396,12 +478,12 @@ func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) {
}
// body params
localVarPostBody = r.order
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -420,7 +502,7 @@ func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,

View File

@ -22,36 +22,148 @@ var (
_ _context.Context
)
type UserApi interface {
/*
* CreateUser 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().
* @return ApiCreateUserRequest
*/
CreateUser(ctx _context.Context) ApiCreateUserRequest
/*
* CreateUserExecute executes the request
*/
CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error)
/*
* CreateUsersWithArrayInput 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().
* @return ApiCreateUsersWithArrayInputRequest
*/
CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest
/*
* CreateUsersWithArrayInputExecute executes the request
*/
CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error)
/*
* CreateUsersWithListInput 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().
* @return ApiCreateUsersWithListInputRequest
*/
CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest
/*
* CreateUsersWithListInputExecute executes the request
*/
CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error)
/*
* DeleteUser 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 username The name that needs to be deleted
* @return ApiDeleteUserRequest
*/
DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest
/*
* DeleteUserExecute executes the request
*/
DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error)
/*
* GetUserByName Get user by user name
* @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 ApiGetUserByNameRequest
*/
GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest
/*
* GetUserByNameExecute executes the request
* @return User
*/
GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error)
/*
* LoginUser Logs user into the system
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiLoginUserRequest
*/
LoginUser(ctx _context.Context) ApiLoginUserRequest
/*
* LoginUserExecute executes the request
* @return string
*/
LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error)
/*
* LogoutUser 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().
* @return ApiLogoutUserRequest
*/
LogoutUser(ctx _context.Context) ApiLogoutUserRequest
/*
* LogoutUserExecute executes the request
*/
LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error)
/*
* UpdateUser 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 username name that need to be deleted
* @return ApiUpdateUserRequest
*/
UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest
/*
* UpdateUserExecute executes the request
*/
UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error)
}
// UserApiService UserApi service
type UserApiService service
type apiCreateUserRequest struct {
type ApiCreateUserRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
user *User
}
func (r apiCreateUserRequest) User(user User) apiCreateUserRequest {
func (r ApiCreateUserRequest) User(user User) ApiCreateUserRequest {
r.user = &user
return r
}
func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.CreateUserExecute(r)
}
/*
CreateUser Create user
This can only be done by the logged in user.
* CreateUser 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().
@return apiCreateUserRequest
*/
func (a *UserApiService) CreateUser(ctx _context.Context) apiCreateUserRequest {
return apiCreateUserRequest{
apiService: a,
* @return ApiCreateUserRequest
*/
func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest {
return ApiCreateUserRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -60,7 +172,7 @@ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -93,12 +205,12 @@ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) {
}
// body params
localVarPostBody = r.user
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -119,32 +231,38 @@ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiCreateUsersWithArrayInputRequest struct {
type ApiCreateUsersWithArrayInputRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
user *[]User
}
func (r apiCreateUsersWithArrayInputRequest) User(user []User) apiCreateUsersWithArrayInputRequest {
func (r ApiCreateUsersWithArrayInputRequest) User(user []User) ApiCreateUsersWithArrayInputRequest {
r.user = &user
return r
}
func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.CreateUsersWithArrayInputExecute(r)
}
/*
CreateUsersWithArrayInput Creates list of users with given input array
* CreateUsersWithArrayInput 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().
@return apiCreateUsersWithArrayInputRequest
*/
func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) apiCreateUsersWithArrayInputRequest {
return apiCreateUsersWithArrayInputRequest{
apiService: a,
* @return ApiCreateUsersWithArrayInputRequest
*/
func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest {
return ApiCreateUsersWithArrayInputRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -153,7 +271,7 @@ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, erro
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -186,12 +304,12 @@ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, erro
}
// body params
localVarPostBody = r.user
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -212,32 +330,38 @@ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, erro
return localVarHTTPResponse, nil
}
type apiCreateUsersWithListInputRequest struct {
type ApiCreateUsersWithListInputRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
user *[]User
}
func (r apiCreateUsersWithListInputRequest) User(user []User) apiCreateUsersWithListInputRequest {
func (r ApiCreateUsersWithListInputRequest) User(user []User) ApiCreateUsersWithListInputRequest {
r.user = &user
return r
}
func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.CreateUsersWithListInputExecute(r)
}
/*
CreateUsersWithListInput Creates list of users with given input array
* CreateUsersWithListInput 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().
@return apiCreateUsersWithListInputRequest
*/
func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) apiCreateUsersWithListInputRequest {
return apiCreateUsersWithListInputRequest{
apiService: a,
* @return ApiCreateUsersWithListInputRequest
*/
func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest {
return ApiCreateUsersWithListInputRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -246,7 +370,7 @@ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -279,12 +403,12 @@ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error
}
// body params
localVarPostBody = r.user
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -305,31 +429,37 @@ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error
return localVarHTTPResponse, nil
}
type apiDeleteUserRequest struct {
type ApiDeleteUserRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
username string
}
func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.DeleteUserExecute(r)
}
/*
DeleteUser Delete user
This can only be done by the logged in user.
* DeleteUser 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 username The name that needs to be deleted
@return apiDeleteUserRequest
*/
func (a *UserApiService) DeleteUser(ctx _context.Context, username string) apiDeleteUserRequest {
return apiDeleteUserRequest{
apiService: a,
* @return ApiDeleteUserRequest
*/
func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest {
return ApiDeleteUserRequest{
ApiService: a,
ctx: ctx,
username: username,
}
}
/*
Execute executes the request
*/
func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
@ -338,7 +468,7 @@ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -367,12 +497,12 @@ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -393,31 +523,37 @@ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiGetUserByNameRequest struct {
type ApiGetUserByNameRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
username string
}
func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
return r.ApiService.GetUserByNameExecute(r)
}
/*
GetUserByName Get user by user name
* GetUserByName Get user by user name
* @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 apiGetUserByNameRequest
*/
func (a *UserApiService) GetUserByName(ctx _context.Context, username string) apiGetUserByNameRequest {
return apiGetUserByNameRequest{
apiService: a,
* @return ApiGetUserByNameRequest
*/
func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest {
return ApiGetUserByNameRequest{
ApiService: a,
ctx: ctx,
username: username,
}
}
/*
Execute executes the request
@return User
*/
func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
* Execute executes the request
* @return User
*/
func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -427,7 +563,7 @@ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
localVarReturnValue User
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -456,12 +592,12 @@ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -480,7 +616,7 @@ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -491,38 +627,44 @@ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiLoginUserRequest struct {
type ApiLoginUserRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
username *string
password *string
}
func (r apiLoginUserRequest) Username(username string) apiLoginUserRequest {
func (r ApiLoginUserRequest) Username(username string) ApiLoginUserRequest {
r.username = &username
return r
}
func (r apiLoginUserRequest) Password(password string) apiLoginUserRequest {
func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest {
r.password = &password
return r
}
func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
return r.ApiService.LoginUserExecute(r)
}
/*
LoginUser Logs user into the system
* LoginUser Logs user into the system
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return apiLoginUserRequest
*/
func (a *UserApiService) LoginUser(ctx _context.Context) apiLoginUserRequest {
return apiLoginUserRequest{
apiService: a,
* @return ApiLoginUserRequest
*/
func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest {
return ApiLoginUserRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
@return string
*/
func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
* Execute executes the request
* @return string
*/
func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -532,7 +674,7 @@ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
localVarReturnValue string
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -568,12 +710,12 @@ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@ -592,7 +734,7 @@ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
@ -603,27 +745,33 @@ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, nil
}
type apiLogoutUserRequest struct {
type ApiLogoutUserRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
}
func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.LogoutUserExecute(r)
}
/*
LogoutUser Logs out current logged in user session
* LogoutUser 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().
@return apiLogoutUserRequest
*/
func (a *UserApiService) LogoutUser(ctx _context.Context) apiLogoutUserRequest {
return apiLogoutUserRequest{
apiService: a,
* @return ApiLogoutUserRequest
*/
func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest {
return ApiLogoutUserRequest{
ApiService: a,
ctx: ctx,
}
}
/*
Execute executes the request
*/
func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -632,7 +780,7 @@ func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -660,12 +808,12 @@ func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) {
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
@ -686,36 +834,42 @@ func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, nil
}
type apiUpdateUserRequest struct {
type ApiUpdateUserRequest struct {
ctx _context.Context
apiService *UserApiService
ApiService UserApi
username string
user *User
}
func (r apiUpdateUserRequest) User(user User) apiUpdateUserRequest {
func (r ApiUpdateUserRequest) User(user User) ApiUpdateUserRequest {
r.user = &user
return r
}
func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, error) {
return r.ApiService.UpdateUserExecute(r)
}
/*
UpdateUser Updated user
This can only be done by the logged in user.
* UpdateUser 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 username name that need to be deleted
@return apiUpdateUserRequest
*/
func (a *UserApiService) UpdateUser(ctx _context.Context, username string) apiUpdateUserRequest {
return apiUpdateUserRequest{
apiService: a,
* @return ApiUpdateUserRequest
*/
func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest {
return ApiUpdateUserRequest{
ApiService: a,
ctx: ctx,
username: username,
}
}
/*
Execute executes the request
*/
func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) {
* Execute executes the request
*/
func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
localVarPostBody interface{}
@ -724,7 +878,7 @@ func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) {
localVarFileBytes []byte
)
localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -758,12 +912,12 @@ func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) {
}
// body params
localVarPostBody = r.user
req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := r.apiService.client.callAPI(req)
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}

View File

@ -47,19 +47,19 @@ type APIClient struct {
// API Services
AnotherFakeApi *AnotherFakeApiService
AnotherFakeApi AnotherFakeApi
DefaultApi *DefaultApiService
DefaultApi DefaultApi
FakeApi *FakeApiService
FakeApi FakeApi
FakeClassnameTags123Api *FakeClassnameTags123ApiService
FakeClassnameTags123Api FakeClassnameTags123Api
PetApi *PetApiService
PetApi PetApi
StoreApi *StoreApiService
StoreApi StoreApi
UserApi *UserApiService
UserApi UserApi
}
type service struct {

View File

@ -26,12 +26,14 @@ var (
type AnotherFakeApiService service
/*
Call123TestSpecialTags To test special tags
To test special tags and operation ID starting with number
* Call123TestSpecialTags 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 client client model
@return Client
*/
* @return Client
*/
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch

View File

@ -26,10 +26,11 @@ var (
type DefaultApiService service
/*
FooGet Method for FooGet
* FooGet Method for FooGet
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return InlineResponseDefault
*/
* @return InlineResponseDefault
*/
func (a *DefaultApiService) FooGet(ctx _context.Context) (InlineResponseDefault, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet

View File

@ -29,10 +29,11 @@ var (
type FakeApiService service
/*
FakeHealthGet Health check endpoint
* FakeHealthGet Health check endpoint
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return HealthCheckResult
*/
* @return HealthCheckResult
*/
func (a *FakeApiService) FakeHealthGet(ctx _context.Context) (HealthCheckResult, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -110,13 +111,14 @@ type FakeHttpSignatureTestOpts struct {
}
/*
FakeHttpSignatureTest test http signature authentication
* FakeHttpSignatureTest test http signature authentication
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param pet Pet object that needs to be added to the store
* @param optional nil or *FakeHttpSignatureTestOpts - Optional Parameters:
* @param "Query1" (optional.String) - query parameter
* @param "Header1" (optional.String) - header parameter
*/
*/
func (a *FakeApiService) FakeHttpSignatureTest(ctx _context.Context, pet Pet, localVarOptionals *FakeHttpSignatureTestOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -191,13 +193,15 @@ type FakeOuterBooleanSerializeOpts struct {
}
/*
FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize
Test serialization of outer boolean types
* FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize
*
* 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 optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters:
* @param "Body" (optional.Bool) - Input boolean as post body
@return bool
*/
* @return bool
*/
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -279,13 +283,15 @@ type FakeOuterCompositeSerializeOpts struct {
}
/*
FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize
Test serialization of object with outer number type
* FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize
*
* 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 optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters:
* @param "OuterComposite" (optional.Interface of OuterComposite) - Input composite as post body
@return OuterComposite
*/
* @return OuterComposite
*/
func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -371,13 +377,15 @@ type FakeOuterNumberSerializeOpts struct {
}
/*
FakeOuterNumberSerialize Method for FakeOuterNumberSerialize
Test serialization of outer number types
* FakeOuterNumberSerialize Method for FakeOuterNumberSerialize
*
* 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 optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters:
* @param "Body" (optional.Float32) - Input number as post body
@return float32
*/
* @return float32
*/
func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -459,13 +467,15 @@ type FakeOuterStringSerializeOpts struct {
}
/*
FakeOuterStringSerialize Method for FakeOuterStringSerialize
Test serialization of outer string types
* FakeOuterStringSerialize Method for FakeOuterStringSerialize
*
* 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 optional nil or *FakeOuterStringSerializeOpts - Optional Parameters:
* @param "Body" (optional.String) - Input string as post body
@return string
*/
* @return string
*/
func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -542,11 +552,13 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar
}
/*
TestBodyWithFileSchema Method for TestBodyWithFileSchema
For this test, the body for this request much reference a schema named &#x60;File&#x60;.
* TestBodyWithFileSchema Method for TestBodyWithFileSchema
*
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param fileSchemaTestClass
*/
*/
func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, fileSchemaTestClass FileSchemaTestClass) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
@ -610,11 +622,12 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, fileSchema
}
/*
TestBodyWithQueryParams Method for TestBodyWithQueryParams
* TestBodyWithQueryParams Method for TestBodyWithQueryParams
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param query
* @param user
*/
*/
func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, user User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
@ -679,12 +692,14 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query str
}
/*
TestClientModel To test \"client\" model
To test \&quot;client\&quot; model
* TestClientModel To test \"client\" model
*
* To test \&quot;client\&quot; model
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param client client model
@return Client
*/
* @return Client
*/
func (a *FakeApiService) TestClientModel(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
@ -772,8 +787,10 @@ type TestEndpointParametersOpts struct {
}
/*
TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* TestEndpointParameters 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 number None
* @param double None
@ -790,7 +807,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
* @param "DateTime" (optional.Time) - None
* @param "Password" (optional.String) - None
* @param "Callback" (optional.String) - None
*/
*/
func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -922,8 +939,10 @@ type TestEnumParametersOpts struct {
}
/*
TestEnumParameters To test enum parameters
To test enum parameters
* TestEnumParameters 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 optional nil or *TestEnumParametersOpts - Optional Parameters:
* @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array)
@ -934,7 +953,7 @@ To test enum parameters
* @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double)
* @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array)
* @param "EnumFormString" (optional.String) - Form parameter enum test (string)
*/
*/
func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -1035,8 +1054,10 @@ type TestGroupParametersOpts struct {
}
/*
TestGroupParameters Fake endpoint to test group parameters (optional)
Fake endpoint to test group parameters (optional)
* TestGroupParameters 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 requiredStringGroup Required String in group parameters
* @param requiredBooleanGroup Required Boolean in group parameters
@ -1045,7 +1066,7 @@ Fake endpoint to test group parameters (optional)
* @param "StringGroup" (optional.Int32) - String in group parameters
* @param "BooleanGroup" (optional.Bool) - Boolean in group parameters
* @param "Int64Group" (optional.Int64) - Integer in group parameters
*/
*/
func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -1119,10 +1140,11 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStrin
}
/*
TestInlineAdditionalProperties test inline additionalProperties
* TestInlineAdditionalProperties test inline additionalProperties
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param requestBody request body
*/
*/
func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, requestBody map[string]string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -1186,11 +1208,12 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, re
}
/*
TestJsonFormData test json serialization of form data
* TestJsonFormData 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 param field1
* @param param2 field2
*/
*/
func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -1254,15 +1277,17 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa
}
/*
TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat
To test the collection format in query parameters
* TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat
*
* To test the collection format in query parameters
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param pipe
* @param ioutil
* @param http
* @param url
* @param context
*/
*/
func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut

View File

@ -26,12 +26,14 @@ var (
type FakeClassnameTags123ApiService service
/*
TestClassname To test class name in snake case
To test class name in snake case
* TestClassname 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 client client model
@return Client
*/
* @return Client
*/
func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch

View File

@ -29,10 +29,11 @@ var (
type PetApiService service
/*
AddPet Add a new pet to the store
* AddPet 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 pet Pet object that needs to be added to the store
*/
*/
func (a *PetApiService) AddPet(ctx _context.Context, pet Pet) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -101,12 +102,13 @@ type DeletePetOpts struct {
}
/*
DeletePet Deletes a pet
* DeletePet Deletes a pet
*
* @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) -
*/
*/
func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -173,12 +175,14 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOpt
}
/*
FindPetsByStatus Finds Pets by status
Multiple status values can be provided with comma separated strings
* FindPetsByStatus 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 status Status values that need to be considered for filter
@return []Pet
*/
* @return []Pet
*/
func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -251,12 +255,14 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string)
}
/*
FindPetsByTags Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* FindPetsByTags 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 tags Tags to filter by
@return []Pet
*/
* @return []Pet
*/
func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -329,12 +335,14 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P
}
/*
GetPetById Find pet by ID
Returns a single pet
* GetPetById 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 petId ID of pet to return
@return Pet
*/
* @return Pet
*/
func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -420,10 +428,11 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne
}
/*
UpdatePet Update an existing pet
* UpdatePet Update an existing pet
*
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param pet Pet object that needs to be added to the store
*/
*/
func (a *PetApiService) UpdatePet(ctx _context.Context, pet Pet) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
@ -493,13 +502,14 @@ type UpdatePetWithFormOpts struct {
}
/*
UpdatePetWithForm Updates a pet in the store with form data
* UpdatePetWithForm 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 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
* @param "Status" (optional.String) - Updated status of the pet
*/
*/
func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -575,14 +585,15 @@ type UploadFileOpts struct {
}
/*
UploadFile uploads an image
* UploadFile uploads an image
*
* @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
* @param "File" (optional.Interface of *os.File) - file to upload
@return ApiResponse
*/
* @return ApiResponse
*/
func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -679,14 +690,15 @@ type UploadFileWithRequiredFileOpts struct {
}
/*
UploadFileWithRequiredFile uploads an image (required)
* UploadFileWithRequiredFile uploads an image (required)
*
* @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:
* @param "AdditionalMetadata" (optional.String) - Additional data to pass to server
@return ApiResponse
*/
* @return ApiResponse
*/
func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost

View File

@ -27,11 +27,13 @@ var (
type StoreApiService service
/*
DeleteOrder Delete purchase order by ID
For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* DeleteOrder Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 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 orderId ID of the order that needs to be deleted
*/
*/
func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -95,11 +97,13 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_n
}
/*
GetInventory Returns pet inventories by status
Returns a map of status codes to quantities
* GetInventory 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().
@return map[string]int32
*/
* @return map[string]int32
*/
func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -183,12 +187,14 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32,
}
/*
GetOrderById Find purchase order by ID
For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* GetOrderById Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 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 orderId ID of pet that needs to be fetched
@return Order
*/
* @return Order
*/
func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -268,11 +274,12 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord
}
/*
PlaceOrder Place an order for a pet
* PlaceOrder 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 order order placed for purchasing the pet
@return Order
*/
* @return Order
*/
func (a *StoreApiService) PlaceOrder(ctx _context.Context, order Order) (Order, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost

View File

@ -27,11 +27,13 @@ var (
type UserApiService service
/*
CreateUser Create user
This can only be done by the logged in user.
* CreateUser 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 user Created user object
*/
*/
func (a *UserApiService) CreateUser(ctx _context.Context, user User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -95,10 +97,11 @@ func (a *UserApiService) CreateUser(ctx _context.Context, user User) (*_nethttp.
}
/*
CreateUsersWithArrayInput Creates list of users with given input array
* CreateUsersWithArrayInput 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 user List of user object
*/
*/
func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, user []User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -162,10 +165,11 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, user []
}
/*
CreateUsersWithListInput Creates list of users with given input array
* CreateUsersWithListInput 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 user List of user object
*/
*/
func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, user []User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
@ -229,11 +233,13 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, user []U
}
/*
DeleteUser Delete user
This can only be done by the logged in user.
* DeleteUser 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 username The name that needs to be deleted
*/
*/
func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
@ -297,11 +303,12 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_ne
}
/*
GetUserByName Get user by user name
* GetUserByName Get user by user name
*
* @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
*/
* @return User
*/
func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -375,12 +382,13 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U
}
/*
LoginUser Logs user into the system
* LoginUser Logs user into the system
*
* @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
*/
* @return string
*/
func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -454,9 +462,10 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo
}
/*
LogoutUser Logs out current logged in user session
* LogoutUser 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().
*/
*/
func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
@ -518,12 +527,14 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, e
}
/*
UpdateUser Updated user
This can only be done by the logged in user.
* UpdateUser 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 username name that need to be deleted
* @param user Updated user object
*/
*/
func (a *UserApiService) UpdateUser(ctx _context.Context, username string, user User) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut