From 4945c11ac779c829d1f7ee25da749ae9a9de69b8 Mon Sep 17 00:00:00 2001 From: Arvind Thirunarayanan Date: Sun, 23 Aug 2020 08:11:37 -0500 Subject: [PATCH] Regenerate go-experimental/oas2 samples w/o interfaces --- .../go-petstore/api_another_fake.go | 28 +- .../go-experimental/go-petstore/api_fake.go | 357 +++++++----------- .../go-petstore/api_fake_classname_tags123.go | 28 +- .../go-experimental/go-petstore/api_pet.go | 231 +++++------- .../go-experimental/go-petstore/api_store.go | 106 ++---- .../go-experimental/go-petstore/api_user.go | 202 ++++------ .../go-experimental/go-petstore/client.go | 12 +- .../go-petstore/api_another_fake.go | 11 +- .../go-petstore/api_default.go | 11 +- .../go-experimental/go-petstore/api_fake.go | 169 +++++++-- .../go-petstore/api_fake_classname_tags123.go | 11 +- .../go-experimental/go-petstore/api_pet.go | 107 +++++- .../go-experimental/go-petstore/api_store.go | 47 ++- .../go-experimental/go-petstore/api_user.go | 95 ++++- 14 files changed, 744 insertions(+), 671 deletions(-) diff --git a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go index 64bdce19dbea..7c30fb4ae74c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go @@ -21,28 +21,12 @@ 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 - */ - Call123TestSpecialTagsGetRequest(ctx _context.Context) ApiCall123TestSpecialTagsRequest - - /* - * Execute executes the request - * @return Client - */ - Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) - - } - // AnotherFakeApiService AnotherFakeApi service type AnotherFakeApiService service type ApiCall123TestSpecialTagsRequest struct { ctx _context.Context + ApiService *AnotherFakeApiService body *Client } @@ -50,14 +34,20 @@ func (r ApiCall123TestSpecialTagsRequest) Body(body Client) ApiCall123TestSpecia 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiCall123TestSpecialTagsRequest + * @return ApiCall123TestSpecialTagsRequest */ -func (a *AnotherFakeApiService) Call123TestSpecialTagsGetRequest(ctx _context.Context) ApiCall123TestSpecialTagsRequest { +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest { return ApiCall123TestSpecialTagsRequest{ + ApiService: a, ctx: ctx, } } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_fake.go index b2c0acfc2990..34e82339599c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake.go @@ -24,201 +24,12 @@ 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(). - * @return apiCreateXmlItemRequest - */ - CreateXmlItemGetRequest(ctx _context.Context) ApiCreateXmlItemRequest - - /* - * Execute executes the request - */ - CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_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(). - * @return apiFakeOuterBooleanSerializeRequest - */ - FakeOuterBooleanSerializeGetRequest(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest - - /* - * Execute executes the request - * @return bool - */ - FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (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(). - * @return apiFakeOuterCompositeSerializeRequest - */ - FakeOuterCompositeSerializeGetRequest(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest - - /* - * Execute executes the request - * @return OuterComposite - */ - FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (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(). - * @return apiFakeOuterNumberSerializeRequest - */ - FakeOuterNumberSerializeGetRequest(ctx _context.Context) ApiFakeOuterNumberSerializeRequest - - /* - * Execute executes the request - * @return float32 - */ - FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (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(). - * @return apiFakeOuterStringSerializeRequest - */ - FakeOuterStringSerializeGetRequest(ctx _context.Context) ApiFakeOuterStringSerializeRequest - - /* - * Execute executes the request - * @return string - */ - FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) - - /* - * TestBodyWithFileSchema Method for TestBodyWithFileSchema - * For this test, the body for this request much reference a schema named `File`. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestBodyWithFileSchemaRequest - */ - TestBodyWithFileSchemaGetRequest(ctx _context.Context) ApiTestBodyWithFileSchemaRequest - - /* - * Execute executes the request - */ - TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_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(). - * @return apiTestBodyWithQueryParamsRequest - */ - TestBodyWithQueryParamsGetRequest(ctx _context.Context) ApiTestBodyWithQueryParamsRequest - - /* - * Execute executes the request - */ - TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) - - /* - * TestClientModel To test \"client\" model - * To test "client" model - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestClientModelRequest - */ - TestClientModelGetRequest(ctx _context.Context) ApiTestClientModelRequest - - /* - * Execute executes the request - * @return Client - */ - TestClientModelExecute(r ApiTestClientModelRequest) (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(). - * @return apiTestEndpointParametersRequest - */ - TestEndpointParametersGetRequest(ctx _context.Context) ApiTestEndpointParametersRequest - - /* - * Execute executes the request - */ - TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_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(). - * @return apiTestEnumParametersRequest - */ - TestEnumParametersGetRequest(ctx _context.Context) ApiTestEnumParametersRequest - - /* - * Execute executes the request - */ - TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_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(). - * @return apiTestGroupParametersRequest - */ - TestGroupParametersGetRequest(ctx _context.Context) ApiTestGroupParametersRequest - - /* - * Execute executes the request - */ - TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_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(). - * @return apiTestInlineAdditionalPropertiesRequest - */ - TestInlineAdditionalPropertiesGetRequest(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest - - /* - * Execute executes the request - */ - TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_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(). - * @return apiTestJsonFormDataRequest - */ - TestJsonFormDataGetRequest(ctx _context.Context) ApiTestJsonFormDataRequest - - /* - * Execute executes the request - */ - TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_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(). - * @return apiTestQueryParameterCollectionFormatRequest - */ - TestQueryParameterCollectionFormatGetRequest(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest - - /* - * Execute executes the request - */ - TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) - - } - // FakeApiService FakeApi service type FakeApiService service type ApiCreateXmlItemRequest struct { ctx _context.Context + ApiService *FakeApiService xmlItem *XmlItem } @@ -226,14 +37,20 @@ func (r ApiCreateXmlItemRequest) XmlItem(xmlItem XmlItem) ApiCreateXmlItemReques r.xmlItem = &xmlItem return r } + +func (r ApiCreateXmlItemRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.CreateXmlItemExecute(r) +} + /* * 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(). - * @return apiCreateXmlItemRequest + * @return ApiCreateXmlItemRequest */ -func (a *FakeApiService) CreateXmlItemGetRequest(ctx _context.Context) ApiCreateXmlItemRequest { +func (a *FakeApiService) CreateXmlItem(ctx _context.Context) ApiCreateXmlItemRequest { return ApiCreateXmlItemRequest{ + ApiService: a, ctx: ctx, } } @@ -309,8 +126,10 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth return localVarHTTPResponse, nil } + type ApiFakeOuterBooleanSerializeRequest struct { ctx _context.Context + ApiService *FakeApiService body *bool } @@ -318,14 +137,20 @@ func (r ApiFakeOuterBooleanSerializeRequest) Body(body bool) ApiFakeOuterBoolean r.body = &body return r } + +func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { + return r.ApiService.FakeOuterBooleanSerializeExecute(r) +} + /* * 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(). - * @return apiFakeOuterBooleanSerializeRequest + * @return ApiFakeOuterBooleanSerializeRequest */ -func (a *FakeApiService) FakeOuterBooleanSerializeGetRequest(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest { +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest { return ApiFakeOuterBooleanSerializeRequest{ + ApiService: a, ctx: ctx, } } @@ -409,8 +234,10 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS return localVarReturnValue, localVarHTTPResponse, nil } + type ApiFakeOuterCompositeSerializeRequest struct { ctx _context.Context + ApiService *FakeApiService body *OuterComposite } @@ -418,14 +245,20 @@ func (r ApiFakeOuterCompositeSerializeRequest) Body(body OuterComposite) ApiFake r.body = &body return r } + +func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { + return r.ApiService.FakeOuterCompositeSerializeExecute(r) +} + /* * 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(). - * @return apiFakeOuterCompositeSerializeRequest + * @return ApiFakeOuterCompositeSerializeRequest */ -func (a *FakeApiService) FakeOuterCompositeSerializeGetRequest(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest { +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest { return ApiFakeOuterCompositeSerializeRequest{ + ApiService: a, ctx: ctx, } } @@ -509,8 +342,10 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos return localVarReturnValue, localVarHTTPResponse, nil } + type ApiFakeOuterNumberSerializeRequest struct { ctx _context.Context + ApiService *FakeApiService body *float32 } @@ -518,14 +353,20 @@ func (r ApiFakeOuterNumberSerializeRequest) Body(body float32) ApiFakeOuterNumbe r.body = &body return r } + +func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { + return r.ApiService.FakeOuterNumberSerializeExecute(r) +} + /* * 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(). - * @return apiFakeOuterNumberSerializeRequest + * @return ApiFakeOuterNumberSerializeRequest */ -func (a *FakeApiService) FakeOuterNumberSerializeGetRequest(ctx _context.Context) ApiFakeOuterNumberSerializeRequest { +func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest { return ApiFakeOuterNumberSerializeRequest{ + ApiService: a, ctx: ctx, } } @@ -609,8 +450,10 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer return localVarReturnValue, localVarHTTPResponse, nil } + type ApiFakeOuterStringSerializeRequest struct { ctx _context.Context + ApiService *FakeApiService body *string } @@ -618,14 +461,20 @@ func (r ApiFakeOuterStringSerializeRequest) Body(body string) ApiFakeOuterString r.body = &body return r } + +func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { + return r.ApiService.FakeOuterStringSerializeExecute(r) +} + /* * 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(). - * @return apiFakeOuterStringSerializeRequest + * @return ApiFakeOuterStringSerializeRequest */ -func (a *FakeApiService) FakeOuterStringSerializeGetRequest(ctx _context.Context) ApiFakeOuterStringSerializeRequest { +func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest { return ApiFakeOuterStringSerializeRequest{ + ApiService: a, ctx: ctx, } } @@ -709,8 +558,10 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer return localVarReturnValue, localVarHTTPResponse, nil } + type ApiTestBodyWithFileSchemaRequest struct { ctx _context.Context + ApiService *FakeApiService body *FileSchemaTestClass } @@ -718,14 +569,20 @@ func (r ApiTestBodyWithFileSchemaRequest) Body(body FileSchemaTestClass) ApiTest r.body = &body return r } + +func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestBodyWithFileSchemaExecute(r) +} + /* * TestBodyWithFileSchema Method for TestBodyWithFileSchema * For this test, the body for this request much reference a schema named `File`. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestBodyWithFileSchemaRequest + * @return ApiTestBodyWithFileSchemaRequest */ -func (a *FakeApiService) TestBodyWithFileSchemaGetRequest(ctx _context.Context) ApiTestBodyWithFileSchemaRequest { +func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest { return ApiTestBodyWithFileSchemaRequest{ + ApiService: a, ctx: ctx, } } @@ -801,8 +658,10 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche return localVarHTTPResponse, nil } + type ApiTestBodyWithQueryParamsRequest struct { ctx _context.Context + ApiService *FakeApiService query *string body *User } @@ -815,13 +674,19 @@ func (r ApiTestBodyWithQueryParamsRequest) Body(body User) ApiTestBodyWithQueryP r.body = &body return r } + +func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestBodyWithQueryParamsExecute(r) +} + /* * TestBodyWithQueryParams Method for TestBodyWithQueryParams * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestBodyWithQueryParamsRequest + * @return ApiTestBodyWithQueryParamsRequest */ -func (a *FakeApiService) TestBodyWithQueryParamsGetRequest(ctx _context.Context) ApiTestBodyWithQueryParamsRequest { +func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest { return ApiTestBodyWithQueryParamsRequest{ + ApiService: a, ctx: ctx, } } @@ -901,8 +766,10 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa return localVarHTTPResponse, nil } + type ApiTestClientModelRequest struct { ctx _context.Context + ApiService *FakeApiService body *Client } @@ -910,14 +777,20 @@ func (r ApiTestClientModelRequest) Body(body Client) ApiTestClientModelRequest { r.body = &body return r } + +func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { + return r.ApiService.TestClientModelExecute(r) +} + /* * TestClientModel To test \"client\" model * To test "client" model * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestClientModelRequest + * @return ApiTestClientModelRequest */ -func (a *FakeApiService) TestClientModelGetRequest(ctx _context.Context) ApiTestClientModelRequest { +func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientModelRequest { return ApiTestClientModelRequest{ + ApiService: a, ctx: ctx, } } @@ -1004,8 +877,10 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl return localVarReturnValue, localVarHTTPResponse, nil } + type ApiTestEndpointParametersRequest struct { ctx _context.Context + ApiService *FakeApiService number *float32 double *float64 patternWithoutDelimiter *string @@ -1078,6 +953,11 @@ func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpo r.callback = &callback return r } + +func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestEndpointParametersExecute(r) +} + /* * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters @@ -1085,10 +965,11 @@ func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpo 偽のエンドポイント 가짜 엔드 포인트 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestEndpointParametersRequest + * @return ApiTestEndpointParametersRequest */ -func (a *FakeApiService) TestEndpointParametersGetRequest(ctx _context.Context) ApiTestEndpointParametersRequest { +func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest { return ApiTestEndpointParametersRequest{ + ApiService: a, ctx: ctx, } } @@ -1225,8 +1106,10 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete return localVarHTTPResponse, nil } + type ApiTestEnumParametersRequest struct { ctx _context.Context + ApiService *FakeApiService enumHeaderStringArray *[]string enumHeaderString *string enumQueryStringArray *[]string @@ -1269,14 +1152,20 @@ func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiT r.enumFormString = &enumFormString return r } + +func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestEnumParametersExecute(r) +} + /* * 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(). - * @return apiTestEnumParametersRequest + * @return ApiTestEnumParametersRequest */ -func (a *FakeApiService) TestEnumParametersGetRequest(ctx _context.Context) ApiTestEnumParametersRequest { +func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest { return ApiTestEnumParametersRequest{ + ApiService: a, ctx: ctx, } } @@ -1371,8 +1260,10 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques return localVarHTTPResponse, nil } + type ApiTestGroupParametersRequest struct { ctx _context.Context + ApiService *FakeApiService requiredStringGroup *int32 requiredBooleanGroup *bool requiredInt64Group *int64 @@ -1405,14 +1296,20 @@ func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroup r.int64Group = &int64Group return r } + +func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestGroupParametersExecute(r) +} + /* * 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(). - * @return apiTestGroupParametersRequest + * @return ApiTestGroupParametersRequest */ -func (a *FakeApiService) TestGroupParametersGetRequest(ctx _context.Context) ApiTestGroupParametersRequest { +func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest { return ApiTestGroupParametersRequest{ + ApiService: a, ctx: ctx, } } @@ -1504,8 +1401,10 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ return localVarHTTPResponse, nil } + type ApiTestInlineAdditionalPropertiesRequest struct { ctx _context.Context + ApiService *FakeApiService param *map[string]string } @@ -1513,13 +1412,19 @@ func (r ApiTestInlineAdditionalPropertiesRequest) Param(param map[string]string) r.param = ¶m return r } + +func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestInlineAdditionalPropertiesExecute(r) +} + /* * TestInlineAdditionalProperties test inline additionalProperties * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestInlineAdditionalPropertiesRequest + * @return ApiTestInlineAdditionalPropertiesRequest */ -func (a *FakeApiService) TestInlineAdditionalPropertiesGetRequest(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest { +func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest { return ApiTestInlineAdditionalPropertiesRequest{ + ApiService: a, ctx: ctx, } } @@ -1595,8 +1500,10 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd return localVarHTTPResponse, nil } + type ApiTestJsonFormDataRequest struct { ctx _context.Context + ApiService *FakeApiService param *string param2 *string } @@ -1609,13 +1516,19 @@ func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataReq r.param2 = ¶m2 return r } + +func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestJsonFormDataExecute(r) +} + /* * 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(). - * @return apiTestJsonFormDataRequest + * @return ApiTestJsonFormDataRequest */ -func (a *FakeApiService) TestJsonFormDataGetRequest(ctx _context.Context) ApiTestJsonFormDataRequest { +func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest { return ApiTestJsonFormDataRequest{ + ApiService: a, ctx: ctx, } } @@ -1694,8 +1607,10 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( return localVarHTTPResponse, nil } + type ApiTestQueryParameterCollectionFormatRequest struct { ctx _context.Context + ApiService *FakeApiService pipe *[]string ioutil *[]string http *[]string @@ -1723,14 +1638,20 @@ func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) r.context = &context return r } + +func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestQueryParameterCollectionFormatExecute(r) +} + /* * 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(). - * @return apiTestQueryParameterCollectionFormatRequest + * @return ApiTestQueryParameterCollectionFormatRequest */ -func (a *FakeApiService) TestQueryParameterCollectionFormatGetRequest(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest { +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest { return ApiTestQueryParameterCollectionFormatRequest{ + ApiService: a, ctx: ctx, } } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go index 2df9fecaee07..f3196ff2bd80 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go @@ -21,28 +21,12 @@ 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 - */ - TestClassnameGetRequest(ctx _context.Context) ApiTestClassnameRequest - - /* - * Execute executes the request - * @return Client - */ - TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) - - } - // FakeClassnameTags123ApiService FakeClassnameTags123Api service type FakeClassnameTags123ApiService service type ApiTestClassnameRequest struct { ctx _context.Context + ApiService *FakeClassnameTags123ApiService body *Client } @@ -50,14 +34,20 @@ 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestClassnameRequest + * @return ApiTestClassnameRequest */ -func (a *FakeClassnameTags123ApiService) TestClassnameGetRequest(ctx _context.Context) ApiTestClassnameRequest { +func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) ApiTestClassnameRequest { return ApiTestClassnameRequest{ + ApiService: a, ctx: ctx, } } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/client/petstore/go-experimental/go-petstore/api_pet.go index 860410cf5d48..8482a367de29 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_pet.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_pet.go @@ -23,135 +23,12 @@ 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 - */ - AddPetGetRequest(ctx _context.Context) ApiAddPetRequest - - /* - * Execute 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 - */ - DeletePetGetRequest(ctx _context.Context, petId int64) ApiDeletePetRequest - - /* - * Execute 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 - */ - FindPetsByStatusGetRequest(ctx _context.Context) ApiFindPetsByStatusRequest - - /* - * Execute 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 - */ - FindPetsByTagsGetRequest(ctx _context.Context) ApiFindPetsByTagsRequest - - /* - * Execute 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 - */ - GetPetByIdGetRequest(ctx _context.Context, petId int64) ApiGetPetByIdRequest - - /* - * Execute 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 - */ - UpdatePetGetRequest(ctx _context.Context) ApiUpdatePetRequest - - /* - * Execute 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 - */ - UpdatePetWithFormGetRequest(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest - - /* - * Execute 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 - */ - UploadFileGetRequest(ctx _context.Context, petId int64) ApiUploadFileRequest - - /* - * Execute 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 - */ - UploadFileWithRequiredFileGetRequest(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest - - /* - * Execute executes the request - * @return ApiResponse - */ - UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) - - } - // PetApiService PetApi service type PetApiService service type ApiAddPetRequest struct { ctx _context.Context + ApiService *PetApiService body *Pet } @@ -159,13 +36,19 @@ 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiAddPetRequest + * @return ApiAddPetRequest */ -func (a *PetApiService) AddPetGetRequest(ctx _context.Context) ApiAddPetRequest { +func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { return ApiAddPetRequest{ + ApiService: a, ctx: ctx, } } @@ -241,8 +124,10 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e return localVarHTTPResponse, nil } + type ApiDeletePetRequest struct { ctx _context.Context + ApiService *PetApiService petId int64 apiKey *string } @@ -251,14 +136,20 @@ 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 * @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 + * @return ApiDeletePetRequest */ -func (a *PetApiService) DeletePetGetRequest(ctx _context.Context, petId int64) ApiDeletePetRequest { +func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest { return ApiDeletePetRequest{ + ApiService: a, ctx: ctx, petId: petId, } @@ -334,8 +225,10 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo return localVarHTTPResponse, nil } + type ApiFindPetsByStatusRequest struct { ctx _context.Context + ApiService *PetApiService status *[]string } @@ -343,14 +236,20 @@ func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusR 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiFindPetsByStatusRequest + * @return ApiFindPetsByStatusRequest */ -func (a *PetApiService) FindPetsByStatusGetRequest(ctx _context.Context) ApiFindPetsByStatusRequest { +func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest { return ApiFindPetsByStatusRequest{ + ApiService: a, ctx: ctx, } } @@ -436,8 +335,10 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ return localVarReturnValue, localVarHTTPResponse, nil } + type ApiFindPetsByTagsRequest struct { ctx _context.Context + ApiService *PetApiService tags *[]string } @@ -445,14 +346,20 @@ 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. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiFindPetsByTagsRequest + * @return ApiFindPetsByTagsRequest */ -func (a *PetApiService) FindPetsByTagsGetRequest(ctx _context.Context) ApiFindPetsByTagsRequest { +func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest { return ApiFindPetsByTagsRequest{ + ApiService: a, ctx: ctx, } } @@ -538,20 +445,28 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet return localVarReturnValue, localVarHTTPResponse, nil } + type ApiGetPetByIdRequest struct { ctx _context.Context + ApiService *PetApiService petId int64 } + +func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { + return r.ApiService.GetPetByIdExecute(r) +} + /* * 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 + * @return ApiGetPetByIdRequest */ -func (a *PetApiService) GetPetByIdGetRequest(ctx _context.Context, petId int64) ApiGetPetByIdRequest { +func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest { return ApiGetPetByIdRequest{ + ApiService: a, ctx: ctx, petId: petId, } @@ -649,8 +564,10 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt return localVarReturnValue, localVarHTTPResponse, nil } + type ApiUpdatePetRequest struct { ctx _context.Context + ApiService *PetApiService body *Pet } @@ -658,13 +575,19 @@ 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiUpdatePetRequest + * @return ApiUpdatePetRequest */ -func (a *PetApiService) UpdatePetGetRequest(ctx _context.Context) ApiUpdatePetRequest { +func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { return ApiUpdatePetRequest{ + ApiService: a, ctx: ctx, } } @@ -740,8 +663,10 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo return localVarHTTPResponse, nil } + type ApiUpdatePetWithFormRequest struct { ctx _context.Context + ApiService *PetApiService petId int64 name *string status *string @@ -755,14 +680,20 @@ func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormR 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 * @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 + * @return ApiUpdatePetWithFormRequest */ -func (a *PetApiService) UpdatePetWithFormGetRequest(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest { +func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest { return ApiUpdatePetWithFormRequest{ + ApiService: a, ctx: ctx, petId: petId, } @@ -841,8 +772,10 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) return localVarHTTPResponse, nil } + type ApiUploadFileRequest struct { ctx _context.Context + ApiService *PetApiService petId int64 additionalMetadata *string file **os.File @@ -856,14 +789,20 @@ 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 * @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 + * @return ApiUploadFileRequest */ -func (a *PetApiService) UploadFileGetRequest(ctx _context.Context, petId int64) ApiUploadFileRequest { +func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest { return ApiUploadFileRequest{ + ApiService: a, ctx: ctx, petId: petId, } @@ -961,8 +900,10 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, return localVarReturnValue, localVarHTTPResponse, nil } + type ApiUploadFileWithRequiredFileRequest struct { ctx _context.Context + ApiService *PetApiService petId int64 requiredFile **os.File additionalMetadata *string @@ -976,14 +917,20 @@ func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetad r.additionalMetadata = &additionalMetadata return r } + +func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { + return r.ApiService.UploadFileWithRequiredFileExecute(r) +} + /* * 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 + * @return ApiUploadFileWithRequiredFileRequest */ -func (a *PetApiService) UploadFileWithRequiredFileGetRequest(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { +func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { return ApiUploadFileWithRequiredFileRequest{ + ApiService: a, ctx: ctx, petId: petId, } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_store.go b/samples/client/petstore/go-experimental/go-petstore/api_store.go index 10510107472a..8b6b11215c6f 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_store.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_store.go @@ -22,82 +22,30 @@ 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 - */ - DeleteOrderGetRequest(ctx _context.Context, orderId string) ApiDeleteOrderRequest - - /* - * Execute 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 - */ - GetInventoryGetRequest(ctx _context.Context) ApiGetInventoryRequest - - /* - * Execute 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 - */ - GetOrderByIdGetRequest(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest - - /* - * Execute 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 - */ - PlaceOrderGetRequest(ctx _context.Context) ApiPlaceOrderRequest - - /* - * Execute executes the request - * @return Order - */ - PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) - - } - // StoreApiService StoreApi service type StoreApiService service type ApiDeleteOrderRequest struct { ctx _context.Context + ApiService *StoreApiService 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 * @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 + * @return ApiDeleteOrderRequest */ -func (a *StoreApiService) DeleteOrderGetRequest(ctx _context.Context, orderId string) ApiDeleteOrderRequest { +func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest { return ApiDeleteOrderRequest{ + ApiService: a, ctx: ctx, orderId: orderId, } @@ -170,18 +118,26 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp return localVarHTTPResponse, nil } + type ApiGetInventoryRequest struct { ctx _context.Context + ApiService *StoreApiService +} + + +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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiGetInventoryRequest + * @return ApiGetInventoryRequest */ -func (a *StoreApiService) GetInventoryGetRequest(ctx _context.Context) ApiGetInventoryRequest { +func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequest { return ApiGetInventoryRequest{ + ApiService: a, ctx: ctx, } } @@ -277,20 +233,28 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str return localVarReturnValue, localVarHTTPResponse, nil } + type ApiGetOrderByIdRequest struct { ctx _context.Context + ApiService *StoreApiService 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 * @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 + * @return ApiGetOrderByIdRequest */ -func (a *StoreApiService) GetOrderByIdGetRequest(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest { +func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest { return ApiGetOrderByIdRequest{ + ApiService: a, ctx: ctx, orderId: orderId, } @@ -380,8 +344,10 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, return localVarReturnValue, localVarHTTPResponse, nil } + type ApiPlaceOrderRequest struct { ctx _context.Context + ApiService *StoreApiService body *Order } @@ -389,13 +355,19 @@ 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiPlaceOrderRequest + * @return ApiPlaceOrderRequest */ -func (a *StoreApiService) PlaceOrderGetRequest(ctx _context.Context) ApiPlaceOrderRequest { +func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest { return ApiPlaceOrderRequest{ + ApiService: a, ctx: ctx, } } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_user.go b/samples/client/petstore/go-experimental/go-petstore/api_user.go index ff7a1e5d2b24..154028e83099 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_user.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_user.go @@ -22,118 +22,12 @@ 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 - */ - CreateUserGetRequest(ctx _context.Context) ApiCreateUserRequest - - /* - * Execute 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 - */ - CreateUsersWithArrayInputGetRequest(ctx _context.Context) ApiCreateUsersWithArrayInputRequest - - /* - * Execute 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 - */ - CreateUsersWithListInputGetRequest(ctx _context.Context) ApiCreateUsersWithListInputRequest - - /* - * Execute 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 - */ - DeleteUserGetRequest(ctx _context.Context, username string) ApiDeleteUserRequest - - /* - * Execute 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 - */ - GetUserByNameGetRequest(ctx _context.Context, username string) ApiGetUserByNameRequest - - /* - * Execute 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 - */ - LoginUserGetRequest(ctx _context.Context) ApiLoginUserRequest - - /* - * Execute 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 - */ - LogoutUserGetRequest(ctx _context.Context) ApiLogoutUserRequest - - /* - * Execute 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 - */ - UpdateUserGetRequest(ctx _context.Context, username string) ApiUpdateUserRequest - - /* - * Execute executes the request - */ - UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) - - } - // UserApiService UserApi service type UserApiService service type ApiCreateUserRequest struct { ctx _context.Context + ApiService *UserApiService body *User } @@ -141,14 +35,20 @@ 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. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiCreateUserRequest + * @return ApiCreateUserRequest */ -func (a *UserApiService) CreateUserGetRequest(ctx _context.Context) ApiCreateUserRequest { +func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { return ApiCreateUserRequest{ + ApiService: a, ctx: ctx, } } @@ -224,8 +124,10 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re return localVarHTTPResponse, nil } + type ApiCreateUsersWithArrayInputRequest struct { ctx _context.Context + ApiService *UserApiService body *[]User } @@ -233,13 +135,19 @@ func (r ApiCreateUsersWithArrayInputRequest) Body(body []User) ApiCreateUsersWit 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiCreateUsersWithArrayInputRequest + * @return ApiCreateUsersWithArrayInputRequest */ -func (a *UserApiService) CreateUsersWithArrayInputGetRequest(ctx _context.Context) ApiCreateUsersWithArrayInputRequest { +func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest { return ApiCreateUsersWithArrayInputRequest{ + ApiService: a, ctx: ctx, } } @@ -315,8 +223,10 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr return localVarHTTPResponse, nil } + type ApiCreateUsersWithListInputRequest struct { ctx _context.Context + ApiService *UserApiService body *[]User } @@ -324,13 +234,19 @@ func (r ApiCreateUsersWithListInputRequest) Body(body []User) ApiCreateUsersWith 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiCreateUsersWithListInputRequest + * @return ApiCreateUsersWithListInputRequest */ -func (a *UserApiService) CreateUsersWithListInputGetRequest(ctx _context.Context) ApiCreateUsersWithListInputRequest { +func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest { return ApiCreateUsersWithListInputRequest{ + ApiService: a, ctx: ctx, } } @@ -406,20 +322,28 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis return localVarHTTPResponse, nil } + type ApiDeleteUserRequest struct { ctx _context.Context + ApiService *UserApiService 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. * @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 + * @return ApiDeleteUserRequest */ -func (a *UserApiService) DeleteUserGetRequest(ctx _context.Context, username string) ApiDeleteUserRequest { +func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest { return ApiDeleteUserRequest{ + ApiService: a, ctx: ctx, username: username, } @@ -492,19 +416,27 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re return localVarHTTPResponse, nil } + type ApiGetUserByNameRequest struct { ctx _context.Context + ApiService *UserApiService username string } + +func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { + return r.ApiService.GetUserByNameExecute(r) +} + /* * 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 + * @return ApiGetUserByNameRequest */ -func (a *UserApiService) GetUserByNameGetRequest(ctx _context.Context, username string) ApiGetUserByNameRequest { +func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest { return ApiGetUserByNameRequest{ + ApiService: a, ctx: ctx, username: username, } @@ -588,8 +520,10 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, return localVarReturnValue, localVarHTTPResponse, nil } + type ApiLoginUserRequest struct { ctx _context.Context + ApiService *UserApiService username *string password *string } @@ -602,13 +536,19 @@ 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiLoginUserRequest + * @return ApiLoginUserRequest */ -func (a *UserApiService) LoginUserGetRequest(ctx _context.Context) ApiLoginUserRequest { +func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { return ApiLoginUserRequest{ + ApiService: a, ctx: ctx, } } @@ -698,17 +638,25 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth return localVarReturnValue, localVarHTTPResponse, nil } + type ApiLogoutUserRequest struct { ctx _context.Context + ApiService *UserApiService +} + + +func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.LogoutUserExecute(r) } /* * 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 + * @return ApiLogoutUserRequest */ -func (a *UserApiService) LogoutUserGetRequest(ctx _context.Context) ApiLogoutUserRequest { +func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { return ApiLogoutUserRequest{ + ApiService: a, ctx: ctx, } } @@ -779,8 +727,10 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re return localVarHTTPResponse, nil } + type ApiUpdateUserRequest struct { ctx _context.Context + ApiService *UserApiService username string body *User } @@ -789,15 +739,21 @@ 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. * @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 + * @return ApiUpdateUserRequest */ -func (a *UserApiService) UpdateUserGetRequest(ctx _context.Context, username string) ApiUpdateUserRequest { +func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest { return ApiUpdateUserRequest{ + ApiService: a, ctx: ctx, username: username, } diff --git a/samples/client/petstore/go-experimental/go-petstore/client.go b/samples/client/petstore/go-experimental/go-petstore/client.go index 09eb6b64596c..a9bd76d61238 100644 --- a/samples/client/petstore/go-experimental/go-petstore/client.go +++ b/samples/client/petstore/go-experimental/go-petstore/client.go @@ -47,17 +47,17 @@ type APIClient struct { // API Services - AnotherFakeApi AnotherFakeApi + AnotherFakeApi *AnotherFakeApiService - FakeApi FakeApi + FakeApi *FakeApiService - FakeClassnameTags123Api FakeClassnameTags123Api + FakeClassnameTags123Api *FakeClassnameTags123ApiService - PetApi PetApi + PetApi *PetApiService - StoreApi StoreApi + StoreApi *StoreApiService - UserApi UserApi + UserApi *UserApiService } type service struct { diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go index 0f59910d9081..621189f986d0 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go @@ -26,6 +26,7 @@ type AnotherFakeApiService service type ApiCall123TestSpecialTagsRequest struct { ctx _context.Context + ApiService *AnotherFakeApiService client *Client } @@ -33,14 +34,20 @@ func (r ApiCall123TestSpecialTagsRequest) Client(client Client) ApiCall123TestSp 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiCall123TestSpecialTagsRequest + * @return ApiCall123TestSpecialTagsRequest */ -func (a *AnotherFakeApiService) Call123TestSpecialTagsGetRequest(ctx _context.Context) ApiCall123TestSpecialTagsRequest { +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest { return ApiCall123TestSpecialTagsRequest{ + ApiService: a, ctx: ctx, } } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go index 5b75530a2cfa..dca50fcf2414 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go @@ -26,15 +26,22 @@ type DefaultApiService service type ApiFooGetRequest struct { ctx _context.Context + ApiService *DefaultApiService +} + + +func (r ApiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response, error) { + return r.ApiService.FooGetExecute(r) } /* * FooGet Method for FooGet * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiFooGetRequest + * @return ApiFooGetRequest */ -func (a *DefaultApiService) FooGetGetRequest(ctx _context.Context) ApiFooGetRequest { +func (a *DefaultApiService) FooGet(ctx _context.Context) ApiFooGetRequest { return ApiFooGetRequest{ + ApiService: a, ctx: ctx, } } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go index e157bea4341c..9c94052d25a3 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go @@ -29,15 +29,22 @@ type FakeApiService service type ApiFakeHealthGetRequest struct { ctx _context.Context + ApiService *FakeApiService +} + + +func (r ApiFakeHealthGetRequest) Execute() (HealthCheckResult, *_nethttp.Response, error) { + return r.ApiService.FakeHealthGetExecute(r) } /* * FakeHealthGet Health check endpoint * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiFakeHealthGetRequest + * @return ApiFakeHealthGetRequest */ -func (a *FakeApiService) FakeHealthGetGetRequest(ctx _context.Context) ApiFakeHealthGetRequest { +func (a *FakeApiService) FakeHealthGet(ctx _context.Context) ApiFakeHealthGetRequest { return ApiFakeHealthGetRequest{ + ApiService: a, ctx: ctx, } } @@ -119,8 +126,10 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health return localVarReturnValue, localVarHTTPResponse, nil } + type ApiFakeOuterBooleanSerializeRequest struct { ctx _context.Context + ApiService *FakeApiService body *bool } @@ -128,14 +137,20 @@ func (r ApiFakeOuterBooleanSerializeRequest) Body(body bool) ApiFakeOuterBoolean r.body = &body return r } + +func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { + return r.ApiService.FakeOuterBooleanSerializeExecute(r) +} + /* * 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(). - * @return apiFakeOuterBooleanSerializeRequest + * @return ApiFakeOuterBooleanSerializeRequest */ -func (a *FakeApiService) FakeOuterBooleanSerializeGetRequest(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest { +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest { return ApiFakeOuterBooleanSerializeRequest{ + ApiService: a, ctx: ctx, } } @@ -219,8 +234,10 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS return localVarReturnValue, localVarHTTPResponse, nil } + type ApiFakeOuterCompositeSerializeRequest struct { ctx _context.Context + ApiService *FakeApiService outerComposite *OuterComposite } @@ -228,14 +245,20 @@ func (r ApiFakeOuterCompositeSerializeRequest) OuterComposite(outerComposite Out r.outerComposite = &outerComposite return r } + +func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { + return r.ApiService.FakeOuterCompositeSerializeExecute(r) +} + /* * 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(). - * @return apiFakeOuterCompositeSerializeRequest + * @return ApiFakeOuterCompositeSerializeRequest */ -func (a *FakeApiService) FakeOuterCompositeSerializeGetRequest(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest { +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest { return ApiFakeOuterCompositeSerializeRequest{ + ApiService: a, ctx: ctx, } } @@ -319,8 +342,10 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos return localVarReturnValue, localVarHTTPResponse, nil } + type ApiFakeOuterNumberSerializeRequest struct { ctx _context.Context + ApiService *FakeApiService body *float32 } @@ -328,14 +353,20 @@ func (r ApiFakeOuterNumberSerializeRequest) Body(body float32) ApiFakeOuterNumbe r.body = &body return r } + +func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { + return r.ApiService.FakeOuterNumberSerializeExecute(r) +} + /* * 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(). - * @return apiFakeOuterNumberSerializeRequest + * @return ApiFakeOuterNumberSerializeRequest */ -func (a *FakeApiService) FakeOuterNumberSerializeGetRequest(ctx _context.Context) ApiFakeOuterNumberSerializeRequest { +func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest { return ApiFakeOuterNumberSerializeRequest{ + ApiService: a, ctx: ctx, } } @@ -419,8 +450,10 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer return localVarReturnValue, localVarHTTPResponse, nil } + type ApiFakeOuterStringSerializeRequest struct { ctx _context.Context + ApiService *FakeApiService body *string } @@ -428,14 +461,20 @@ func (r ApiFakeOuterStringSerializeRequest) Body(body string) ApiFakeOuterString r.body = &body return r } + +func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { + return r.ApiService.FakeOuterStringSerializeExecute(r) +} + /* * 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(). - * @return apiFakeOuterStringSerializeRequest + * @return ApiFakeOuterStringSerializeRequest */ -func (a *FakeApiService) FakeOuterStringSerializeGetRequest(ctx _context.Context) ApiFakeOuterStringSerializeRequest { +func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest { return ApiFakeOuterStringSerializeRequest{ + ApiService: a, ctx: ctx, } } @@ -519,8 +558,10 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer return localVarReturnValue, localVarHTTPResponse, nil } + type ApiTestBodyWithFileSchemaRequest struct { ctx _context.Context + ApiService *FakeApiService fileSchemaTestClass *FileSchemaTestClass } @@ -528,14 +569,20 @@ func (r ApiTestBodyWithFileSchemaRequest) FileSchemaTestClass(fileSchemaTestClas r.fileSchemaTestClass = &fileSchemaTestClass return r } + +func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestBodyWithFileSchemaExecute(r) +} + /* * TestBodyWithFileSchema Method for TestBodyWithFileSchema * For this test, the body for this request much reference a schema named `File`. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestBodyWithFileSchemaRequest + * @return ApiTestBodyWithFileSchemaRequest */ -func (a *FakeApiService) TestBodyWithFileSchemaGetRequest(ctx _context.Context) ApiTestBodyWithFileSchemaRequest { +func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest { return ApiTestBodyWithFileSchemaRequest{ + ApiService: a, ctx: ctx, } } @@ -611,8 +658,10 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche return localVarHTTPResponse, nil } + type ApiTestBodyWithQueryParamsRequest struct { ctx _context.Context + ApiService *FakeApiService query *string user *User } @@ -625,13 +674,19 @@ func (r ApiTestBodyWithQueryParamsRequest) User(user User) ApiTestBodyWithQueryP r.user = &user return r } + +func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestBodyWithQueryParamsExecute(r) +} + /* * TestBodyWithQueryParams Method for TestBodyWithQueryParams * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestBodyWithQueryParamsRequest + * @return ApiTestBodyWithQueryParamsRequest */ -func (a *FakeApiService) TestBodyWithQueryParamsGetRequest(ctx _context.Context) ApiTestBodyWithQueryParamsRequest { +func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest { return ApiTestBodyWithQueryParamsRequest{ + ApiService: a, ctx: ctx, } } @@ -711,8 +766,10 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa return localVarHTTPResponse, nil } + type ApiTestClientModelRequest struct { ctx _context.Context + ApiService *FakeApiService client *Client } @@ -720,14 +777,20 @@ func (r ApiTestClientModelRequest) Client(client Client) ApiTestClientModelReque r.client = &client return r } + +func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { + return r.ApiService.TestClientModelExecute(r) +} + /* * TestClientModel To test \"client\" model * To test "client" model * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestClientModelRequest + * @return ApiTestClientModelRequest */ -func (a *FakeApiService) TestClientModelGetRequest(ctx _context.Context) ApiTestClientModelRequest { +func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientModelRequest { return ApiTestClientModelRequest{ + ApiService: a, ctx: ctx, } } @@ -814,8 +877,10 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl return localVarReturnValue, localVarHTTPResponse, nil } + type ApiTestEndpointParametersRequest struct { ctx _context.Context + ApiService *FakeApiService number *float32 double *float64 patternWithoutDelimiter *string @@ -888,18 +953,24 @@ func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpo r.callback = &callback return r } + +func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestEndpointParametersExecute(r) +} + /* - * TestEndpointParameters 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(). - * @return apiTestEndpointParametersRequest + * @return ApiTestEndpointParametersRequest */ -func (a *FakeApiService) TestEndpointParametersGetRequest(ctx _context.Context) ApiTestEndpointParametersRequest { +func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest { return ApiTestEndpointParametersRequest{ + ApiService: a, ctx: ctx, } } @@ -1036,8 +1107,10 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete return localVarHTTPResponse, nil } + type ApiTestEnumParametersRequest struct { ctx _context.Context + ApiService *FakeApiService enumHeaderStringArray *[]string enumHeaderString *string enumQueryStringArray *[]string @@ -1080,14 +1153,20 @@ func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiT r.enumFormString = &enumFormString return r } + +func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestEnumParametersExecute(r) +} + /* * 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(). - * @return apiTestEnumParametersRequest + * @return ApiTestEnumParametersRequest */ -func (a *FakeApiService) TestEnumParametersGetRequest(ctx _context.Context) ApiTestEnumParametersRequest { +func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest { return ApiTestEnumParametersRequest{ + ApiService: a, ctx: ctx, } } @@ -1190,8 +1269,10 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques return localVarHTTPResponse, nil } + type ApiTestGroupParametersRequest struct { ctx _context.Context + ApiService *FakeApiService requiredStringGroup *int32 requiredBooleanGroup *bool requiredInt64Group *int64 @@ -1224,14 +1305,20 @@ func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroup r.int64Group = &int64Group return r } + +func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestGroupParametersExecute(r) +} + /* * 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(). - * @return apiTestGroupParametersRequest + * @return ApiTestGroupParametersRequest */ -func (a *FakeApiService) TestGroupParametersGetRequest(ctx _context.Context) ApiTestGroupParametersRequest { +func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest { return ApiTestGroupParametersRequest{ + ApiService: a, ctx: ctx, } } @@ -1323,8 +1410,10 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ return localVarHTTPResponse, nil } + type ApiTestInlineAdditionalPropertiesRequest struct { ctx _context.Context + ApiService *FakeApiService requestBody *map[string]string } @@ -1332,13 +1421,19 @@ func (r ApiTestInlineAdditionalPropertiesRequest) RequestBody(requestBody map[st r.requestBody = &requestBody return r } + +func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestInlineAdditionalPropertiesExecute(r) +} + /* * TestInlineAdditionalProperties test inline additionalProperties * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestInlineAdditionalPropertiesRequest + * @return ApiTestInlineAdditionalPropertiesRequest */ -func (a *FakeApiService) TestInlineAdditionalPropertiesGetRequest(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest { +func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest { return ApiTestInlineAdditionalPropertiesRequest{ + ApiService: a, ctx: ctx, } } @@ -1414,8 +1509,10 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd return localVarHTTPResponse, nil } + type ApiTestJsonFormDataRequest struct { ctx _context.Context + ApiService *FakeApiService param *string param2 *string } @@ -1428,13 +1525,19 @@ func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataReq r.param2 = ¶m2 return r } + +func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestJsonFormDataExecute(r) +} + /* * 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(). - * @return apiTestJsonFormDataRequest + * @return ApiTestJsonFormDataRequest */ -func (a *FakeApiService) TestJsonFormDataGetRequest(ctx _context.Context) ApiTestJsonFormDataRequest { +func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest { return ApiTestJsonFormDataRequest{ + ApiService: a, ctx: ctx, } } @@ -1513,8 +1616,10 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( return localVarHTTPResponse, nil } + type ApiTestQueryParameterCollectionFormatRequest struct { ctx _context.Context + ApiService *FakeApiService pipe *[]string ioutil *[]string http *[]string @@ -1542,14 +1647,20 @@ func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) r.context = &context return r } + +func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestQueryParameterCollectionFormatExecute(r) +} + /* * 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(). - * @return apiTestQueryParameterCollectionFormatRequest + * @return ApiTestQueryParameterCollectionFormatRequest */ -func (a *FakeApiService) TestQueryParameterCollectionFormatGetRequest(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest { +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest { return ApiTestQueryParameterCollectionFormatRequest{ + ApiService: a, ctx: ctx, } } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go index 1b2095f678c2..bb52ebf574ac 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go @@ -26,6 +26,7 @@ type FakeClassnameTags123ApiService service type ApiTestClassnameRequest struct { ctx _context.Context + ApiService *FakeClassnameTags123ApiService client *Client } @@ -33,14 +34,20 @@ 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiTestClassnameRequest + * @return ApiTestClassnameRequest */ -func (a *FakeClassnameTags123ApiService) TestClassnameGetRequest(ctx _context.Context) ApiTestClassnameRequest { +func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) ApiTestClassnameRequest { return ApiTestClassnameRequest{ + ApiService: a, ctx: ctx, } } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go index 4379495c0bc3..8da19763b5a4 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go @@ -28,6 +28,7 @@ type PetApiService service type ApiAddPetRequest struct { ctx _context.Context + ApiService *PetApiService pet *Pet } @@ -35,13 +36,19 @@ 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiAddPetRequest + * @return ApiAddPetRequest */ -func (a *PetApiService) AddPetGetRequest(ctx _context.Context) ApiAddPetRequest { +func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { return ApiAddPetRequest{ + ApiService: a, ctx: ctx, } } @@ -117,8 +124,10 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e return localVarHTTPResponse, nil } + type ApiDeletePetRequest struct { ctx _context.Context + ApiService *PetApiService petId int64 apiKey *string } @@ -127,14 +136,20 @@ 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 * @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 + * @return ApiDeletePetRequest */ -func (a *PetApiService) DeletePetGetRequest(ctx _context.Context, petId int64) ApiDeletePetRequest { +func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest { return ApiDeletePetRequest{ + ApiService: a, ctx: ctx, petId: petId, } @@ -210,8 +225,10 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo return localVarHTTPResponse, nil } + type ApiFindPetsByStatusRequest struct { ctx _context.Context + ApiService *PetApiService status *[]string } @@ -219,14 +236,20 @@ func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusR 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiFindPetsByStatusRequest + * @return ApiFindPetsByStatusRequest */ -func (a *PetApiService) FindPetsByStatusGetRequest(ctx _context.Context) ApiFindPetsByStatusRequest { +func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest { return ApiFindPetsByStatusRequest{ + ApiService: a, ctx: ctx, } } @@ -312,8 +335,10 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ return localVarReturnValue, localVarHTTPResponse, nil } + type ApiFindPetsByTagsRequest struct { ctx _context.Context + ApiService *PetApiService tags *[]string } @@ -321,14 +346,20 @@ 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. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiFindPetsByTagsRequest + * @return ApiFindPetsByTagsRequest */ -func (a *PetApiService) FindPetsByTagsGetRequest(ctx _context.Context) ApiFindPetsByTagsRequest { +func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest { return ApiFindPetsByTagsRequest{ + ApiService: a, ctx: ctx, } } @@ -414,20 +445,28 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet return localVarReturnValue, localVarHTTPResponse, nil } + type ApiGetPetByIdRequest struct { ctx _context.Context + ApiService *PetApiService petId int64 } + +func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { + return r.ApiService.GetPetByIdExecute(r) +} + /* * 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 + * @return ApiGetPetByIdRequest */ -func (a *PetApiService) GetPetByIdGetRequest(ctx _context.Context, petId int64) ApiGetPetByIdRequest { +func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest { return ApiGetPetByIdRequest{ + ApiService: a, ctx: ctx, petId: petId, } @@ -525,8 +564,10 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt return localVarReturnValue, localVarHTTPResponse, nil } + type ApiUpdatePetRequest struct { ctx _context.Context + ApiService *PetApiService pet *Pet } @@ -534,13 +575,19 @@ 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiUpdatePetRequest + * @return ApiUpdatePetRequest */ -func (a *PetApiService) UpdatePetGetRequest(ctx _context.Context) ApiUpdatePetRequest { +func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { return ApiUpdatePetRequest{ + ApiService: a, ctx: ctx, } } @@ -616,8 +663,10 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo return localVarHTTPResponse, nil } + type ApiUpdatePetWithFormRequest struct { ctx _context.Context + ApiService *PetApiService petId int64 name *string status *string @@ -631,14 +680,20 @@ func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormR 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 * @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 + * @return ApiUpdatePetWithFormRequest */ -func (a *PetApiService) UpdatePetWithFormGetRequest(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest { +func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest { return ApiUpdatePetWithFormRequest{ + ApiService: a, ctx: ctx, petId: petId, } @@ -717,8 +772,10 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) return localVarHTTPResponse, nil } + type ApiUploadFileRequest struct { ctx _context.Context + ApiService *PetApiService petId int64 additionalMetadata *string file **os.File @@ -732,14 +789,20 @@ 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 * @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 + * @return ApiUploadFileRequest */ -func (a *PetApiService) UploadFileGetRequest(ctx _context.Context, petId int64) ApiUploadFileRequest { +func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest { return ApiUploadFileRequest{ + ApiService: a, ctx: ctx, petId: petId, } @@ -837,8 +900,10 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, return localVarReturnValue, localVarHTTPResponse, nil } + type ApiUploadFileWithRequiredFileRequest struct { ctx _context.Context + ApiService *PetApiService petId int64 requiredFile **os.File additionalMetadata *string @@ -852,14 +917,20 @@ func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetad r.additionalMetadata = &additionalMetadata return r } + +func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { + return r.ApiService.UploadFileWithRequiredFileExecute(r) +} + /* * 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 + * @return ApiUploadFileWithRequiredFileRequest */ -func (a *PetApiService) UploadFileWithRequiredFileGetRequest(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { +func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { return ApiUploadFileWithRequiredFileRequest{ + ApiService: a, ctx: ctx, petId: petId, } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go index 897d996135ec..a31dba5cdc42 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go @@ -27,18 +27,25 @@ type StoreApiService service type ApiDeleteOrderRequest struct { ctx _context.Context + ApiService *StoreApiService 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 * @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 + * @return ApiDeleteOrderRequest */ -func (a *StoreApiService) DeleteOrderGetRequest(ctx _context.Context, orderId string) ApiDeleteOrderRequest { +func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest { return ApiDeleteOrderRequest{ + ApiService: a, ctx: ctx, orderId: orderId, } @@ -111,18 +118,26 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp return localVarHTTPResponse, nil } + type ApiGetInventoryRequest struct { ctx _context.Context + ApiService *StoreApiService +} + + +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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiGetInventoryRequest + * @return ApiGetInventoryRequest */ -func (a *StoreApiService) GetInventoryGetRequest(ctx _context.Context) ApiGetInventoryRequest { +func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequest { return ApiGetInventoryRequest{ + ApiService: a, ctx: ctx, } } @@ -218,20 +233,28 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str return localVarReturnValue, localVarHTTPResponse, nil } + type ApiGetOrderByIdRequest struct { ctx _context.Context + ApiService *StoreApiService 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 * @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 + * @return ApiGetOrderByIdRequest */ -func (a *StoreApiService) GetOrderByIdGetRequest(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest { +func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest { return ApiGetOrderByIdRequest{ + ApiService: a, ctx: ctx, orderId: orderId, } @@ -321,8 +344,10 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, return localVarReturnValue, localVarHTTPResponse, nil } + type ApiPlaceOrderRequest struct { ctx _context.Context + ApiService *StoreApiService order *Order } @@ -330,13 +355,19 @@ 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiPlaceOrderRequest + * @return ApiPlaceOrderRequest */ -func (a *StoreApiService) PlaceOrderGetRequest(ctx _context.Context) ApiPlaceOrderRequest { +func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest { return ApiPlaceOrderRequest{ + ApiService: a, ctx: ctx, } } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go index c7c32835e4d9..2c7e32333b33 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go @@ -27,6 +27,7 @@ type UserApiService service type ApiCreateUserRequest struct { ctx _context.Context + ApiService *UserApiService user *User } @@ -34,14 +35,20 @@ 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. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiCreateUserRequest + * @return ApiCreateUserRequest */ -func (a *UserApiService) CreateUserGetRequest(ctx _context.Context) ApiCreateUserRequest { +func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { return ApiCreateUserRequest{ + ApiService: a, ctx: ctx, } } @@ -117,8 +124,10 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re return localVarHTTPResponse, nil } + type ApiCreateUsersWithArrayInputRequest struct { ctx _context.Context + ApiService *UserApiService user *[]User } @@ -126,13 +135,19 @@ func (r ApiCreateUsersWithArrayInputRequest) User(user []User) ApiCreateUsersWit 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiCreateUsersWithArrayInputRequest + * @return ApiCreateUsersWithArrayInputRequest */ -func (a *UserApiService) CreateUsersWithArrayInputGetRequest(ctx _context.Context) ApiCreateUsersWithArrayInputRequest { +func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest { return ApiCreateUsersWithArrayInputRequest{ + ApiService: a, ctx: ctx, } } @@ -208,8 +223,10 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr return localVarHTTPResponse, nil } + type ApiCreateUsersWithListInputRequest struct { ctx _context.Context + ApiService *UserApiService user *[]User } @@ -217,13 +234,19 @@ func (r ApiCreateUsersWithListInputRequest) User(user []User) ApiCreateUsersWith 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiCreateUsersWithListInputRequest + * @return ApiCreateUsersWithListInputRequest */ -func (a *UserApiService) CreateUsersWithListInputGetRequest(ctx _context.Context) ApiCreateUsersWithListInputRequest { +func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest { return ApiCreateUsersWithListInputRequest{ + ApiService: a, ctx: ctx, } } @@ -299,20 +322,28 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis return localVarHTTPResponse, nil } + type ApiDeleteUserRequest struct { ctx _context.Context + ApiService *UserApiService 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. * @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 + * @return ApiDeleteUserRequest */ -func (a *UserApiService) DeleteUserGetRequest(ctx _context.Context, username string) ApiDeleteUserRequest { +func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest { return ApiDeleteUserRequest{ + ApiService: a, ctx: ctx, username: username, } @@ -385,19 +416,27 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re return localVarHTTPResponse, nil } + type ApiGetUserByNameRequest struct { ctx _context.Context + ApiService *UserApiService username string } + +func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { + return r.ApiService.GetUserByNameExecute(r) +} + /* * 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 + * @return ApiGetUserByNameRequest */ -func (a *UserApiService) GetUserByNameGetRequest(ctx _context.Context, username string) ApiGetUserByNameRequest { +func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest { return ApiGetUserByNameRequest{ + ApiService: a, ctx: ctx, username: username, } @@ -481,8 +520,10 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, return localVarReturnValue, localVarHTTPResponse, nil } + type ApiLoginUserRequest struct { ctx _context.Context + ApiService *UserApiService username *string password *string } @@ -495,13 +536,19 @@ 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 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return apiLoginUserRequest + * @return ApiLoginUserRequest */ -func (a *UserApiService) LoginUserGetRequest(ctx _context.Context) ApiLoginUserRequest { +func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { return ApiLoginUserRequest{ + ApiService: a, ctx: ctx, } } @@ -591,17 +638,25 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth return localVarReturnValue, localVarHTTPResponse, nil } + type ApiLogoutUserRequest struct { ctx _context.Context + ApiService *UserApiService +} + + +func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.LogoutUserExecute(r) } /* * 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 + * @return ApiLogoutUserRequest */ -func (a *UserApiService) LogoutUserGetRequest(ctx _context.Context) ApiLogoutUserRequest { +func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { return ApiLogoutUserRequest{ + ApiService: a, ctx: ctx, } } @@ -672,8 +727,10 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re return localVarHTTPResponse, nil } + type ApiUpdateUserRequest struct { ctx _context.Context + ApiService *UserApiService username string user *User } @@ -682,15 +739,21 @@ 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. * @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 + * @return ApiUpdateUserRequest */ -func (a *UserApiService) UpdateUserGetRequest(ctx _context.Context, username string) ApiUpdateUserRequest { +func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest { return ApiUpdateUserRequest{ + ApiService: a, ctx: ctx, username: username, }